Understand it
Overfitting means fitting rules to noise in the data you tested on. It happens through obvious routes, such as optimising many parameters, and quiet ones: adding a filter that removes a few bad trades, choosing the test period, or reading other people's best backtests.
Researchers call the general problem data snooping or multiple testing. The best result from many trials is biased upward, so it needs a higher bar or fresh data. Simple rules, few parameters, stability across nearby parameter values and markets, and genuine out-of-sample results are the practical defences.
Each line is a variant of a strategy whose every trade is a fair coin flip for +1R or −1R. By construction none has an edge, yet 28 of the 50 finished positive and the best finished at +18R after 100 trades.
If you had tested these 50 parameter sets and kept the best, you would have kept a +18R backtest with an expected future of zero. That gap is selection bias.
The defence is to count how many variants you tried, hold back data you never touch during development, and prefer rules that work across a broad range of nearby parameters rather than at one sharp peak.
Watch for this misconception
Thinking a backtest is reliable because it is long. A long backtest can still be the luckiest of hundreds of variants.
For any strategy you are testing, write down how many variants you have tried so far. Re-test your favourite with each parameter moved 20% in both directions.
Expectancy calculator ↗Which practice best reduces overfitting?
Go deeper
- Bailey, Borwein, López de Prado & Zhu (2014): Pseudo-Mathematics and Financial Charlatanism, Notices of the AMS ↗
- White (2000): A Reality Check for Data Snooping, Econometrica ↗
- Harvey, Liu & Zhu (2016): …and the Cross-Section of Expected Returns, Review of Financial Studies ↗
Hypothetical educational examples on synthetic numbers. Verify current product specifications and rules before making decisions.