Measure this visit?
Accept allows Google Analytics, Microsoft Clarity and PostHog, including session recording. Reject stops their recording. Cookieless counts and server request logs stay on. What we measure
Tool
Test enough variants of a strategy and one of them will look good by chance. Enter the Sharpe ratio of the one you picked and how many you tried. You get the deflated Sharpe ratio, the bar luck alone is expected to reach, and how many years of data that many variants need.
Updated
The address bar keeps your numbers, so you can bookmark a backtest or send it to a colleague. "Copy link to these numbers" copies that address. The calculator runs in your browser and makes no request of its own. If you accepted analytics, the page address, with your numbers in it, is recorded like any other page view.
They are the worked example in the paper that defined the deflated Sharpe ratio. A strategist tries 100 variants of a trading idea on five years of daily data, 1,250 returns. The best one has an annualised Sharpe ratio of 2.5. The variance of the 100 Sharpe ratios is 0.5, the returns have a skewness of -3 and a kurtosis of 10.
The calculator gives a deflated Sharpe ratio of 90.0%. The paper's investor turns the strategy down, because "there is only a 90% chance that the true SR associated with this strategy is greater than zero". Change the variants to 46 and the result is 95.1%, the paper's own figure. With Normal returns, skewness 0 and kurtosis 3, the result stays above 95% up to 88 variants.
If every variant had no skill, the best of N of them would still show a Sharpe ratio above zero. Equation 1 of Bailey and López de Prado (2014), in The Journal of Portfolio Management 40(5), gives its expected size. It grows with the number of variants and with how far apart their results were. That value is the threshold, SR0.
Equation 2 of the same paper. It is the probability that the true Sharpe ratio beats SR0, given the length of the backtest and the skewness and kurtosis of its returns. Fat tails and a long left tail widen the error on a Sharpe ratio, so they lower the result. The formula works per return, so the calculator divides the annual figures by the square root of the returns per year.
Theorem 2 of Bailey, Borwein, López de Prado and Zhu (2014), in the Notices of the American Mathematical Society 61(5). It gives the years of data needed before N skill-less variants stop reaching a given Sharpe ratio by chance. The paper's example, for a Sharpe ratio of 1: with five years of data, "no more than forty-five independent model configurations should be tried".
We test the code against all four figures above.
scipy.stats.kurtosis and pandas' kurt() return excess kurtosis, which is that minus 3, so add 3 back.It assumes the backtest itself is honest. A strategy that reads tomorrow's price, fills at prices nobody offered or skips fees will pass this test and still lose money. The deflated Sharpe ratio corrects for the search. It can't see those faults.
It does not forecast returns. A result above 95% says the Sharpe ratio is unlikely to be pure selection luck, under the papers' assumptions. Markets change, and a real edge can still fade.
If you want someone to check the parts this calculator assumes, that is ourbacktest audit.