Basic Prerequisites: Probability & Measure Theory (order statistics, extreme-value theory, hypothesis testing). (these are the folder-level prerequisites for pages 02–06; page 01 states its own, smaller, entry requirements)
1. Intuition & Practical Objective
A backtest is not a measurement - it is the maximum of a search. The moment a researcher runs a parameter sweep (holding periods, entry thresholds, stop losses, universes, model families) and reports the winner, the reported statistic is a maximum of random variables, not an unbiased estimate of one. Under the null of zero skill, that maximum still grows without bound as . So the number of trials is not a footnote: it is the single most important number missing from almost every published backtest, and without it a Sharpe ratio is uninterpretable.
This folder is the topic-hub for backtesting hygiene in Kwant-Atlas. It (a) gives you the fast formula/decision lookup below - the job #1 of a hub - and (b) routes you to six sub-pages that walk from raw intuition through the multiple-testing problem, the Deflated Sharpe Ratio (DSR), practice, and advanced tooling.
The one-sentence essence. “A reported Sharpe ratio overstates skill by exactly the amount by which the maximum of null trials exceeds zero - so deflate it by the order statistic , adjusted for sample length and non-normal returns.”
2. Mathematical Ground Truth & Derivations
Quick-Reference Lookup (job #1). Notation: = estimated (non-annualized, per-period) Sharpe ratio, = number of independent trials, = number of observations, = sample skewness and (Pearson) kurtosis of the selected strategy’s returns, = standard normal CDF, the Euler–Mascheroni constant. All formulas below were re-executed and reproduced numerically (see §3).
| Quantity | Formula | Verified check |
|---|---|---|
| Family-wise error ( tests, level ) | ||
| Expected max SR (EVT approx, per unit ) | ||
| Expected max SR (exact order statistic, per ) | ; | |
| Selection threshold (null, in SR units) | example: | |
| Deflated Sharpe Ratio | example: | |
| Minimum Track Record Length (PSR ) | ann (sk , kurt ) days | |
| Harvey–Liu multiple-testing -value | ; haircut SR found by inverting | ; HSR (haircut ) |
| Bonferroni / Holm (FWER) | ; Holm adjusts sequentially | - |
| Probability of Backtest Overfitting | , (CSCV logits) | pure noise |
Critical caveat (Bailey & López de Prado §A.3). is the number of independent trials. If you ran correlated trials, use the implied count ( = average off-diagonal correlation). Plugging raw overstates the threshold and over-penalizes; ignoring correlation understates it. Also: DSR is not proof of fraud - it is the statement that the observed Sharpe is not distinguishable from the best of coin flips at the 95% level.
3. Computational Implementation - the hygiene engine
Standard-library only. It reproduces every verified number in §2: the expected-max-Sharpe order statistic, the DSR of the canonical Bailey–López de Prado example, and the MC check that the order statistic beats the crude EVT approximation.
Read the output as the paper’s punchline: the strategist should have been fundable after only independent trials - but ran 100, so the same deflates to , below the 95% bar. Non-normality (skew , kurtosis ) is a second, independent source of inflation: had the returns been normal, the strategy would have survived up to trials.
4. Failure Modes & First-Principles Breakdowns
Hub signposts - the folder’s practice checklist lives in 05 · Failure Modes & Practice. In one line each:
- The missing . A backtest that does not disclose the number of trials is uninterpretable (“worthless”, B&LdP §abstract) - the reported Sharpe is the max of an unknown number of draws.
- Holdout ≠ hygiene. A single train/test split assesses generality as if one trial occurred; apply holdout 20 times and a false positive at 5% becomes expected, not unlikely.
- Independence is a fiction. Correlated trials make the effective far smaller than the raw sweep count; ignoring this both mis-calibrates DSR and hides that your “1000 ideas” were really ~10.
- Leakage across folds. Standard -fold CV on financial data leaks serial-correlation/label overlap between train and test; you need purging + embargo (page 06).
- Memory effects make it worse than neutral. In mean-reverting series, overfit rules undo their in-sample patterns out of sample - overfitting becomes loss-maximization, not merely zero-edge.
5. References
- Bailey, David H. & López de Prado, Marcos: The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality, Journal of Portfolio Management 40(5), 94–107 (2014). The formula-authoritative source for this folder; the worked example above is reproduced exactly.
- Harvey, Campbell R. & Liu, Yan: Backtesting, Journal of Portfolio Management 42(1), 13–28 (2015). The multiple-testing / haircut Sharpe framework (FWER, FDR, Bonferroni–Holm).
- Bailey, Borwein, López de Prado & Zhu: The Probability of Backtest Overfitting, Journal of Computational Finance 20(4) (2017). CSCV and the PBO statistic.
- White, Halbert: A Reality Check for Data Snooping, Econometrica 68(5), 1097–1126 (2000). The bootstrap/reality-check test that the best model in a search has no predictive edge over a benchmark.
- Hastie, Tibshirani & Friedman: The Elements of Statistical Learning (2nd ed., 2009)
6. Connected Graph Bridges
- Foundational base: Probability & Measure Theory · order statistics & extreme-value theory
- Sibling topics: Feature Engineering & Labeling (triple-barrier labels feed the purge) · Stat-Arb & Pairs Trading
- Cross-pillar: Financial ML Pitfalls & Low SNR (the same overfitting disease, ML flavour)
- Sub-pages (in-folder): 01 From Zero · 02 Why Backtests Lie · 03 Multiple Testing · 04 Deflated Sharpe · 05 Failure Modes · 06 Advanced Extensions