STRATEGY LIBRARY · RESEARCH METHODS · 5 OF 6

Overfitting and data snooping

The more variants you try, the more the best result is luck. Count your trials and keep untouched data.

RESEARCH METHOD~12–18 MINUTES

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.

WORKED EXAMPLE
Fifty zero-edge variantsFifty simulated equity curves of 100 coin-flip trades each, with the best one highlighted. None has an edge.−23R−14R−5R+4R+14R+23R49 other variantsBest variantSYNTHETIC DATA · ILLUSTRATION ONLY
Fifty strategy variants with no edge at all: each trade is a fair coin flip for ±1R. Simulated with a fixed seed.

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.

PRACTICE EXERCISE

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 ↗
KNOWLEDGE CHECK

Which practice best reduces overfitting?

Select the best answer

Go deeper

Hypothetical educational examples on synthetic numbers. Verify current product specifications and rules before making decisions.