The effective number of trials is smaller than the raw count when nearby strategies make similar trades. Preserve the full research log, including discarded signals and settings. Ten nearly identical parameter choices and ten unrelated strategies generate different opportunities for a chance winner.
Build a benchmark for the winner of the search
with Euler's constant . For one trial under a zero-Sharpe null, use . With observed Sharpe , return observations, sample skewness and raw kurtosis , compute
The shape correction changes the uncertainty estimate for Sharpe. Strong serial dependence and overlapping observations call for a different inference treatment or additional dependence-aware checks.
There are two sources of uncertainty here. The variation across trials helps determine how high the winning estimate could be by selection alone. The sampling uncertainty of the winning strategy determines how convincingly its Sharpe clears that threshold. The first enters the benchmark and the second enters the probabilistic Sharpe calculation. Use daily units for both in this example. Annualising the winner without also changing the benchmark and inference formula gives a comparison with incompatible scales.
The maximum grows with the number of effectively independent draws, but returns from neighbouring parameter variants are often closely related. Fifty thresholds applied to the same signals are a different search from fifty unrelated strategies. A sensitivity calculation can report the deflated probability under several plausible effective trial counts. That makes the dependence assumption visible instead of burying it in a precise-looking answer. The statistic still assesses evidence from the observed search. It does not undo leakage or make a final test independent if that test was used repeatedly.
Calculate the penalty on a daily Sharpe
Suppose you select a daily Sharpe of 0.10 from 50 effectively independent trials whose daily Sharpe estimates have standard deviation 0.03. With 756 returns, skewness −0.5 and raw kurtosis 4, the approximate selection threshold is 0.068 in daily units. The adjusted score is about 0.80. The same formula with a zero benchmark yields a score above 0.99. The search history materially changes the evidence even though the reported strategy returns stay the same.
Compute the benchmark and probability
from math import e, sqrt
from scipy.stats import norm
def deflated_sharpe(sharpe, count, skew, raw_kurtosis, trials, trial_sd):
gamma = 0.5772156649015329
benchmark = 0.0
if trials > 1:
benchmark = trial_sd * (
(1 - gamma) * norm.isf(1 / trials)
+ gamma * norm.isf(1 / (trials * e))
)
denominator = sqrt(1 - skew * sharpe + (raw_kurtosis - 1) * sharpe**2 / 4)
return benchmark, norm.cdf((sharpe - benchmark) * sqrt(count - 1) / denominator)
print(deflated_sharpe(0.10, 756, -0.5, 4.0, 50, 0.03))References and next steps
- Bailey and López de Prado, The Deflated Sharpe Ratio derives both the multiple-testing benchmark and the non-normality adjustment.