strateva.

Articles

Bonferroni, Holm and Benjamini-Hochberg: when you test many rules at once

In this article

You test a rule and it comes out "significant at 5%". It sounds like a test passed. Now the question that changes everything: how many rules did you test?

If it was one, 5% means what it seems to. If it was fifty, it is almost certain that some will pass even if none works. This article explains the three most used corrections for that problem, what each protects against and when each is the right one, with an example on real data.

The problem, in one sentence

A 5% threshold means that, if the rule has no effect at all, you will see it pass by chance one time in twenty. With one test that is a small risk. With 47 tests and no real effect, you should expect two or three false positives.

No bad intent is needed. Trying several lengths of an average, several assets or several filters and keeping the ones that "work" is enough.

An example with 153 years of markets

We took 47 simple trend rules on the S&P 500 since 1873: be invested if the index is above its 2- to 24-month average, or if it has risen over the last 1 to 24 months. We asked the same question of each: does the month after an "invested" signal return more than the month after an "out" signal?

Each test returns a p-value: the probability of seeing a difference that large if the rule told nothing apart.

Of 22 "significant" results, 8 remain, or 1The 47 trend rules on the S&P 500, ordered by p-value (log scale). At the usual 5% threshold, 22 pass. With Bonferroni and with Holm, 1 passes; with Benjamini-Hochberg, 8. The signal is applied two months late so the smoothing of this series cannot manufacture the result.
0.0010.010.1111020304047

Rank of the rule, from smallest to largest p-value

  • Passes Bonferroni and Holm
  • Passes Benjamini-Hochberg only
  • Uncorrected threshold: 0.05
  • Bonferroni: 0.0011
  • Benjamini-Hochberg: rises with rank

Source: Robert Shiller’s monthly S&P 500 series, with dividends. No risk-free rate deducted; time out of the market earns zero.

CriterionRules that pass, of 47
Uncorrected 5% threshold22
Bonferroni1
Holm1
Benjamini-Hochberg8

The same evidence gives anything between 22 "findings" and a single one. The difference is not in the data, but in which error you have decided to control.

Bonferroni: let none slip through

Bonferroni splits the threshold across all the tests. With 47 tests and 5%, each has to fall below 0.05 / 47, that is, below 0.0011.

It controls the probability of making at least one false positive in the whole set. It is the strongest guarantee and also the most expensive: with many tests the bar rises so far that real but modest effects are left out.

Holm: the same, wasting less

Holm gives the same guarantee as Bonferroni and never rejects fewer. It sorts the p-values from smallest to largest and relaxes the threshold step by step: the smallest is compared with 0.05 / 47, the next with 0.05 / 46, and so on until the first one that fails. There it stops.

In practice there is no reason to use Bonferroni when you can use Holm. In this example both let the same rule through, because the second no longer clears its threshold.

Benjamini-Hochberg: accept a few false ones so as not to lose everything

Benjamini-Hochberg changes the question. It does not try to avoid every false positive: it controls what share of what you accept will be false, on average. At 5%, of every twenty rules accepted one is expected to be a false discovery.

It works with a rising line: the smallest p-value is compared with 0.05 × 1 / 47, the second with 0.05 × 2 / 47, and so on. Every rule is accepted up to the last one that falls below its stretch of the line. Here that is 8.

Which to use

If a false positive…ControlMethod
…is costly: you will put capital into whatever passesThat there is noneHolm
…is cheap: this is a screen to study furtherThe share of false onesBenjamini-Hochberg

A strategy you are going to trade is the first case. A list of candidates that will then go through a full validation is the second.

What does not count is looking at all three results and keeping the most convenient. The method is decided before seeing the p-values.

Honest limits

  • They only correct the tests you declare. If you tried 200 variants and show 47, the correction falls short. It is the same limit as the Deflated Sharpe Ratio and PBO.
  • The rules in this example resemble each other. A 10-month average and an 11-month one give almost identical signals, so these are not 47 independent tests. Bonferroni and Holm remain valid, but are harsher than necessary. Benjamini-Hochberg keeps its guarantee when tests tend to move together, as here.
  • Passing the correction is not having a strategy. The test says the signal tells better months from worse ones. It does not say it beats buy and hold, or that it survives costs.
  • This data has a trap of its own. The series uses the monthly average of daily closes, which smooths prices and flatters any trend rule. That is why we apply the signal two months late. With a single month, 40 of the 47 rules passed uncorrected.

What to ask if someone shows you a "significant" result

  • How many rules, assets or parameters were tested in total?
  • Is the p-value you are showing me corrected? By which method?
  • Was the method chosen before seeing the results?
  • Are the tests that did not pass on the list?

Where it fits in a validation

When an engagement includes several hypotheses or several rules, our validation can adjust the p-values with Bonferroni, Holm or Benjamini-Hochberg, stating how many tests are included and which method was agreed. When there is a single strategy chosen from many variants, the right tool is the Deflated Sharpe Ratio, which corrects the Sharpe of the winner.

These tests are part of the quantitative validation. At Strateva we validate strategies in stocks, ETFs, spot crypto and spot FX, always unleveraged and with no margin. We don't take engagements on CFDs, futures, perpetuals or options.

To ask whether yours fits, write to stan@strateva.ai with the market (stocks, ETFs, crypto or FX, spot), the frequency and how many rules or assets you tested. Don't send private code or passwords in the first email.


Educational and research content. Not investment advice. Our own calculation on Robert Shiller's monthly S&P 500 series, with dividends, from 1873 to 2026: 23 moving-average rules (2 to 24 months) and 24 momentum rules (1 to 24 months), with the signal applied two months later. Each p-value comes from a one-sided test of a difference in means with unequal variances and a normal approximation, not corrected for autocorrelation. 5% threshold in all three methods.

All articles

CONTACT

Tell me about your strategy. I will say whether it fits within 48 business hours.

Tell me what you want checked, the asset, the frequency and what you have: rules, a report or code. I will tell you whether it fits and which plan it would be.

What to include in your email

  • Market, instruments and frequency (Spot only).
  • What you want checked, and the period.
  • Language and approximate code size, without pasting the code.
  • What data you have, and whether you need an NDA.

Do not send private code, keys or passwords.

stan@strateva.ai

Reply within 48 h (business days). No private material in the first message. No obligation to commission work.

Who replies

I am Filip Stanciu. I have an MSc in Quantitative Finance from the University of Alcalá, a degree in Finance from the Complutense University of Madrid, and a MiFID II certificate. I have worked in quantitative research for an asset manager, validating stock and ETF strategies. I read and reply to every email myself.

I am not a certification body and I am not a large team. I am one person, and I say so.

Nicolae Filip Stanciu