Deflated Sharpe Ratio Explained: Why Your Backtest Looks Better Than It Is
A Sharpe ratio tells you how much return a strategy produced per unit of wobble. The Deflated Sharpe Ratio asks a harder question: given how many versions of this strategy you tried before picking this one, how impressive is that number really?
The gap between the two is where most backtests quietly die. This guide explains what the deflation does, how to compute it, and what number you should expect your own bot to produce.
The problem in one example
Take a strategy with no edge at all. Now test 50 variants of it: different moving-average lengths, different stop distances, different hours of the day. Keep the best one.
That winner will have a good-looking equity curve and a respectable Sharpe ratio. Not because it works, but because you ran 50 lotteries and kept the winning ticket. The ordinary Sharpe ratio has no way of knowing this happened. It sees one strategy and one track record, and it answers the question you asked rather than the question you should have asked.
The Probabilistic Sharpe Ratio (PSR) and the Deflated Sharpe Ratio (DSR), both from work by Marcos López de Prado and David Bailey, close that hole.
PSR: is this Sharpe ratio distinguishable from zero?
PSR(0) is the probability that a strategy's true Sharpe ratio is above zero, given the Sharpe you observed, the number of observations, and the shape of the return distribution.
It rises with sample size, and it falls when returns are negatively skewed or have fat tails — which is exactly the profile of a strategy that wins small and often and then loses big. Two bots can show the same Sharpe ratio and have very different PSR values if one of them earned it over 1,000 trades and the other over 60, or if one of them has a hidden tail.
A common working threshold is PSR(0) ≥ 0.95: at least a 95% probability the true Sharpe is positive.
DSR: the same question, after counting your attempts
DSR takes PSR and deflates the benchmark it is measured against. Instead of asking whether the Sharpe beats zero, it asks whether the Sharpe beats the Sharpe you would expect the best of N trials to produce by pure chance.
That expected maximum grows with the number of trials, and it grows faster than people's intuition. The intuition to carry around is the one from order statistics: the expected largest value from N independent standard-normal draws rises roughly with the square root of twice the natural log of N. Sixty trials put the bar near 2.9 standard deviations; a thousand trials push it past 3.7. The number of attempts is not a footnote to the result. It is part of the result.
Two things follow:
- DSR is always lower than PSR, and the gap widens with every variant you try.
- A strategy can have PSR(0) = 0.99 and DSR = 0.30 at the same time. That combination is the signature of overfitting, and it is the single most informative pair of numbers you can compute about a backtest.
What counts as a trial
This is where almost everyone under-counts. A trial is any variant you looked at and could have chosen, including:
- every parameter combination in a grid search, not just the ones you wrote down;
- every entry filter you added and then removed because it did not help;
- every coin universe you tried;
- every version of the strategy from earlier sessions, if the current version descends from it;
- every timeframe you tested before settling on the one you kept.
If you ran a 10 by 10 grid, that is 100 trials, not 1. If you then added a filter and ran it again, that is 200. The honest number is almost always larger than the number you remember, and the correct response to uncertainty is to use the larger estimate. Deflating by too many trials makes you slow. Deflating by too few makes you confident about noise.
A worked comparison
Two of our own demonstration strategies, both audited the same way:
| | Honest trend-follower | Curve-fitted variant | |---|---|---| | What it is | EMA crossover with a band, past bars only | the best of 50 variants: a crossover that only trades on two weekdays, at one hour, held for exactly 36 bars | | Variants tried | 3 | 50 | | PSR(0) | 0.95 | 0.98 | | DSR | 0.74 | 0.39 | | Verdict | not yet enough evidence | not ready, and the gap says why |
The curve-fitted one has the better ordinary statistics. It is the one you would pick if you only looked at PSR, or at the equity curve, or at the win rate. Its DSR is what gives it away: once the 50 attempts behind it are priced in, most of its apparent edge is explained by having tried 50 times.
Note also that the honest strategy does not pass either. That is normal and it is the point. A real edge usually needs more trades before it can be told apart from luck, and "not yet" is a legitimate verdict.
How to use these numbers in practice
- Write down your trial count before you compute anything. Deciding it afterwards, when you can see which number you need, is how the count ends up at 1.
- Report PSR and DSR together. PSR alone flatters. DSR alone hides whether the problem is sample size or selection.
- Set the bar in advance. Ours: PSR(0) ≥ 0.95 and DSR ≥ 0.5, alongside a minimum trade count, a recency check, concentration limits and a drawdown limit. Six fixed gates, decided before the result is known.
- Expect to fail. Across the hundred strategy books we track, mostly paper, none currently passes all six gates at our 300-trade floor. That is the honest base rate, and a tool that frequently tells you yes is not measuring anything.
What these statistics cannot do
DSR works on your list of trades. It cannot see your code. So it will not catch:
- look-ahead bias, where the backtest used information that did not exist yet — that needs a separate audit that recomputes the signal on truncated history and checks it does not change;
- wrong cost assumptions — if your R values were computed with optimistic fees, every statistic downstream inherits the optimism;
- a backtest that never could have been filled at the prices it assumed.
Get the trades right first. Then deflate.
Compute it on your own trades
The implementation we use — PSR, DSR, minimum track record length, the six gates, the cost model and the look-ahead audit — is MIT-licensed Python at github.com/botlabtrade/botlab-oss. There is also a checker that runs in your browser: paste a CSV of closed trades, enter how many variants you tried, and read the six gates with your own numbers. Nothing is uploaded.
More guides
- Do Funding Rate and Open Interest Filters Improve a Crypto Bot?
- Is a Trading Bot Profitable? How to Test One Honestly
- Profit Factor vs Win Rate for Trading Bots
- How Many Trades Does a Backtest Need? A Practical Guide
Check your bot free