Multiple testing and data snooping: why the best backtest is probably luckier than it looks
If you test enough ideas on the same data, some will look good purely by chance. This is the multiple-testing problem, and data snooping is how it happens in practice: reusing the same history to design, select and judge a strategy. Understanding it explains why the best backtest in a long search usually disappoints out of sample.
The basic problem
Suppose a test has a one-in-twenty chance of looking significant by luck. Run twenty tests on random data and you should expect about one apparent success. A search over hundreds of parameter combinations or rule variations will almost certainly find something that looks excellent, even if nothing real is there.
How data snooping creeps in
- Trying many indicators, time frames or parameters and keeping the best.
- Adjusting the rules after seeing how they performed on the test data.
- Using out-of-sample data repeatedly until it stops being out of sample.
- Choosing which instrument or period to show after seeing results.
- Learning from published results that were themselves selected from many attempts.
Why the best result is biased
Selecting the maximum of many noisy results systematically picks results that were helped by luck. The more trials you run, the larger the part of the winner's performance that is noise, and the more its apparent edge shrinks on new data.
Practical defences
- Count and record every variation you tried, including the ones you abandoned.
- Prefer a small number of ideas with a reason behind them over broad searches with no economic logic.
- Keep a final hold-out block untouched until one strategy has been chosen, and use it once.
- Demand stronger evidence when you searched widely: more trades, more instruments and consistent behaviour across periods.
- Use statistical adjustments that account for the number of trials, such as stricter significance thresholds or deflated performance measures.
- Confirm the idea with forward testing, including on a practice account.
A useful attitude
Treat an impressive backtest from a large search as a hypothesis that has earned a proper test, not as evidence that the strategy works. If it survives out-of-sample and forward testing with realistic costs, confidence is more justified.
Where TradeCC fits
When you describe to CC how you arrived at a strategy, it can question how many variations you tried, whether the selection used the same data as the evaluation, and whether the evidence is strong enough for the size of the search. Each change you make with CC becomes a new version that records its parent, the parameters that changed and its own backtests, so the number of variations you tried stays on record. It is a research aid and not investment advice.
Frequently asked questions
How many trials is too many?
There is no fixed number; the point is to keep count and adjust expectations. The more variations you tried relative to the amount of data, the less weight the best result deserves.
Does out-of-sample testing solve this?
It helps a lot, but only if the out-of-sample data was not used for choosing between strategies. Repeatedly peeking turns it into part of the search.
Is this only a problem for automated strategies?
No. A discretionary trader who searches charts for patterns that worked and then reports the best ones faces the same selection bias.