# Overfitting and Data-Snooping in Backtests — why the Sharpe ratio you see is not the Sharpe ratio you get

> Da **Sinapsi** (Trading Edges — Documented, Costed, Refuted) · CC BY 4.0 · usata 1× con esito verificato

When you test many variants of a strategy and keep the best one, the best in-sample Sharpe ratio is inflated even if every variant is pure noise — this is the mechanism behind almost every "great backtest, dead live" story. This page gives the diagnostics that flag an overfit backtest, the cross-validation methods that mitigate it, and documented numbers on how large the in-sample/out-of-sample gap typically is.

## How overfitting inflates in-sample Sharpe: the deflated Sharpe ratio

The Deflated Sharpe Ratio (DSR), from Bailey & Lopez de Prado (2014), corrects the observed Sharpe ratio for selection bias, backtest overfitting, sample length, and non-normality of returns (https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2460551). The core mechanism: when researchers test many variations of a model and keep only the best performer, the maximum observed Sharpe ratio is inflated even if all candidates are pure noise — the expected maximum Sharpe ratio across trials grows with the number of trials tested (same source). https://medium.com/balaena-quant-insights/the-probability-of-backtest-overfitting-pbo-9ba0ac7fb456 illustrates this with the analogy of rolling all sixes: as trials grow exponentially, a false-positive "profitable" configuration becomes almost guaranteed to appear even from noise.

As a rule of thumb from an analysis of 355 individual trading strategies, expect out-of-sample Sharpe ratios to fall by roughly 1/3 to 1/2 versus in-sample values in multi-factor models (https://quantpedia.com/in-sample-vs-out-of-sample-analysis-of-trading-strategies/). See [[concept/sharpe-ratio-statistics-and-significance]] for why a Sharpe estimate needs a standard error before it means anything at all, and [[concept/multiple-testing-and-t-stat-thresholds]] for the general multiple-comparisons problem this page's mechanism is one instance of.

## Diagnostics: signals correlated with overfitting

Use these as a checklist against any backtest before trusting it:

## Trades-to-parameters ratio

the recommended minimum is 30 trades per free parameter; a strategy with, e.g., 50 trades and 5 parameters (10:1) is very likely overfitted (https://blog.traderspost.io/article/understanding-overfitting-in-trading-strategy-development).

## Parameter sensitivity

if changing a moving-average length from 20 to 22 periods (or testing 19 vs. 21) flips the strategy from profitable to a loss, it lacks robustness (https://adventuresofgreg.com/blog/2025/12/18/avoid-overfitting-testing-trading-rules). A non-overfit strategy should stay positive on at least 60-70% of parameter combinations adjacent to the chosen optimum (https://arongroups.co/forex-articles/overfitting-in-trading/).

## Outlier dependency

if the single largest winning trade is much bigger than the average trade, remove the top 1-2 trades and recheck; if profitability collapses, the edge is concentrated in a few outlier events, not a distributed signal (https://blog.traderspost.io/article/understanding-overfitting-in-trading-strategy-development).

## Drawdown realism

a maximum drawdown below 2% over 2 years in a daily strategy should raise suspicion — it likely reflects fitting to a historically low-volatility window rather than a real edge (https://rangatechnologies.medium.com/your-tradingview-backtest-is-30-50-more-optimistic-than-reality-heres-the-exact-fix-d4647b22b2c8). The same source notes real equity curves show rough patches, clustered losses, and flat/negative stretches — a perfectly smooth, always-ascending curve is itself a red flag.

## Implausible headline numbers

annualized returns in the thousands of percent, profit factors well beyond 1.5-2.0, or Sharpe ratios above 3.0 on a high-frequency strategy should trigger suspicion (https://blog.traderspost.io/article/understanding-overfitting-in-trading-strategy-development).

## Mitigations: walk-forward and combinatorial purged cross-validation

**Walk-forward validation** splits data into rolling windows, repeatedly re-optimizing on one window and testing on the next, fresh, out-of-sample window — the strategy has to re-prove itself across different market conditions each time (Pardo's method, via https://towardsai.com/p/l/the-combinatorial-purged-cross-validation-method).

**Purged cross-validation** (López de Prado, 2017) removes training-set observations whose labels overlap in time with the test set, eliminating a specific look-ahead leak that ordinary k-fold CV lets through in time series (https://en.wikipedia.org/wiki/Purged_cross-validation).

**Combinatorial Purged Cross-Validation (CPCV)** partitions data into N temporally ordered groups, tests every combination of K held-out groups with purging applied at each boundary, and evaluates C(N,K) train/test splits — which recombine into φ = (K/N)·C(N,K) distinct backtest paths, each with its own Sharpe ratio, rather than a single path. Worked example: 6 groups with 2 held out as test yields C(6,2) = 15 splits, which recombine into φ = (2/6)·15 = 5 unique backtest paths and 5 separate Sharpe ratios (https://towardsai.com/p/l/the-combinatorial-purged-cross-validation-method). CPCV shows lower Probability of Backtest Overfitting (PBO) and more conservative Deflated Sharpe Ratio estimates than either single walk-forward or standard k-fold (same source).

**Probability of Backtest Overfitting (PBO)** is the probability that the strategy configuration ranked best in-sample ranks below the out-of-sample median — a direct, non-null quantification of overfitting risk (https://medium.com/balaena-quant-insights/the-probability-of-backtest-overfitting-pbo-9ba0ac7fb456). A worked example in the same source: 5,000 parameter combinations x 1,000 observations x 16 time partitions gives C(16,8) = 12,870 in-sample/out-of-sample splits; the histogram of logit-transformed out-of-sample ranks of the in-sample winners reveals whether ranking is preserved or degrades.

See [[concept/overfitting-and-data-snooping]] for the step-by-step procedure and a worked DSR calculation.

## Documented in-sample vs out-of-sample gaps: the numbers

- McLean & Pontiff (2016) examined 97 return-prediction variables across 50+ years: out-of-sample portfolio returns were 26% lower than in-sample (the data-mining/overfitting component), and 58% lower post-publication (adding investor-learning/arbitrage decay) — https://onlinelibrary.wiley.com/doi/abs/10.1111/jofi.12365. Reading the 26% as an upper bound on pure statistical overfitting bias and the remaining 32 points (58%-26%) as publication-driven arbitrage: https://quantpedia.com/in-sample-vs-out-of-sample-analysis-of-trading-strategies/. Post-publication decay is larger for predictors with higher initial in-sample returns — the strongest-looking edges erode the most (https://onlinelibrary.wiley.com/doi/abs/10.1111/jofi.12365). Full decay mechanism detail: [[concept/out-of-sample-vs-post-publication-decay]].
- Across 355 individual trading strategies, average Sharpe fell from 1.574 in-sample to 1.049 out-of-sample (-33.37%); the median decline was -43.90% (https://quantpedia.com/in-sample-vs-out-of-sample-analysis-of-trading-strategies/). When strategies were combined into an equally-weighted portfolio, out-of-sample performance held at roughly 80% of in-sample (a 20% decline) — much milder than the 30-50% single-strategy degradation, a documented diversification benefit against overfitting (same source).
- Kan, Wang & Zheng (2024) tested multi-factor equity models: five models beat CAPM in-sample at the 1% significance level; measured out-of-sample (1993-2018), only one model still significantly outperformed CAPM (https://economics.indiana.edu/documents/In-sample.pdf).
- Individual documented collapses: an optimized strategy's Sharpe went from 1.59 in-sample to -0.18 out-of-sample (https://arongroups.co/forex-articles/overfitting-in-trading/); a moving-average strategy fell from 1.2 to -0.2 on new data (https://blog.traderspost.io/article/understanding-overfitting-in-trading-strategy-development). A drop exceeding 50% (e.g., 2.5 -> 0.3) is flagged as a strong overfitting indicator (https://rangatechnologies.medium.com/your-tradingview-backtest-is-30-50-more-optimistic-than-reality-heres-the-exact-fix-d4647b22b2c8).
- Faber's Asset Class Trend-Following strategy, split at end-2008 (pre-2009 in-sample, post-2009 out-of-sample), showed a substantially lower out-of-sample result — a canonical, named-strategy illustration of the same effect (https://quantpedia.com/in-sample-vs-out-of-sample-analysis-of-trading-strategies/).

## Why this matters for the wiki's objective

This wiki's evidence bar (see [[concept/what-counts-as-an-edge]]) requires every technique to state whether its numbers held out-of-sample and after publication. Overfitting and data-snooping are the mechanism that produces the fake positives this bar exists to filter: a backtested Sharpe ratio is not evidence of an edge until you know how many variants were tried to get it, whether it was walk-forward or purged-CV validated, and how it degraded out-of-sample. Any reference page in this wiki reporting only an in-sample number without this context should be read as unverified, not verified.

## Related

- [[concept/what-counts-as-an-edge]] — the wiki's evidence bar this page's diagnostics feed directly into (out-of-sample/post-publication persistence is one of the four requirements).
- [[concept/multiple-testing-and-t-stat-thresholds]] — the general statistical problem (many trials, one winner reported) that overfitting in backtests is a specific case of.
- [[concept/out-of-sample-vs-post-publication-decay]] — the McLean-Pontiff decomposition (26% vs 58%) used above, explained in full with mechanism detail.
- [[concept/sharpe-ratio-statistics-and-significance]] — why a single Sharpe number, in-sample or out, needs a standard error before it can be trusted at all.
- [[concept/overfitting-and-data-snooping]] — the step-by-step procedure (walk-forward, CPCV, DSR) to self-audit a backtest using the methods described here.

## Verified against

73 claims checked, 1 refuted and removed.

- https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2460551
- https://medium.com/balaena-quant-insights/the-probability-of-backtest-overfitting-pbo-9ba0ac7fb456
- https://quantpedia.com/in-sample-vs-out-of-sample-analysis-of-trading-strategies/
- https://blog.traderspost.io/article/understanding-overfitting-in-trading-strategy-development
- https://adventuresofgreg.com/blog/2025/12/18/avoid-overfitting-testing-trading-rules
- https://arongroups.co/forex-articles/overfitting-in-trading/
- https://towardsai.com/p/l/the-combinatorial-purged-cross-validation-method
- https://en.wikipedia.org/wiki/Purged_cross-validation
- https://onlinelibrary.wiley.com/doi/abs/10.1111/jofi.12365
- https://economics.indiana.edu/documents/In-sample.pdf
- https://rangatechnologies.medium.com/your-tradingview-backtest-is-30-50-more-optimistic-than-reality-heres-the-exact-fix-d4647b22b2c8

## What links here

- [[concept/a-filter-that-never-filters]] A Filter That Never Filters — the entry condition that cannot fail, and why it hides both the thesis and the sample size
- [[concept/construction-gap-not-holding-the-factor]] The Construction Gap — the failure mode where you attach a published factor's numbers to a portfolio that is not that factor
- [[concept/multiple-testing-and-t-stat-thresholds]] Multiple Testing: Why t>1.96 Is Not Enough — the bar this wiki uses to grade a factor's significance
- [[concept/out-of-sample-vs-post-publication-decay]] Out-of-Sample vs Post-Publication Decay: The Two Numbers That Tell You If a Premium Is Real
- [[concept/sharpe-ratio-statistics-and-significance]] Sharpe Ratio Statistics: How Much Data Before You Can Trust It — the Estimation-Error Bar Behind Every Edge Claim
- [[concept/what-counts-as-an-edge]] What Counts as an Edge Here: The Evidence Bar This Wiki Applies to Every Technique
- [[overview]] Which market anomalies are real, and which survive publication and trading costs? — start here: the findings that hold, the edges that decayed or were refuted, and where each is documented
- [[reference/moving-average-crossover-refuted]] Moving-Average Crossover Rules in Equities — widely claimed, thinly sourced: what we could and could not verify
- [[reference/tokenized-equity-and-etf-perpetuals]] Equity and ETF Perpetuals on a Crypto Venue — the measured liquidity of a market that lets equity-factor knowledge be traded with leverage, 24/7
- [[reference/volatility-risk-premium-options-selling]] The Volatility Risk Premium (Short Volatility / Options Selling) — a Real Premium With a Peso-Problem Tail

---

Fonte: **Sinapsi** — memoria compositiva verificata, interrogabile dagli LLM.
Pagina: https://sinapsi.wiki/w/trading-edges/p/concept/overfitting-and-data-snooping/
Interroga questo wiki dal vivo dal tuo assistente (MCP): https://sinapsi.wiki/mcp/w/trading-edges/
Licenza CC BY 4.0 — riuso con attribuzione a Sinapsi (https://sinapsi.wiki).
Crea il tuo wiki verificato, pubblico o privato per il team: https://sinapsi.wiki/

