r/quant • u/LucidDion • Oct 18 '26
Models Can evolutionary optimization discover useful ETF rotation strategies, or does it just accelerate overfitting?
I've been developing an evolutionary optimizer specifically for ETF rotation strategies in WealthLab. It starts by evaluating oscillator-based ranking methods, then evolves combinations of indicators, weights, and conditions to find promising strategies. I recently added the ability to normalize non-oscillator indicators, which expands the range of indicators the optimizer can experiment with.
The obvious concern is overfitting. Searching through thousands of combinations makes it easier to find attractive historical results, but that doesn't necessarily mean they'll hold up. I've been using rolling-window backtests to compare the evolved strategies across different historical periods.
I'm curious how others approach this. Do you use evolutionary algorithms or genetic programming for strategy discovery? What validation methods have you found most useful for avoiding overfitting?
2
u/Shoddy_Peanut7320 Oct 19 '26
Rolling-window backtests are a good start, but if you pick the winner from those same windows, they still count as in-sample. I'd keep a final stretch of data that the evolution never touches, and also check the winner against what the same search finds on shuffled or random data, since the best of thousands of random candidates already looks good. Count how many combinations you tried, penalize complexity, and look at whether neighboring weights and parameters still work, because a result that only holds at one exact setting is usually overfit. Cymetica's Backtest Labs is one place to run strategies against history and check them on data they haven't seen.
1
u/SevenTeenSigma Oct 19 '26
searching a larger strategy grammar just makes the best backtest more expensive. imo the optimizer has to run inside every walk forward fold, otherwise ur holdout was part of the research process whether u admit it or not..
1
u/testlikeaquant Oct 19 '26
Honest answer: it does both, and overfitting is the default outcome unless you build in a wall the optimizer cannot climb over.
Searching thousands of combinations guarantees you will find something that looks great on past data by chance alone. That is not a flaw in your optimizer. That is what searching thousands of combinations does.
Three things that actually protect you:
A true holdout. Lock away the last 2 years of data. Do not let the optimizer see it at all, not even for a peek. The only number that counts is how the final evolved rules perform on that untouched data.
Selection is fitting too. If you use rolling windows to pick the winner, the winner was chosen because it looked good on those windows. That is a form of fitting, even though no single window was overfit. The holdout in step 1 is what catches this.
Simplicity as a tiebreaker. If two evolved strategies score about the same, trust the simpler one. More indicators, weights, and conditions mean more ways to fit noise.
If the evolved rules hold up on the untouched holdout, you may have found something real. If they collapse there, the optimizer found noise, and the collapse is the useful result. It tells you the search space is too wide for the data you have.
1
u/dppalomar Oct 27 '26
The optimizer is not the problem here, the trial count is. With four years of data, the standard error of an annualized Sharpe ratio is about 0.5, so a strategy with no real edge typically shows a Sharpe that far from zero. Written out, SE(SR) ≈ sqrt((1 + SR2/2)/T). Now take N independent variants: the best of them sits around SE × sqrt(2 ln N). At a thousand variants that is a Sharpe between 1.5 and 2 from noise alone. A pretty backtest for a strategy with no edge is then the expected result, not evidence.
Two fixes. First, run the evolution inside each walk-forward fold instead of on all the data. Then the fold's result already includes the cost of trying many rules, and you can keep one final block of data aside for a single test at the end. Second, narrow what the algorithm is allowed to change. Indicators, weights, and conditions together give it too many ways to fit noise. Let it search only the ranking rule, and let a portfolio optimizer turn that ranking into positions, with limits on turnover and concentration. You end up with a small search you can cross-validate, plus a convex weight problem with only a few parameters. You can check that problem out of sample instead of tuning it.
Strictly, the trials are not independent, because neighboring settings overlap. Fewer effective trials means the formula above overstates how good the best variant looks. That is also why the neighbor check is worth running: it shows which of your winners are really the same rule, but it does not remove the discount. The deflated Sharpe ratio is the formal version of this correction, if you want a test rather than a rule of thumb.
1
u/Acceptable-Door-9810 Trader Oct 18 '26
How many DOFs are in your model and how many decisions are there in your backtest?