Research question
If 60 trading rules have no true predictive power, what is the probability that at least one looks "significant" at the 5% level? What threshold does a Bonferroni correction imply? In one simulated dataset of 240 months, how many rules are misclassified? The data are generated with seed 20261037 and are a teaching simulation, not real strategies.
Data
| Item | Value |
|---|---|
| Candidate rules | 60 |
| Sample | 240 months |
| Frequency and unit | monthly returns; p-values are probabilities |
| True predictive power | none (simulated null) |
| Single-test level | 5% |
| Expected false positives | 3 |
| Probability of at least one false positive | 95.4% (under independence) |
| Rules with p<0.05 in the simulation | 4 |
| Smallest p-value | 0.001185 |
| Bonferroni threshold | 0.000833 |
| Rules significant after correction | Bonferroni 0, Holm 0 |
| Benjamini–Hochberg discoveries at q=5% | 2 |
| Reproduction script | scripts/simulate-multiple-testing.mjs |
| License | simulated data, no external license |
Method and assumptions
Each rule gets a one-sample test of the mean on 240 monthly returns, with the null hypothesis that mean return is zero. A p-value is the probability of a result at least as extreme when the null is true; its definition and common misreadings are covered in the main article Hypothesis Testing and Practical Significance (RES-012). Alpha is the probability of rejecting the null when the null is true, that is, the probability of a Type I error (OpenStax, 9.2); this article uses α = 0.05 as the rejection threshold for every rule. With m independent tests, the probability of at least one false rejection is 1-(1-α)^m, which is the family-wise error rate (FWER, written as fwer in the reproduction block below). The Bonferroni inequality says that building each of g comparisons at a 1-α/g confidence level keeps the overall confidence coefficient at 1-α or higher (NIST/SEMATECH, 7.4.6.3); applied to hypothesis tests, the same inequality means setting each test's threshold to α/m so that the overall Type I error rate does not exceed α. Data snooping means trying many rules and reporting only the best result while hiding the number of attempts. How it differs from look-ahead bias and overfitting is set out in the main articles Backtesting and Look-Ahead Bias (RES-020) and Out-of-Sample Testing and Overfitting (RES-022). Sullivan, Timmermann and White (1999) apply White's Reality Check bootstrap to 26 technical trading rules over 100 years of daily Dow Jones data and quantify data-snooping bias across the full rule universe[2]. Every simulated figure in this article comes from scripts/simulate-multiple-testing.mjs: mulberry32 seeded random numbers, Box–Muller normal returns, a one-sample two-sided t-test of each rule's 240 monthly returns (df = 239, p-value from the incomplete beta function), with the Holm and Benjamini–Hochberg decisions implemented in the same script; re-running the same seed reproduces the same numbers.
Results
With 60 tests at α=0.05, the expected number of false positives is 3 and the probability of at least one is 1 - 0.95^60 = 95.4%. The run with seed 20261037 returns 4 rules with p-values below 0.05 and a smallest p of 0.001185; the Bonferroni threshold is 0.05/60 = 0.000833 and the first Holm step uses the same threshold, so neither procedure lets any rule through. Benjamini–Hochberg at q=5% yields 2 discoveries.
The rule with the smallest p can be checked line by line: over 240 months its mean return is -0.21187 (return units) with a standard deviation of 1.00007, so the standard error of the mean is 1.00007 / √240 = 0.064554, t = -0.21187 / 0.064554 = -3.282, and the two-sided p-value at df = 239 is 0.001185. It is "significant" although the true effect is zero - the direct consequence of making 60 comparisons.
Repeating the whole experiment 200 times (seeds 20261037 onward) gives a mean of 3.03 rules with p<0.05 per run, a standard deviation of 1.91, a range of 0 to 10, and at least one false positive in 94% of the runs, against the theoretical 95.4%.
Robustness
- If the 60 tests are correlated, the 95.4% independence figure is only approximate; Bonferroni still controls the family-wise error rate, but is conservative.
- Raising the candidate set to 200 rules lowers the threshold to
0.05/200 = 0.00025and raises the expected number of false positives to200 × 0.05 = 10; the same figures can be produced withnode scripts/simulate-multiple-testing.mjs 20261037 200 240. - Calibration check:
node scripts/simulate-multiple-testing.mjs --checkre-runs 5,000 zero-effect rules and returns 5.16% with p<0.05, a mean p of 0.5011 and shares below 0.25/0.5/0.75 of 0.252/0.497/0.748, matching the uniform p-values the null predicts;--selftestcompares the p-value function against known t quantiles (t=1.96, df=239 gives 0.0512). - Holm controls the same family-wise error rate as Bonferroni and is generally more powerful; Benjamini–Hochberg targets the false discovery rate instead, which is a different quantity. Both decisions are computed by our own script and are stated as this article's methodological description; the three registered sources do not cover Holm or BH. Neither exempts the author from reporting all attempts and the selection process.
- A different sample changes the p-values; one significant result is not the same as a reproducible one.
Limitations
The simulated rules are independent and near-normal, while real strategies are correlated and non-normal; the test covers one rule family. Trading costs, data revisions and publication bias are omitted, and effect sizes and confidence intervals are not reported. Bonferroni controls an error rate, not the probability that each conclusion is true; false positives remain possible after correction. The evidence does not establish the validity of any real rule.
Reproduction
- Run
node scripts/simulate-multiple-testing.mjsto generate 60 rules of zero-mean returns over 240 months with seed 20261037 and compute a t statistic and two-sided p-value for each. - Read from the output the count of p<0.05 rules, the smallest p, the expected false positives and the Bonferroni/Holm/BH decisions.
- Use
--selftestto check the p-value function,--checkfor the uniformity check and--repeat 200for the sampling distribution of the hit count. - Change the rule count or the number of months (positional arguments
seed rules months) and see whether the conclusion flips. - Report the number of attempts, the correlation structure and all p-values, not only the smallest.
node scripts/simulate-multiple-testing.mjs # seed rules months = 20261037 60 240
expected_false = 60 * 0.05 = 3
fwer = 1 - 0.95^60 = 0.9539
bonferroni = 0.05 / 60 = 0.000833
min_p = 0.001185 (mean -0.21187, sd 1.00007, se 0.064554, t -3.282)
naive_sig = 4; bonferroni_sig = 0; holm_sig = 0; bh_discoveries(q=0.05) = 2
--repeat 200 -> mean_hits 3.03, sd 1.91, range 0..10, share_with_hit 0.94
--check -> 5000 rules: share p<0.05 = 0.0516, mean p = 0.5011
Strength of conclusions
The 4 "significant" results are consistent with zero predictive power and are a product of multiple comparisons; the Bonferroni threshold removes all of them. The evidence supports pre-registering hypotheses, reporting the number of attempts and applying a multiple-testing correction; it does not support treating one significant result as proof that a strategy works.
Distinguish two error controls. FWER (family-wise error rate) controls the probability of at least one false rejection; Bonferroni and Holm belong here and are conservative. FDR (false discovery rate) controls the share of false results among those declared significant; Benjamini-Hochberg belongs here and has more power with many tests. The BH procedure finds 2 results at q=5%, but that does not make them true; FDR tolerates a share of false discoveries and suits exploratory work, not single-strategy decisions.
The garden of forking paths is subtler than 60 explicit rules: the researcher never records all attempts and reports only the final "significant" rule. The fix is not a post-hoc threshold but a prior statement of hypotheses, sample, rule family and stopping rule; if that is impossible, label the result exploratory and replicate on an independent sample. Multiple-testing correction handles known attempts, not unreported ones[1][2].
Related
- Required prerequisite: Hypothesis Testing and Practical Significance (RES-012), Out-of-Sample Testing and Overfitting (RES-022).
- Related reading: Hypothesis Testing and Practical Significance (RES-012), Backtesting and Look-Ahead Bias (RES-020), Out-of-Sample Testing and Overfitting (RES-022).
Figures in plain language
The three figures below check the mechanism, boundary and comparison in this article; labels come from its own sections, not new data.
Exercises
- With 60 independent tests at α=0.05, what is the expected number of false positives?
- What is the probability of at least one false positive?
- The smallest p is 0.001185 and the Bonferroni threshold is 0.000833. Is it significant?
- Why does data snooping inflate backtest results?
- What do FWER and FDR each control, and which suits exploratory research?
- What is the garden of forking paths, and why is it harder than 60 explicit rules?
Suggested answers
- 60 × 0.05 = 3.
- 1 - 0.95^60 = 95.4%.
- No; 0.001185 > 0.000833, and the first Holm step uses the same threshold, so it is rejected there too.
- Because only the best attempt is reported while the number of attempts stays hidden, so the reported maximum is easily a chance high.
- FWER controls the probability of at least one false rejection (Bonferroni, Holm; conservative); FDR controls the share of false results among discoveries (BH; more power with many tests, better for exploratory work).
- The garden of forking paths means the researcher never records all attempts and reports only the final significant rule; correction handles known attempts, not unreported ones.
Sources
- NIST/SEMATECH. e-Handbook of Statistical Methods, “7.4.6.3 Bonferroni's method.” U.S. Government work (public domain). https://www.itl.nist.gov/div898/handbook/prc/section4/prc463.htm (accessed 2026-10-30)
- Sullivan, Ryan, Allan Timmermann, and Halbert White. “Data-Snooping, Technical Trading Rule Performance, and the Bootstrap.” Journal of Finance 54, no. 5 (1999): 1647–1691. License unknown. https://ideas.repec.org/a/bla/jfinan/v54y1999i5p1647-1691.html (accessed 2026-10-30)
- OpenStax. Introductory Statistics 2e, “9.2 Outcomes and the Type I and Type II Errors.” CC BY-NC-SA 4.0. https://openstax.org/books/introductory-statistics-2e/pages/9-2-outcomes-and-the-type-i-and-type-ii-errors (accessed 2026-10-30)
Worked demo
Read-through check: can you say three things?
No recitation needed. Tick each sentence below and see whether you can explain the mechanism, one worked example and one boundary in your own words.
Ticked 0 / 3
The numbers are teaching assumptions that show relationships, not forecasts or investment advice.
This article has passed the current publication gate. Factual, calculation and translation revisions update both language versions together.