Genetic optimizer research

I measured how much a genetic algorithm overfits trading strategies. 12 of 128 folds lost over 30%, and every one came from mutations that changed the trade itself

I ran NexusTrade's genetic optimizer on 8 of my strategies with anchored walk-forward testing. The strategies it picked kept most of their training Sharpe on unseen data. The large losses came from mutations that turned puts into calls and resized orders.

As of 2026-11-24

Folds below -30%, unrestricted mutation
12of 128 out-of-sample folds; worst -100.0%
Folds below -30%, structure locked
0of 127; worst -27.0%
Median overfit gap (Sharpe)
-0.13 to 0.23training minus out-of-sample, per fold
Explore more topics

TL;DR

Walk-forward testing kept the genetic algorithm from overfitting in the usual sense. Across 256 folds on 8 of my strategies, the median drop from training Sharpe to out-of-sample Sharpe was between -0.13 and 0.23 for every variant. The large losses had a different cause. When mutation could turn puts into calls or set an order to thousands of contracts, 12 folds lost more than 30%, and one lost everything. After I locked the option structure and order units, none did in that test. In a follow-up of 96 folds, letting the GA flip comparisons (> to <) raised median out-of-sample Sharpe at high mutation from 0.03 and -0.36 to 0.56 and 0.61.

Out-of-sample return of every fold, by mutation rule

Out-of-sample return per fold, 8 strategies x 4 folds
WorstMeanMedian
Unrestricted mutation, run A (intensity 0.1)-99.9%-2.2%+4.1%
Unrestricted mutation, run B (intensity 0.1)-100%-4.5%+3.4%
Structure locks (intensity 0.1)-12.7%+4.9%+4.9%
Structure locks + worst-window fitness (intensity 0.1)-27%+1.9%+2%
Unrestricted mutation, run A (intensity 0.9)-92.4%-0.9%+4.5%
Unrestricted mutation, run B (intensity 0.9)-68%-0.7%+3.9%
Structure locks (intensity 0.9)-14.6%+3.8%+1.5%
Structure locks + worst-window fitness (intensity 0.9)-16%+4.5%+4.1%
Unchanged strategy-11.3%+4.8%+2.9%

Main test: 8 strategies, 4 folds each, optimizing Sharpe and return, population 6 for 6 generations. Locked means option type, direction, expirations and order units cannot mutate.

Show the table · 256 rows, 9 columns

Scroll sideways to compare all columns. Select a heading to sort.

Unrestricted mutation, run A0.1SPY iron condor10.09-0.67-9.0%-12.15-0.7%
Unrestricted mutation, run A0.1SPY iron condor2-2.69-3.79-1.3%-40.56-0.1%
Unrestricted mutation, run A0.1SPY iron condor30.76-0.73-41.8%-77.93+0.0%
Unrestricted mutation, run A0.1SPY iron condor4-0.130.25-54.0%-17.22-0.4%
Unrestricted mutation, run A0.1IWM RSI oversold11.14-0.06-99.9%-1.69+2.0%
Unrestricted mutation, run A0.1IWM RSI oversold2-0.18-0.49-2.1%-1.63+0.1%
Unrestricted mutation, run A0.1IWM RSI oversold30.39-0.60-10.6%-0.37+1.6%
Unrestricted mutation, run A0.1IWM RSI oversold4-0.330.85+9.0%0.85+9.0%
Unrestricted mutation, run A0.1congress 2-buyer10.540.84+19.9%0.74+10.9%
Unrestricted mutation, run A0.1congress 2-buyer20.550.16+3.9%0.02+1.1%
Unrestricted mutation, run A0.1congress 2-buyer30.62-0.55-3.8%-0.38-2.1%
Unrestricted mutation, run A0.1congress 2-buyer40.601.09+14.9%0.79+11.7%
Unrestricted mutation, run A0.1insider officer-director10.281.03+11.0%0.99+10.7%
Unrestricted mutation, run A0.1insider officer-director20.520.50+10.2%0.06+2.3%
Unrestricted mutation, run A0.1insider officer-director30.100.34+5.0%0.34+5.0%
Unrestricted mutation, run A0.1insider officer-director40.540.91+13.5%0.27+4.7%
Unrestricted mutation, run A0.113F accumulation1-0.011.08+14.8%1.23+28.1%
Unrestricted mutation, run A0.113F accumulation2-0.030.29+6.0%0.03+1.4%
Unrestricted mutation, run A0.113F accumulation30.051.24+22.4%1.49+30.7%
Unrestricted mutation, run A0.113F accumulation40.68-0.27-4.7%-0.12-8.5%
Unrestricted mutation, run A0.1sentiment tech1-0.08-0.45-4.0%0.68+12.0%
Unrestricted mutation, run A0.1sentiment tech20.050.04+0.9%0.16+3.5%
Unrestricted mutation, run A0.1sentiment tech30.060.58+9.9%-0.02+0.4%
Unrestricted mutation, run A0.1sentiment tech40.39-0.31-9.3%-0.63-11.3%
Unrestricted mutation, run A0.1SP500 top-5010.340.95+12.7%1.13+13.3%
Unrestricted mutation, run A0.1SP500 top-5020.34-0.22-2.7%0.59+10.7%
Unrestricted mutation, run A0.1SP500 top-5030.450.70+8.1%0.70+8.1%
Unrestricted mutation, run A0.1SP500 top-5040.590.57+7.7%0.22+4.3%
Unrestricted mutation, run A0.1IWM put credit spread10.290.39+4.7%0.22+4.3%
Unrestricted mutation, run A0.1IWM put credit spread2-0.05-1.43-7.5%-1.42-6.3%
Unrestricted mutation, run A0.1IWM put credit spread30.17-1.16+1.7%1.11+6.4%
Unrestricted mutation, run A0.1IWM put credit spread40.210.36+4.3%-0.14+0.8%
Unrestricted mutation, run B0.1SPY iron condor11.111.31+25.6%-12.15-0.7%
Unrestricted mutation, run B0.1SPY iron condor20.51-1.03-82.4%-40.56-0.1%
Unrestricted mutation, run B0.1SPY iron condor30.94-3.23-82.3%-77.93+0.0%
Unrestricted mutation, run B0.1SPY iron condor40.30-0.01-40.5%-17.22-0.4%
Unrestricted mutation, run B0.1IWM RSI oversold1-0.340.43+5.8%-1.69+2.0%
Unrestricted mutation, run B0.1IWM RSI oversold20.67-0.55-25.6%-1.63+0.1%
Unrestricted mutation, run B0.1IWM RSI oversold30.02-0.37+0.6%-0.37+1.6%
Unrestricted mutation, run B0.1IWM RSI oversold4-0.040.38-100.0%0.85+9.0%
Unrestricted mutation, run B0.1congress 2-buyer10.950.09+1.5%0.74+10.9%
Unrestricted mutation, run B0.1congress 2-buyer20.54-0.23-4.5%0.02+1.1%
Unrestricted mutation, run B0.1congress 2-buyer30.65-0.27-0.2%-0.38-2.1%
Unrestricted mutation, run B0.1congress 2-buyer40.581.16+18.9%0.79+11.7%
Unrestricted mutation, run B0.1insider officer-director10.400.14+4.1%0.99+10.7%
Unrestricted mutation, run B0.1insider officer-director20.300.09+2.7%0.06+2.3%
Unrestricted mutation, run B0.1insider officer-director30.370.63+8.0%0.34+5.0%
Unrestricted mutation, run B0.1insider officer-director40.270.50+7.0%0.27+4.7%
Unrestricted mutation, run B0.113F accumulation1-0.261.65+29.2%1.23+28.1%
Unrestricted mutation, run B0.113F accumulation20.780.51+11.4%0.03+1.4%
Unrestricted mutation, run B0.113F accumulation30.601.05+17.1%1.49+30.7%
Unrestricted mutation, run B0.113F accumulation40.350.05-3.3%-0.12-8.5%
Unrestricted mutation, run B0.1sentiment tech1-0.071.90+27.5%0.68+12.0%
Unrestricted mutation, run B0.1sentiment tech20.140.31+6.6%0.16+3.5%
Unrestricted mutation, run B0.1sentiment tech30.030.83+14.2%-0.02+0.4%
Unrestricted mutation, run B0.1sentiment tech40.27-0.51-12.9%-0.63-11.3%
Unrestricted mutation, run B0.1SP500 top-5010.360.93+12.3%1.13+13.3%
Unrestricted mutation, run B0.1SP500 top-5020.37-0.21-2.3%0.59+10.7%
Unrestricted mutation, run B0.1SP500 top-5030.450.70+8.1%0.70+8.1%
Unrestricted mutation, run B0.1SP500 top-5040.560.58+9.2%0.22+4.3%
Unrestricted mutation, run B0.1IWM put credit spread10.200.49+5.7%0.22+4.3%
Unrestricted mutation, run B0.1IWM put credit spread2-0.05-1.43-7.5%-1.42-6.3%
Unrestricted mutation, run B0.1IWM put credit spread30.92-0.80+2.0%1.11+6.4%
Unrestricted mutation, run B0.1IWM put credit spread40.75-0.86+0.0%-0.14+0.8%
Structure locks0.1SPY iron condor1-2.65-2.47+0.1%-12.15-0.7%
Structure locks0.1SPY iron condor20.23-2.58+0.9%-40.56-0.1%
Structure locks0.1SPY iron condor3-0.81-0.43-2.8%-77.93+0.0%
Structure locks0.1SPY iron condor4-1.83-2.84+0.8%-17.22-0.4%
Structure locks0.1IWM RSI oversold1-3.14-6.10-12.7%-1.69+2.0%
Structure locks0.1IWM RSI oversold20.19-1.50-1.2%-1.63+0.1%
Structure locks0.1IWM RSI oversold3-0.36-0.37+1.6%-0.37+1.6%
Structure locks0.1IWM RSI oversold40.030.82+8.7%0.85+9.0%
Structure locks0.1congress 2-buyer10.560.81+11.5%0.74+10.9%
Structure locks0.1congress 2-buyer20.55-0.04-0.1%0.02+1.1%
Structure locks0.1congress 2-buyer30.690.32+5.2%-0.38-2.1%
Structure locks0.1congress 2-buyer40.661.44+21.3%0.79+11.7%
Structure locks0.1insider officer-director10.580.76+10.8%0.99+10.7%
Structure locks0.1insider officer-director20.550.47+9.7%0.06+2.3%
Structure locks0.1insider officer-director30.460.33+5.5%0.34+5.0%
Structure locks0.1insider officer-director40.540.74+10.8%0.27+4.7%
Structure locks0.113F accumulation10.620.17+4.6%1.23+28.1%
Structure locks0.113F accumulation20.210.21+4.5%0.03+1.4%
Structure locks0.113F accumulation31.010.63+9.8%1.49+30.7%
Structure locks0.113F accumulation40.800.39+8.1%-0.12-8.5%
Structure locks0.1sentiment tech10.030.83+13.6%0.68+12.0%
Structure locks0.1sentiment tech20.150.58+12.8%0.16+3.5%
Structure locks0.1sentiment tech30.080.36+6.7%-0.02+0.4%
Structure locks0.1sentiment tech40.38-0.21-4.6%-0.63-11.3%
Structure locks0.1SP500 top-5010.330.88+12.1%1.13+13.3%
Structure locks0.1SP500 top-5020.37-0.29-3.7%0.59+10.7%
Structure locks0.1SP500 top-5030.460.64+7.6%0.70+8.1%
Structure locks0.1SP500 top-5040.630.61+9.5%0.22+4.3%
Structure locks0.1IWM put credit spread10.210.22+4.3%0.22+4.3%
Structure locks0.1IWM put credit spread2-0.19-1.42-6.3%-1.42-6.3%
Structure locks0.1IWM put credit spread30.050.38+3.8%1.11+6.4%
Structure locks0.1IWM put credit spread40.210.67+3.9%-0.14+0.8%
Structure locks + worst-window fitness0.1SPY iron condor1-11.43-8.07-0.3%-12.15-0.7%
Structure locks + worst-window fitness0.1SPY iron condor2-0.80-0.75-8.6%-40.56-0.1%
Structure locks + worst-window fitness0.1SPY iron condor3-10.77-21.33-0.0%-77.93+0.0%
Structure locks + worst-window fitness0.1SPY iron condor4-0.67-1.51-25.8%-17.22-0.4%
Structure locks + worst-window fitness0.1IWM RSI oversold1-2.61-4.12-8.3%-1.69+2.0%
Structure locks + worst-window fitness0.1IWM RSI oversold20.13-2.64-27.0%-1.63+0.1%
Structure locks + worst-window fitness0.1IWM RSI oversold3-0.36-0.37+1.6%-0.37+1.6%
Structure locks + worst-window fitness0.1IWM RSI oversold4-0.380.20+4.1%0.85+9.0%
Structure locks + worst-window fitness0.1congress 2-buyer10.500.63+9.1%0.74+10.9%
Structure locks + worst-window fitness0.1congress 2-buyer20.55-0.04-0.1%0.02+1.1%
Structure locks + worst-window fitness0.1congress 2-buyer30.56-0.57-2.8%-0.38-2.1%
Structure locks + worst-window fitness0.1congress 2-buyer40.721.11+16.1%0.79+11.7%
Structure locks + worst-window fitness0.1insider officer-director10.431.20+14.2%0.99+10.7%
Structure locks + worst-window fitness0.1insider officer-director20.450.15+3.6%0.06+2.3%
Structure locks + worst-window fitness0.1insider officer-director30.480.03+2.3%0.34+5.0%
Structure locks + worst-window fitness0.1insider officer-director40.540.57+7.8%0.27+4.7%
Structure locks + worst-window fitness0.113F accumulation1-0.03-0.16+1.4%1.23+28.1%
Structure locks + worst-window fitness0.113F accumulation20.630.50+10.3%0.03+1.4%
Structure locks + worst-window fitness0.113F accumulation30.630.02+1.6%1.49+30.7%
Structure locks + worst-window fitness0.113F accumulation40.32-0.13-0.3%-0.12-8.5%
Structure locks + worst-window fitness0.1sentiment tech10.050.98+15.9%0.68+12.0%
Structure locks + worst-window fitness0.1sentiment tech20.060.38+7.9%0.16+3.5%
Structure locks + worst-window fitness0.1sentiment tech3-0.07-0.16-1.9%-0.02+0.4%
Structure locks + worst-window fitness0.1sentiment tech40.29-0.13-5.9%-0.63-11.3%
Structure locks + worst-window fitness0.1SP500 top-5010.240.90+10.6%1.13+13.3%
Structure locks + worst-window fitness0.1SP500 top-5020.310.50+9.0%0.59+10.7%
Structure locks + worst-window fitness0.1SP500 top-5030.470.56+6.8%0.70+8.1%
Structure locks + worst-window fitness0.1SP500 top-5040.590.59+7.4%0.22+4.3%
Structure locks + worst-window fitness0.1IWM put credit spread10.662.08+14.1%0.22+4.3%
Structure locks + worst-window fitness0.1IWM put credit spread20.24-0.70-9.1%-1.42-6.3%
Structure locks + worst-window fitness0.1IWM put credit spread30.26-8.02+0.4%1.11+6.4%
Structure locks + worst-window fitness0.1IWM put credit spread40.020.80+7.5%-0.14+0.8%
Unrestricted mutation, run A0.9SPY iron condor1-0.980.58+10.1%-12.15-0.7%
Unrestricted mutation, run A0.9SPY iron condor20.760.33-2.1%-40.56-0.1%
Unrestricted mutation, run A0.9SPY iron condor30.26-1.54-92.4%-77.93+0.0%
Unrestricted mutation, run A0.9SPY iron condor4-1.20-3.54-6.0%-17.22-0.4%
Unrestricted mutation, run A0.9IWM RSI oversold10.410.61+10.9%-1.69+2.0%
Unrestricted mutation, run A0.9IWM RSI oversold20.62-0.39-3.9%-1.63+0.1%
Unrestricted mutation, run A0.9IWM RSI oversold30.04-1.47-49.0%-0.37+1.6%
Unrestricted mutation, run A0.9IWM RSI oversold40.10-0.85-29.0%0.85+9.0%
Unrestricted mutation, run A0.9congress 2-buyer10.400.29+6.5%0.74+10.9%
Unrestricted mutation, run A0.9congress 2-buyer20.53-0.05+0.1%0.02+1.1%
Unrestricted mutation, run A0.9congress 2-buyer30.640.21+4.1%-0.38-2.1%
Unrestricted mutation, run A0.9congress 2-buyer40.641.14+17.5%0.79+11.7%
Unrestricted mutation, run A0.9insider officer-director10.440.62+8.4%0.99+10.7%
Unrestricted mutation, run A0.9insider officer-director20.470.54+10.8%0.06+2.3%
Unrestricted mutation, run A0.9insider officer-director30.500.28+4.9%0.34+5.0%
Unrestricted mutation, run A0.9insider officer-director40.270.50+7.0%0.27+4.7%
Unrestricted mutation, run A0.913F accumulation10.301.64+20.6%1.23+28.1%
Unrestricted mutation, run A0.913F accumulation20.290.32+6.8%0.03+1.4%
Unrestricted mutation, run A0.913F accumulation30.170.11+3.1%1.49+30.7%
Unrestricted mutation, run A0.913F accumulation40.411.42+23.2%-0.12-8.5%
Unrestricted mutation, run A0.9sentiment tech1-0.08-0.30-1.2%0.68+12.0%
Unrestricted mutation, run A0.9sentiment tech20.040.44+9.5%0.16+3.5%
Unrestricted mutation, run A0.9sentiment tech30.230.94+14.9%-0.02+0.4%
Unrestricted mutation, run A0.9sentiment tech40.26-0.28-7.9%-0.63-11.3%
Unrestricted mutation, run A0.9SP500 top-5010.330.80+11.5%1.13+13.3%
Unrestricted mutation, run A0.9SP500 top-5020.35-0.21-2.7%0.59+10.7%
Unrestricted mutation, run A0.9SP500 top-5030.460.34+5.0%0.70+8.1%
Unrestricted mutation, run A0.9SP500 top-5040.560.58+9.2%0.22+4.3%
Unrestricted mutation, run A0.9IWM put credit spread1-0.430.19+4.2%0.22+4.3%
Unrestricted mutation, run A0.9IWM put credit spread20.44-2.97-19.1%-1.42-6.3%
Unrestricted mutation, run A0.9IWM put credit spread30.48-0.91+1.9%1.11+6.4%
Unrestricted mutation, run A0.9IWM put credit spread40.16-0.80-6.8%-0.14+0.8%
Unrestricted mutation, run B0.9SPY iron condor10.53-1.01-68.0%-12.15-0.7%
Unrestricted mutation, run B0.9SPY iron condor21.751.62-42.0%-40.56-0.1%
Unrestricted mutation, run B0.9SPY iron condor31.210.39-4.6%-77.93+0.0%
Unrestricted mutation, run B0.9SPY iron condor40.760.55+12.0%-17.22-0.4%
Unrestricted mutation, run B0.9IWM RSI oversold1-4.13-1.69+2.0%-1.69+2.0%
Unrestricted mutation, run B0.9IWM RSI oversold2-0.46-1.63+0.1%-1.63+0.1%
Unrestricted mutation, run B0.9IWM RSI oversold3-1.20-1.51-34.8%-0.37+1.6%
Unrestricted mutation, run B0.9IWM RSI oversold4-0.880.85+9.0%0.85+9.0%
Unrestricted mutation, run B0.9congress 2-buyer10.621.14+17.2%0.74+10.9%
Unrestricted mutation, run B0.9congress 2-buyer20.540.08+2.1%0.02+1.1%
Unrestricted mutation, run B0.9congress 2-buyer30.59-0.38-2.1%-0.38-2.1%
Unrestricted mutation, run B0.9congress 2-buyer40.551.05+15.9%0.79+11.7%
Unrestricted mutation, run B0.9insider officer-director10.440.97+12.2%0.99+10.7%
Unrestricted mutation, run B0.9insider officer-director20.290.14+3.5%0.06+2.3%
Unrestricted mutation, run B0.9insider officer-director30.370.74+8.7%0.34+5.0%
Unrestricted mutation, run B0.9insider officer-director40.310.22+4.3%0.27+4.7%
Unrestricted mutation, run B0.913F accumulation10.251.41+18.9%1.23+28.1%
Unrestricted mutation, run B0.913F accumulation20.44-1.27-17.8%0.03+1.4%
Unrestricted mutation, run B0.913F accumulation3-0.090.69+13.2%1.49+30.7%
Unrestricted mutation, run B0.913F accumulation41.35-1.22-16.8%-0.12-8.5%
Unrestricted mutation, run B0.9sentiment tech1-0.03-0.46-3.7%0.68+12.0%
Unrestricted mutation, run B0.9sentiment tech20.060.39+8.1%0.16+3.5%
Unrestricted mutation, run B0.9sentiment tech3-0.090.00+0.8%-0.02+0.4%
Unrestricted mutation, run B0.9sentiment tech40.32-0.28-8.0%-0.63-11.3%
Unrestricted mutation, run B0.9SP500 top-5010.291.08+13.0%1.13+13.3%
Unrestricted mutation, run B0.9SP500 top-5020.310.51+8.4%0.59+10.7%
Unrestricted mutation, run B0.9SP500 top-5030.480.70+8.2%0.70+8.1%
Unrestricted mutation, run B0.9SP500 top-5040.580.56+8.0%0.22+4.3%
Unrestricted mutation, run B0.9IWM put credit spread10.200.49+5.7%0.22+4.3%
Unrestricted mutation, run B0.9IWM put credit spread2-0.19-1.42-6.3%-1.42-6.3%
Unrestricted mutation, run B0.9IWM put credit spread30.45-1.64+1.3%1.11+6.4%
Unrestricted mutation, run B0.9IWM put credit spread40.121.00+8.9%-0.14+0.8%
Structure locks0.9SPY iron condor1-9.87-8.84-0.6%-12.15-0.7%
Structure locks0.9SPY iron condor2-1.66-0.72-5.9%-40.56-0.1%
Structure locks0.9SPY iron condor3-0.64-0.19+1.6%-77.93+0.0%
Structure locks0.9SPY iron condor4-6.49-5.72-0.7%-17.22-0.4%
Structure locks0.9IWM RSI oversold1-25.25-3.51+1.4%-1.69+2.0%
Structure locks0.9IWM RSI oversold2-0.46-1.63+0.1%-1.63+0.1%
Structure locks0.9IWM RSI oversold3-0.36-0.37+1.6%-0.37+1.6%
Structure locks0.9IWM RSI oversold4-0.400.20+4.1%0.85+9.0%
Structure locks0.9congress 2-buyer10.490.93+11.6%0.74+10.9%
Structure locks0.9congress 2-buyer20.55-0.04-0.1%0.02+1.1%
Structure locks0.9congress 2-buyer30.59-0.38-2.1%-0.38-2.1%
Structure locks0.9congress 2-buyer40.731.30+17.6%0.79+11.7%
Structure locks0.9insider officer-director10.480.75+10.5%0.99+10.7%
Structure locks0.9insider officer-director20.51-0.12-1.1%0.06+2.3%
Structure locks0.9insider officer-director30.44-0.19+0.3%0.34+5.0%
Structure locks0.9insider officer-director40.591.29+15.5%0.27+4.7%
Structure locks0.913F accumulation10.60-0.13+0.7%1.23+28.1%
Structure locks0.913F accumulation20.780.79+17.1%0.03+1.4%
Structure locks0.913F accumulation30.890.50+8.4%1.49+30.7%
Structure locks0.913F accumulation40.93-0.96-14.6%-0.12-8.5%
Structure locks0.9sentiment tech10.061.10+21.0%0.68+12.0%
Structure locks0.9sentiment tech20.14-0.17-4.7%0.16+3.5%
Structure locks0.9sentiment tech30.070.85+15.8%-0.02+0.4%
Structure locks0.9sentiment tech40.38-0.42-10.8%-0.63-11.3%
Structure locks0.9SP500 top-5010.321.09+11.2%1.13+13.3%
Structure locks0.9SP500 top-5020.38-0.32-3.9%0.59+10.7%
Structure locks0.9SP500 top-5030.450.70+8.1%0.70+8.1%
Structure locks0.9SP500 top-5040.600.36+6.1%0.22+4.3%
Structure locks0.9IWM put credit spread10.441.18+8.6%0.22+4.3%
Structure locks0.9IWM put credit spread2-14.33-968.92+0.0%-1.42-6.3%
Structure locks0.9IWM put credit spread30.372.16+7.8%1.11+6.4%
Structure locks0.9IWM put credit spread40.33-0.74-4.4%-0.14+0.8%
Structure locks + worst-window fitness0.9SPY iron condor10.420.12+4.1%-12.15-0.7%
Structure locks + worst-window fitness0.9SPY iron condor2-0.60-0.85-13.0%-40.56-0.1%
Structure locks + worst-window fitness0.9SPY iron condor30.121.37+14.3%-77.93+0.0%
Structure locks + worst-window fitness0.9SPY iron condor4-0.43-0.14+0.8%-17.22-0.4%
Structure locks + worst-window fitness0.9IWM RSI oversold1-3.65-1.15+2.0%-1.69+2.0%
Structure locks + worst-window fitness0.9IWM RSI oversold2-0.46-1.63+0.1%-1.63+0.1%
Structure locks + worst-window fitness0.9IWM RSI oversold3-0.36-0.37+1.6%-0.37+1.6%
Structure locks + worst-window fitness0.9IWM RSI oversold4-0.670.22+4.0%0.85+9.0%
Structure locks + worst-window fitness0.9congress 2-buyer10.420.30+6.4%0.74+10.9%
Structure locks + worst-window fitness0.9congress 2-buyer20.500.02+1.1%0.02+1.1%
Structure locks + worst-window fitness0.9congress 2-buyer30.590.43+6.8%-0.38-2.1%
Structure locks + worst-window fitness0.9congress 2-buyer40.602.09+28.8%0.79+11.7%
Structure locks + worst-window fitness0.9insider officer-director10.600.97+12.5%0.99+10.7%
Structure locks + worst-window fitness0.9insider officer-director20.520.52+9.5%0.06+2.3%
Structure locks + worst-window fitness0.9insider officer-director30.370.77+9.7%0.34+5.0%
Structure locks + worst-window fitness0.9insider officer-director40.470.95+12.1%0.27+4.7%
Structure locks + worst-window fitness0.913F accumulation10.210.04+2.0%1.23+28.1%
Structure locks + worst-window fitness0.913F accumulation20.220.75+17.6%0.03+1.4%
Structure locks + worst-window fitness0.913F accumulation30.880.50+8.0%1.49+30.7%
Structure locks + worst-window fitness0.913F accumulation41.25-0.88-13.4%-0.12-8.5%
Structure locks + worst-window fitness0.9sentiment tech1-0.011.22+19.3%0.68+12.0%
Structure locks + worst-window fitness0.9sentiment tech20.040.16+3.5%0.16+3.5%
Structure locks + worst-window fitness0.9sentiment tech30.08-0.55-7.8%-0.02+0.4%
Structure locks + worst-window fitness0.9sentiment tech40.25-0.28-5.0%-0.63-11.3%
Structure locks + worst-window fitness0.9SP500 top-5010.250.82+9.2%1.13+13.3%
Structure locks + worst-window fitness0.9SP500 top-5020.280.48+7.8%0.59+10.7%
Structure locks + worst-window fitness0.9SP500 top-5030.470.00+2.6%0.70+8.1%
Structure locks + worst-window fitness0.9SP500 top-5040.600.27+4.8%0.22+4.3%
Structure locks + worst-window fitness0.9IWM put credit spread1-53.460.22+4.3%
Structure locks + worst-window fitness0.9IWM put credit spread2-0.24-2.88-16.0%-1.42-6.3%
Structure locks + worst-window fitness0.9IWM put credit spread30.35-0.91+1.9%1.11+6.4%
Structure locks + worst-window fitness0.9IWM put credit spread40.050.31+4.8%-0.14+0.8%

Every fold from the main test. One fold of the worst-window variant at intensity 0.9 has no Sharpe.

All 12 of those losses came from two options strategies: a SPY iron condor and an IWM put spread that opens when RSI is oversold. Left unchanged, both were roughly flat in the same windows. In this test the locked variants also kept each comparison pointing the same way, so the follow-up test let comparisons flip again with the locks still on. Its worst fold was -47.9%, against -100% without locks. Scoring each candidate by its worst training window instead of its average did not change the worst folds.

The candidate that turned $500,000 into $4.23 million

Stored rules, copied from both portfolios
STRATEGY I WROTE
  Legs        short put delta 0.15, 21-45 DTE
              long put $5 OTM, 21-45 DTE
  Size        50% of buying power
  Enter when  Open option spread count (IWM short put vertical) = 0
          and 14 Day IWM RSI < 35
          and Days Since Strategy Fired >= 5
  Exit check  Constant 1 > Constant 0

CANDIDATE THE GA PICKED
  Legs        long call 8.473369% OTM, 34-331 DTE
              short call $21.719483 OTM, 13-321 DTE
  Size        2,199 contracts
  Enter when  Open option spread count (IWM short put vertical) < 300918.98146937194
          and 806 Day IWM RSI != 46.787602928829
          and Days Since Strategy Fired != 0
  Exit check  Constant 480.9412735783046 = Constant 80.18862589494859
Out-of-sample return
+745.6%fold 4, 2026-03-17 to 2026-11-23
Win rate
99.7%226 settled trades

The candidate on the right enters almost every day and never exits. Its entry only needs the 806-day RSI to differ from 46.79, and its exit runs only when 480.94 equals 80.19. Mutation also swapped the puts for calls, gave each leg a different expiration and set the size to 2,199 contracts. Validation picked it because a large call position that is never closed made money in a rally.

The backtest handled it correctly: fills used real quotes and buying power capped every order. The GA found a broken strategy that happened to win. This came from my first run, the production GA at intensity 0.1.

One generation, as the optimizer runs it

app/src/model/optimizer/ga_iteration.rs (condensed)
// 1. Pick parents: binary tournament on Pareto rank, then crowding distance
let parent1 = self.select_parent_tournament(population)?;
let parent2 = self.select_parent_tournament(population)?;

// 2. Breed: crossover swaps genes between parents, then each child mutates
let (mut child1, mut child2) = self.optimization_type.crossover_pair(parent1, parent2)?;
self.optimization_type.mutate(&mut child1, self.mutation_rate, self.mutation_intensity, ..)?;

// 3. Score parents + children on every training window, for every objective
combined_population.calculate_fitness(.., &self.fitness_functions, .., self.num_windows, ..)

// 4. Keep the best: NSGA-II non-dominated sort, then truncate
sorted_population.apply_nsga_ii(&self.fitness_functions, ..);
sorted_population.truncate(self.population_size);

The GA starts from the strategy you wrote. Mutation intensity sets how far each gene can move. I tested the two values NexusTrade uses: 0.1 inside walk-forward and 0.9 in the standalone optimizer. The 0.9 runs also added 20% random new candidates each generation.

Population
6walk-forward default
Generations
6per fold
Training windows
3overlapping
Mutation intensity
0.1 / 0.9walk-forward / standalone optimizer

What a mutation may change, before and after this study

Under the old rules, a spread count that started at 0 could reach 300,918 in a few generations, because every step scaled with max(|value|, 100). Mutation intensity limited the size of numeric steps and nothing else, so option type, direction and order units could change at any intensity.

Show the table · 7 rows, 3 columns

Scroll sideways to compare all columns. Select a heading to sort.

Comparison operatorRedrawn from all six (<, <=, >, >=, =, !=)Redrawn from all six
Constant vs constant conditionBoth constants mutateBoth constants mutate
Option type and directionCould flip per leg (put to call, short to long)Fixed
Expiration windowEach leg independentlyLegs that share a window keep sharing it
Strike distanceFresh draw from 0 to 30 in any unitAll strikes in a spread move by one relative factor; delta stays 0.01 to 0.99
Order sizeRedrawn up to the whole accountMoves relative to its value; unit (contracts, % of cash) fixed
Open-ended thresholdsSteps of up to 0.5 x intensity x 10 x max(|value|, 100)Steps relative to the value

Code paths in app/src/model/optimizer/optimization_type/parameter.rs and indicators/value.rs. Changes shipped in PRs #1608 and #1615.

How each winner was scored on dates it never saw

Follow the dates in order

Fold 1 of 4, IWM RSI oversold

  1. Training

    Mar 7, 2022 – Sep 15, 2023

    The GA breeds and scores candidates on 3 overlapping windows of this period.

  2. Embargo

    Sep 16, 2023 – Sep 29, 2023

    Nothing trades or scores for 14 days, so a trade open at the end of training cannot leak into validation.

  3. Validation

    Sep 30, 2023 – Feb 19, 2024

    The final population is ranked on these dates and one winner is picked.

  4. Out of sample

    Feb 20, 2024 – Oct 28, 2024

    The winner runs once on dates it has never seen. This is the reported score.

Dates shown in New York time.

From the stored study. Fold 1 is the -99.9% fold in the first chart (unrestricted mutation, run A, intensity 0.1).

See exact times and technical names

The date ranges above use New York time. These original UTC timestamps preserve the exact boundaries.

anchored: always starts 2022-03-07
through
gap
through
last 20% of the development window
through
reported result
through
Step 1 of 4

Fold 1: tested 2024-02-20 to 2024-10-28

Each fold trains, waits out a 14-day embargo, picks a winner on validation, then scores that winner once out of sample.

What you should see

The training window grows with each fold, and the out-of-sample windows never overlap.

Follow the dates in order

Fold 2 of 4, IWM RSI oversold

  1. Training

    Mar 7, 2022 – Apr 4, 2024

    The GA breeds and scores candidates on 3 overlapping windows of this period.

  2. Embargo

    Apr 5, 2024 – Apr 18, 2024

    Nothing trades or scores for 14 days, so a trade open at the end of training cannot leak into validation.

  3. Validation

    Apr 19, 2024 – Oct 28, 2024

    The final population is ranked on these dates and one winner is picked.

  4. Out of sample

    Oct 29, 2024 – Jul 7, 2025

    The winner runs once on dates it has never seen. This is the reported score.

Dates shown in New York time.

From the stored study. Fold 1 is the -99.9% fold in the first chart (unrestricted mutation, run A, intensity 0.1).

See exact times and technical names

The date ranges above use New York time. These original UTC timestamps preserve the exact boundaries.

anchored: always starts 2022-03-07
through
gap
through
last 20% of the development window
through
reported result
through
Step 2 of 4

Fold 2: tested 2024-10-29 to 2025-07-07

Each fold trains, waits out a 14-day embargo, picks a winner on validation, then scores that winner once out of sample.

What you should see

The training window grows with each fold, and the out-of-sample windows never overlap.

Follow the dates in order

Fold 3 of 4, IWM RSI oversold

  1. Training

    Mar 7, 2022 – Oct 23, 2024

    The GA breeds and scores candidates on 3 overlapping windows of this period.

  2. Embargo

    Oct 24, 2024 – Nov 6, 2024

    Nothing trades or scores for 14 days, so a trade open at the end of training cannot leak into validation.

  3. Validation

    Nov 7, 2024 – Jul 7, 2025

    The final population is ranked on these dates and one winner is picked.

  4. Out of sample

    Jul 8, 2025 – Mar 16, 2026

    The winner runs once on dates it has never seen. This is the reported score.

Dates shown in New York time.

From the stored study. Fold 1 is the -99.9% fold in the first chart (unrestricted mutation, run A, intensity 0.1).

See exact times and technical names

The date ranges above use New York time. These original UTC timestamps preserve the exact boundaries.

anchored: always starts 2022-03-07
through
gap
through
last 20% of the development window
through
reported result
through
Step 3 of 4

Fold 3: tested 2025-07-08 to 2026-03-16

Each fold trains, waits out a 14-day embargo, picks a winner on validation, then scores that winner once out of sample.

What you should see

The training window grows with each fold, and the out-of-sample windows never overlap.

Follow the dates in order

Fold 4 of 4, IWM RSI oversold

  1. Training

    Mar 7, 2022 – May 12, 2025

    The GA breeds and scores candidates on 3 overlapping windows of this period.

  2. Embargo

    May 13, 2025 – May 26, 2025

    Nothing trades or scores for 14 days, so a trade open at the end of training cannot leak into validation.

  3. Validation

    May 27, 2025 – Mar 16, 2026

    The final population is ranked on these dates and one winner is picked.

  4. Out of sample

    Mar 17, 2026 – Nov 23, 2026

    The winner runs once on dates it has never seen. This is the reported score.

Dates shown in New York time.

From the stored study. Fold 1 is the -99.9% fold in the first chart (unrestricted mutation, run A, intensity 0.1).

See exact times and technical names

The date ranges above use New York time. These original UTC timestamps preserve the exact boundaries.

anchored: always starts 2022-03-07
through
gap
through
last 20% of the development window
through
reported result
through
Step 4 of 4

Fold 4: tested 2026-03-17 to 2026-11-23

Each fold trains, waits out a 14-day embargo, picks a winner on validation, then scores that winner once out of sample.

What you should see

The training window grows with each fold, and the out-of-sample windows never overlap.

Every result on this page is a fold's out-of-sample score, compared with the unchanged strategy on the same dates. The 8 strategies were a SPY iron condor, an IWM put spread on oversold RSI, an IWM put credit spread, an S&P 500 top-50 book, and books that follow congressional buyers, insider purchases, 13F accumulation and tech sentiment.

Does walk-forward testing stop the GA from overfitting?

Median Sharpe per variant, 8 strategies x 4 folds
TrainOOSGap
Unrestricted mutation, run A (intensity 0.1)+0.29+0.27+0.02
Unrestricted mutation, run B (intensity 0.1)+0.37+0.23+0.23
Structure locks (intensity 0.1)+0.28+0.34+0.01
Structure locks + worst-window fitness (intensity 0.1)+0.28+0.03+0.05
Unrestricted mutation, run A (intensity 0.9)+0.34+0.29+0.12
Unrestricted mutation, run B (intensity 0.9)+0.32+0.39+0.05
Structure locks (intensity 0.9)+0.38-0.12-0.13
Structure locks + worst-window fitness (intensity 0.9)+0.25+0.22+0.01

Gap = training Sharpe minus out-of-sample Sharpe of the chosen candidate, median over folds.

For every variant, the median drop from training Sharpe to out-of-sample Sharpe was between -0.13 and 0.23. Runs A and B use identical settings with different random draws. At intensity 0.1 their gaps were 0.02 and 0.23, a bigger difference than most variants show against each other. Comparing two GA settings on one run each would mostly measure that randomness.

What happens when the GA can flip > to <

Out-of-sample return per fold, 3 strategies x 4 folds, each variant run twice
WorstMeanMedian
Unrestricted mutation, intensity 0.1, run A-99.9%-6.2%+3%
Unrestricted mutation, intensity 0.1, run B-100%-7.6%+1.3%
Locks, operators keep their direction, intensity 0.1, run A-6.2%+4.5%+5%
Locks, operators keep their direction, intensity 0.1, run B-13.1%+2.2%+2.4%
Locks, all six operators (current GA), intensity 0.1, run A-19.1%+3%+3.6%
Locks, all six operators (current GA), intensity 0.1, run B-47.9%-2.1%+1.6%
Unrestricted mutation, intensity 0.9, run A-49%-5.6%-0.4%
Unrestricted mutation, intensity 0.9, run B-34.8%+2%+6.8%
Locks, operators keep their direction, intensity 0.9, run A-27%+0.5%+3.1%
Locks, operators keep their direction, intensity 0.9, run B-24.1%+0.9%0%
Locks, all six operators (current GA), intensity 0.9, run A-27.7%+9.2%+7.1%
Locks, all six operators (current GA), intensity 0.9, run B-5.1%+7%+7.3%
Unchanged strategy-6.3%+4.5%+4.3%

Follow-up test: IWM RSI oversold, S&P 500 top-50 and IWM put credit spread, 4 folds each. The unrestricted rows are the main test's runs on these 3 strategies.

Show the table · 13 rows, 7 columns

Scroll sideways to compare all columns. Select a heading to sort.

Unrestricted mutation0.1A0.15-6.2%-99.9%5 of 12
Unrestricted mutation0.1B0.09-7.6%-100.0%4 of 12
Locks, operators keep their direction0.1A0.47+4.5%-6.2%5 of 12
Locks, operators keep their direction0.1B-0.02+2.2%-13.1%4 of 12
Locks, all six operators (current GA)0.1A0.17+3.0%-19.1%4 of 12
Locks, all six operators (current GA)0.1B-0.13-2.1%-47.9%4 of 12
Unrestricted mutation0.9A-0.30-5.6%-49.0%3 of 12
Unrestricted mutation0.9B0.50+2.0%-34.8%3 of 12
Locks, operators keep their direction0.9A0.03+0.5%-27.0%3 of 12
Locks, operators keep their direction0.9B-0.36+0.9%-24.1%4 of 12
Locks, all six operators (current GA)0.9A0.56+9.2%-27.7%7 of 12
Locks, all six operators (current GA)0.9B0.61+7.0%-5.1%6 of 12
Unchanged strategy0.22+4.5%

At intensity 0.9, letting the GA pick any of the six comparisons (<, <=, >, >=, =, !=) beat allowing only a switch between < and <= (or > and >=), in both runs. Median out-of-sample Sharpe was 0.56 and 0.61 against 0.03 and -0.36. Mean return was +9.2% and +7.0% against +0.5% and +0.9%, and 7 and 6 of 12 folds beat the unchanged strategy against 3 and 4.

A flipped comparison lets the GA trade the opposite signal. The same freedom produces rules like the always-true "RSI != 46.79" above, and at intensity 0.1 one run with flips lost 47.9% in a fold. NexusTrade's GA now allows flips and keeps the locks.

How to avoid overfitting when you optimize a trading strategy

These four checks do not depend on NexusTrade. They apply to any genetic optimizer, including the one built into MetaTrader 5's strategy tester: hold out a forward period, and compare the optimized inputs with the originals on that period.

  1. Score the unchanged strategy on the same folds

    At intensity 0.1, no GA variant clearly beat the strategy as I wrote it (median out-of-sample Sharpe 0.22). A GA result means little until you compare it with that baseline.

  2. Lock what defines the trade

    Option type, direction, expirations and order units decide what the strategy is. In the main test, every fold below -30% came from mutations that changed them.

  3. Run the same search twice

    Identical settings moved median out-of-sample Sharpe by up to 0.8 in this study. Treat a smaller difference between two settings as noise.

  4. Read the winning rule before you trust its score

    A rule that always enters or never exits can win a fold. The +745.6% candidate above did both.

Limits: one default objective, a small search, 8 strategies

server/src/models/walkForward/launchWalkForwardStudy.ts
const parseFitnessFunctions = (raw: unknown): FitnessFunction[] => {
  if (!Array.isArray(raw) || raw.length === 0) {
    return [FitnessFunction.SharpeRatio];
  }
  ...

  1. Sharpe only, by default

    A walk-forward study with no objectives set optimizes Sharpe alone, so NSGA-II runs with a single objective. My main and follow-up tests used Sharpe and return.

  2. A small search

    Each GA ran a population of 6 for 6 generations. I did not test larger searches.

  3. 8 strategies and one market history

    Stock strategies used 4 anchored folds from 2020 to 2026, and options strategies started in 2022. The follow-up test covers 3 strategies.

  4. Two runs per variant at most

    I have not yet run a probability-of-backtest-overfitting test, a deflated Sharpe ratio or an untouched final holdout.

Run the same test on your strategy

Aurora can run a walk-forward study on any of your portfolios and score the unchanged version on the same folds.

Discussion

Sign in or create a free account to join the discussion.

No comments yet.

Aurora · AI research assistant

Try this in Aurora

Edit the request, then open it in Aurora. You choose when to send it.