Your best optimization pass is probably curve-fitted: 5 checks before you trust it

28 November 2026, 20:22
Felicien Badou Diouf
0
16

You run the genetic optimizer, sort by profit and pick the top pass. Then it loses in the first weeks on demo.

That is not bad luck. Four inputs (two EMA periods, stop and target) already give about 4 million combinations. Search that many and some will fit past noise almost perfectly. So the top pass is the one most likely to be curve-fitted.

FIVE CHECKS BEFORE YOU TRUST A PASS

1. Out-of-sample. Optimize on the first 70% of history only. Test once on the last 30%, which the optimizer never saw.

2. Plateau, not peak. Move each input one step up and down. If profit collapses, you found a spike. Most neighbours should keep at least half the result.

3. Monte Carlo. Skip about 10% of trades at random and reshuffle the order, 300 times. Read the worst 5% of returns and the 95th-percentile drawdown, not the single backtest drawdown.

4. Walk-forward. Re-optimize on a growing window and trade the next window blind. Repeat 3–4 times. Count how many windows made money.

5. Drawdown versus your limit. Compare that 95th-percentile drawdown with your account or prop firm max loss. If it does not fit, cut risk per trade.

HOW TO READ THE RESULT

- Robust: profitable out-of-sample, stable neighbours, worst case inside your limit.
- Fragile: profitable out-of-sample but fails one check. Demo only while you investigate.
- Overfit: lost money on unseen data. Discard it. Do not re-optimize until it looks good again.

The built-in forward option in the Strategy Tester is a good start, but it is one split. In genetic mode it only forward-tests part of the passes. A walk-forward repeats the test so that one lucky window cannot carry the result.

I put the full method, with worked explanations of each check, here: How to test an Expert Advisor for overfitting. The page also links a free browser optimizer that runs all five checks on your own candle data and exports an MT5 .set file for real-tick confirmation in the Strategy Tester.

Historical tests do not predict future results. Always confirm on real ticks and on a demo account first.