Data Snooping
- Category
- Algorithmic Trading
- Level
- Expert
Simple definition
Testing many rules on the same data and reporting the one that worked. With enough attempts something always works, even when nothing has any real edge.
Professional definition
The bias introduced when a reported result was selected from many unreported tests on the same data. The significance level of a single test does not apply to the best of N tests: the chance that at least one of N independent tests passes at the 5 percent level is one minus 0.95 raised to the power N.
Technical definition
Multiple testing is the whole problem. If N independent rules are each tested at level alpha and none has any edge, the probability that at least one is significant is 1 − (1−alpha)^N: at alpha = 0.05 that is about 64 percent for N = 20 and about 99.4 percent for N = 100. The winner's reported p-value is therefore not its p-value. Corrections exist — a Bonferroni threshold of alpha/N, or false-discovery control — but all require knowing N, which an undocumented search never records.
Academic definition
The upward bias in reported significance arising when a hypothesis is selected from a large set evaluated on the same data, which invalidates single-test inference unless the size of the search is accounted for.
Mechanism
Significance testing controls the error rate of one pre-specified test. Searching turns the procedure into a maximum over many tests, and the distribution of a maximum has a much fatter right tail than any single draw. Nothing in the data changes; what changes is that the reported statistic is now an extreme order statistic, and comparing it with a single-test critical value is a category error.
In practice
- Who uses it
- Quantitative researchers, anyone screening indicators or parameter grids, and readers of any published strategy result.
- Why it matters
- It explains why so many documented edges disappear on new data without anyone having been dishonest at any step.
- Limitations
- Corrections need the number of tests, which is rarely recorded, and tested rules are usually correlated, so a Bonferroni bound is conservative.
Common mistakes
- Screening hundreds of rules and reporting the winner's single-test p-value.
- Counting only the variants that were kept.
- Treating heavily correlated tests as independent.
Examples
Twenty independent rules with no edge, each tested at the 5 percent level: the chance that at least one looks significant is about 64 percent. With a hundred rules it is about 99.4 percent — a discovery is then guaranteed, and worthless.
- alpha = 0.05 per test
- all null hypotheses true: no rule has any edge
- tests assumed independent
- N = 20: 0.95^20 = 0.3585, so 1 - 0.3585 = 0.6415
- N = 100: 0.95^100 = 0.0059, so 1 - 0.0059 = 0.9941
- Bonferroni threshold for N = 100: 0.05 / 100 = 0.0005
Independence is the worst case for the bound's size and is unrealistic: correlated rules give a lower probability than this, but the direction of the problem is unchanged.
A screen ranks two hundred indicator-and-threshold combinations and the top one is written up with a p-value of 0.01. That number would have been meaningful had the rule been specified first; chosen as the best of two hundred, it is not evidence.
Mathematical foundation
Variables
| \alpha | Significance level applied to each individual test | probability |
| N | Number of tests actually performed, including the unreported ones | count |
| \alpha_{adj} | Bonferroni-adjusted threshold controlling the family-wise error rate | probability |
Procedure
Count every test performed, including abandoned variants, parameter grid points and rules discarded after a glance. Compute the probability that at least one would have passed by chance at the per-test level. If that probability is large, the single-test p-value of the winner carries no information; either lower the threshold to alpha divided by N, or validate the selected rule on data that played no part in the search.
Worked example
- alpha = 0.05
- N = 20, then N = 100
- independent tests, all nulls true
- 1 - 0.95^20 = 1 - 0.3585 = 0.6415
- 1 - 0.95^100 = 1 - 0.0059 = 0.9941
- alpha_adj for N = 100 is 0.0005
Interpretation
The output is the family-wise probability of at least one false discovery. It is a statement about the search, not about any particular rule: a high value means the winning result would be expected even if the market were entirely unpredictable.
Assumptions
- Tests are assumed independent. Rules sharing data, signals or parameters are correlated, which lowers the probability below this figure without removing the problem; the independent case is the clean upper reference.
- All null hypotheses are assumed true, so the figure is the probability of a purely spurious discovery, not an estimate of how many real edges exist.
- N must count every test performed, including unrecorded ones. In practice N is unknown, which is why the correction is often impossible to apply after the fact.
- Bonferroni controls the family-wise error rate and is conservative when tests are correlated; false-discovery-rate methods trade some of that strictness for power.
- The formula bounds the chance of a false positive. It says nothing about the out-of-sample performance of the rule that was selected.
Related terminology
- related
- p-value Hypothesis Testing Overfitting Curve Fitting In-Sample versus Out-of-Sample Parameter Optimisation Walk-Forward Testing Backtesting Survivorship Bias Confidence Interval Sample versus Population Strategy Decay
Overfitting
Overfitting is a property of the fitted rule: it has absorbed sample noise. Data snooping is a property of the search that selected it. A single rule with no parameters at all can be data-snooped, if it was the best of two hundred such rules.
Sources
CMT Association · chapters on testing methodology and the evidence base for rule-based methods
https://cmtassociation.org/wp-content/uploads/2019/01/Technical-Analysis-Modern-Perspectives-CMT-Association.pdf URL verified
CFA Institute · cautions on inference from selected historical performance
https://www.cfainstitute.org/insights/professional-learning/refresher-readings/2026/portfolio-performance-evaluation URL verified
Editorial status
Flagged by the editor as uncertain on a linguistic, mathematical or regulatory point.
