◆ New — Strategy Validator, Code Fixer & Prop Compliance Checker are live. Try one free →
Home / Learn / The Deflated Sharpe Ratio Explained: Correcting Your Backtest for How Many Strategies You Tried
Research

The Deflated Sharpe Ratio Explained: Correcting Your Backtest for How Many Strategies You Tried

The deflated Sharpe ratio, introduced by David Bailey and Marcos López de Prado, is the probability that a strategy's true Sharpe ratio is positive after correcting the observed value for the number of strategy variants tried, the length of the track record, and non-normal returns. If you tested a hundred configurations and reported the best, most of that best Sharpe is selection bias — and the DSR quantifies exactly how much. This is educational material only, not financial advice: no statistic certifies profitability, and trading carries a real risk of loss.

What is the deflated Sharpe ratio?

The deflated Sharpe ratio (DSR) is the probability that a strategy's true Sharpe ratio exceeds zero, computed after correcting the observed backtest Sharpe for three things that inflate it: the number of strategy variants you tried before selecting this one, the shortness of the track record, and non-normality (skewed, fat-tailed returns). It was introduced by David H. Bailey and Marcos López de Prado in "The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting, and Non-Normality" (Journal of Portfolio Management, 2014).

The problem it solves is the one almost every strategy developer creates without noticing. You rarely backtest one strategy; you backtest a family — an optimizer sweep over lookback lengths, a grid of stop distances, a dozen entry filters. Then you report the best result. But the maximum of many noisy estimates is biased upward even when every underlying strategy is worthless: run one hundred random, zero-skill configurations and the best of them will show an impressive Sharpe by luck alone. A raw Sharpe ratio carries no memory of the search that produced it, so it cannot distinguish a genuine effect from the winner of a lottery among noise.

The DSR restores that memory. It raises the bar the observed Sharpe must clear from zero to the Sharpe you would expect the best of N worthless trials to show, and then asks — given your sample length, skewness, and kurtosis — how confident you can be that the true value clears it. A DSR near 1 means the result is unlikely to be pure selection bias; a DSR near 0.5 or below means your "discovery" is roughly what noise plus search would produce. The following sections build each component.

Why does trying many strategies inflate the best Sharpe?

Suppose, for the sake of argument, that every configuration you test has a true Sharpe of exactly zero — no skill anywhere. Each backtest still produces an estimated Sharpe that scatters around zero, because a finite sample of returns has luck in it. Test one configuration and you will see something near zero. Test N configurations and select the best, and you are no longer sampling the distribution — you are sampling its maximum, and the expected maximum of N draws grows with N (on the order of the square root of 2·ln N for Gaussian noise). Selection is the bias.

Bailey and López de Prado make this precise. If the estimated Sharpes of your trials are roughly Gaussian noise with variance V across trials, the expected maximum is approximately:

E[max SR] ≈ √V · [ (1 − γ) · Z⁻¹(1 − 1/N) + γ · Z⁻¹(1 − 1/(N·e)) ]

where Z⁻¹ is the standard normal quantile function, e is Euler's number, and γ ≈ 0.5772 is the Euler–Mascheroni constant. Plugging in N = 100 gives roughly 2.5·√V: the best of a hundred worthless trials is expected to sit about two and a half cross-trial standard deviations above zero. At N = 1,000 it is roughly 3.2·√V. The bar rises slowly (logarithmically) but relentlessly — and note that it never stops rising, which is why "I'll just test a few more variants" is never free.

This expected maximum, call it SR₀, becomes the benchmark your selected strategy must beat. Not zero — zero is the right hurdle only for someone who ran exactly one backtest, and almost nobody did. Every optimizer pass, every parameter tweak you evaluated and discarded, every variant a walk-forward design considered: they all count toward N.

From Sharpe to probabilistic Sharpe: sample length, skew, and fat tails

The second ingredient predates the DSR paper: the probabilistic Sharpe ratio (PSR), from Bailey and López de Prado's "The Sharpe Ratio Efficient Frontier" (2012). The PSR answers: given an observed Sharpe ŜR estimated from T return observations, what is the probability that the true Sharpe exceeds some benchmark SR*? Its form is:

*PSR(SR\) = Φ( (ŜR − SR\) · √(T − 1) / √(1 − γ₃·ŜR + ((γ₄ − 1)/4)·ŜR²) )*

where Φ is the standard normal CDF, γ₃ is the skewness of the returns, and γ₄ is their kurtosis (3 for a normal distribution).

Each piece encodes an honest intuition. The √(T − 1) term says confidence grows with track length: the same observed Sharpe means far more over 2,000 daily returns than over 60, because the Sharpe estimator's own standard error shrinks with the sample. The denominator says the shape of returns matters: negative skewness (frequent small wins, occasional large losses — the classic profile of short-volatility and tight-target/wide-stop systems) and excess kurtosis (fat tails) both widen the estimator's uncertainty, so a strategy with those features needs a longer record to earn the same confidence. This is a quantified version of a warning experienced developers give qualitatively: smooth-looking equity curves built on rare-disaster risk profiles are precisely the ones whose Sharpe ratios flatter the shortest.

Used alone with SR* = 0, the PSR already improves on the raw Sharpe by converting it into a probability statement that respects sample size and non-normality. What it does not yet know about is the search. That is the final assembly step.

Putting it together: how do I compute the DSR?

The deflated Sharpe ratio is simply the PSR evaluated against the selection-bias benchmark: DSR = PSR(SR₀), where SR₀ is the expected maximum Sharpe of N worthless trials from the earlier formula. The recipe:

  1. Count your trials, N. Every configuration whose backtest result you observed counts — each row of an optimizer sweep, each discarded variant, each "quick check". A 10×10 parameter grid is one hundred trials, not one strategy.
  2. Estimate V, the variance of the estimated Sharpes across those trials. If you logged all trial results (you should), compute it directly.
  3. Adjust N for correlation. Trials are rarely independent — a 20-period and 21-period moving-average system are nearly the same bet. Bailey and López de Prado suggest estimating the number of effectively independent trials, for example by clustering trial return streams and using the number of clusters. Using raw N overstates the correction; using 1 ignores it; the effective number sits between.
  4. Compute SR₀ from N and V, then plug SR₀ into the PSR along with your selected strategy's ŜR, sample length T, skewness, and kurtosis — all in the same frequency units (typically per-period, not annualized).
  5. Read the result as a probability. A conventional threshold is DSR ≥ 0.95: less than a 5% chance that a result this good is what the best of your worthless-trial ensemble would show.

The most common practical failure is not the math — it is that N is unrecorded. If you did not log the search, you cannot honestly deflate the result, and the temptation is to remember N as "a few". This is the single strongest argument for logging every backtest variant as you research, which is precisely the discipline ForexCodes' validation workflow is built around.

The wider family: Reality Check, SPA, and haircut Sharpe ratios

The DSR is the most retail-accessible member of a broader multiple-testing literature, and knowing the neighbours puts it in context.

Halbert White's Reality Check (Econometrica, 2000) was the landmark: a bootstrap-based test of whether the best model from a search genuinely beats a benchmark, once the full breadth of the search is accounted for. Sullivan, Timmermann, and White applied it to technical trading rules and found that large universes of rules whose best members looked impressive in isolation often failed to survive the data-snooping correction. Peter Hansen's test for Superior Predictive Ability (SPA) (Journal of Business & Economic Statistics, 2005) refined the Reality Check with studentization and a tighter null, making it less easy to "break" by deliberately including many terrible strategies in the comparison set — a real gaming vector for the original.

On the finance-practice side, Campbell Harvey and Yan Liu ("Backtesting", Journal of Portfolio Management, 2015) proposed haircut Sharpe ratios, translating multiple-testing corrections (Bonferroni, Holm, BHY) into an explicit discount on a reported Sharpe; with Heqing Zhu they argued that the sheer volume of published factor research means newly claimed effects should clear a t-statistic hurdle of roughly 3 rather than 2. And Bailey, Borwein, López de Prado, and Zhu supplied two companion pieces to the DSR: "The Probability of Backtest Overfitting" (with its combinatorially symmetric cross-validation method) and the pointedly titled "Pseudo-Mathematics and Financial Charlatanism" (Notices of the AMS, 2014).

The shared conclusion across all of them: a performance statistic is uninterpretable without the search history that produced it. The tools differ in machinery; none disagrees on that.

What to log while you research — and the honest limits

The DSR's practical demand is bookkeeping, so build the habit before you need it. Log every variant evaluated: parameter values, the market and date range, the resulting Sharpe (or your chosen metric), and enough detail to reconstruct correlations between trials later. Include the trials your optimizer ran on your behalf — TradingView deep-backtest sweeps and MetaTrader optimization passes are trials whether or not you looked at each row individually. When you finally have a candidate worth taking seriously, you can then report the honest triple: raw Sharpe, PSR, and DSR given the true N — instead of a lone Sharpe stripped of its search history.

Be equally honest about the method's limits. The expected-maximum formula assumes the cross-trial Sharpe estimates are roughly Gaussian; the effective number of independent trials is itself an estimate with real uncertainty; and V estimated from a handful of logged trials is noisy. The DSR is a principled deflation, not an oracle — a DSR of 0.97 does not certify an edge, and treating any threshold as a green light to size up recreates the overconfidence the statistic exists to puncture. It is also strictly backward-looking: it corrects the inference from historical data and says nothing about whether market structure holds going forward.

Used alongside walk-forward analysis (which tests procedure) and Monte Carlo resampling (which tests path risk), the DSR covers the third failure mode — selection bias — and together they form a reasonably complete honesty toolkit for backtest evaluation. Everything in this article is educational only and not financial advice. No statistic, however well-deflated, makes a strategy profitable; a backtest is a description of the past, and trading always carries a real risk of loss.

Key takeaways

Educational only — not financial advice. Trading involves substantial risk of loss.

Catch the bug that compiles.Run auditGet Pro