Deflated Sharpe ratio calculator: is a backtest's Sharpe ratio real?
A backtest with a Sharpe ratio of 1.5 looks impressive until you ask two questions: how long was the sample, and how many variations were tried before this one? This calculator answers both with the probabilistic Sharpe ratio and the deflated Sharpe ratio of David Bailey and Marcos López de Prado. Everything runs in your browser; nothing you type is sent anywhere.
Indicative estimate, not advice. The results are statistical estimates that rest on the assumptions set out under Method, sources and licence. A high deflated Sharpe ratio does not make a strategy profitable in the future, and costs, capacity and regime changes are not modelled.
The calculator
How to read the results
- Probabilistic Sharpe ratio (PSR): the probability that the true Sharpe ratio exceeds the benchmark, given how many returns you have and how far they are from a normal distribution. It treats your backtest as if it were the only one you ever ran.
- Minimum track record length: how many returns, at this Sharpe ratio, skewness and kurtosis, you would need for the PSR to reach the chosen confidence level. If your sample is shorter, the record is too short to tell skill from luck.
- Best Sharpe expected from luck: if you had tested this many strategies that in truth earn nothing, the highest Sharpe ratio you should expect to see among them. It grows with the number of trials and with how much their results differ.
- Deflated Sharpe ratio (DSR): the PSR recomputed with that luck threshold as the benchmark. Bailey and López de Prado read a DSR of 0.95 or more as evidence, at the 5 % level, that the result is not just the best of many tries.
The two inputs in part 2 are the hardest to fill honestly. The number of trials should count every configuration you looked at, not only the ones you kept; when the trials are strongly correlated, for example neighbouring values of the same parameter, the number of truly independent ones is lower and can be estimated by clustering the trials' return series, as López de Prado describes. The spread of their Sharpe ratios can be computed directly from the trials if you logged them, which is a good reason to log them. Our article on building a strategy in the open explains why that record matters.
Worked examples
The table shows how the same headline Sharpe ratio fares as the search widens. All rows use daily returns. Figures computed with the formulas below; they are illustrations, not results of real strategies.
| Annual Sharpe | Years | Skew | Kurtosis | Trials | Spread of trials | PSR | Luck threshold | DSR |
|---|---|---|---|---|---|---|---|---|
| 1.0 | 3 | 0 | 3 | 1 | – | 0.958 | 0 | 0.958 |
| 1.0 | 3 | −1 | 6 | 10 | 0.71 | 0.953 | 1.11 | 0.425 |
| 1.0 | 3 | −1 | 6 | 100 | 0.71 | 0.953 | 1.79 | 0.093 |
| 1.5 | 5 | −0.5 | 5 | 100 | 0.71 | 0.999 | 1.79 | 0.265 |
| 1.5 | 5 | −0.5 | 5 | 1,000 | 0.71 | 0.999 | 2.30 | 0.041 |
| 2.5 | 5 | −3 | 10 | 100 | 0.71 | 1.000 | 1.79 | 0.900 |
The last row is the numerical example of Bailey and López de Prado (2014), with 1,250 daily returns, 250 trading days a year and a variance of 0.5 for the trials' annualised Sharpe ratios; the calculator reproduces their deflated Sharpe ratio of 0.90. A strategy that looks excellent on its own can fall well short once a hundred or a thousand discarded attempts are taken into account.
Method, sources and licence
With SR the Sharpe ratio per period (the annualised figure divided by the square root of the number of periods per year), n the number of returns, γ3 their skewness and γ4 their kurtosis, the calculator uses:
Φ is the standard normal distribution function, zα its quantile at the chosen confidence level, N the number of trials, V the variance of the trials' Sharpe ratios per period (the square of the spread you enter, divided by the periods per year), γ ≈ 0.5772 the Euler–Mascheroni constant and e Euler's number. The standard error is shown annualised. The first three formulas come from Bailey and López de Prado (2012), building on Andrew Lo's work on the statistics of Sharpe ratios; the last two from Bailey and López de Prado (2014). The formulas assume that returns are independent from one period to the next: with autocorrelated returns, Lo (2002) shows that annualising by the square root of time misstates the ratio.
When you paste returns, the calculator subtracts the risk-free rate divided by the number of periods per year, takes the mean over the sample standard deviation as the Sharpe ratio per period, multiplies it by the square root of the periods per year, and computes skewness and kurtosis as standardised third and fourth moments. The normal distribution function and its inverse use standard numerical approximations accurate to about seven significant digits, more than enough at the two decimals shown.
- Bailey, D. H. and López de Prado, M. (2012). The Sharpe Ratio Efficient Frontier. Journal of Risk, 15(2), 3–44.
- Bailey, D. H. and López de Prado, M. (2014). The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality. Journal of Portfolio Management, 40(5), 94–107.
- Lo, A. W. (2002). The Statistics of Sharpe Ratios. Financial Analysts Journal, 58(4), 36–52.
- Bailey, D. H., Borwein, J. M., López de Prado, M. and Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism. Notices of the American Mathematical Society, 61(5), 458–471.
The calculator uses no external data set. Its code is part of this page, published on 13 November 2026 and checked against the numerical example of the 2014 paper on the same date; it may be reused freely. For the wider context, read our pieces on validation in financial machine learning and on combining strategies.
Systematic tradingBuilding a fully automated trading system
Data, signals, risk, orders and monitoring: the parts of an automated trading system and how they fail.
Financial machine learningA laboratory for financial machine learning
Dollar bars, triple-barrier labels, purged cross-validation and feature importance: the pipeline step by step.