σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Statistics skill›Module 4 · Validation and overfitting›Topic 4.2·~1 hrAdvanced

The deflated Sharpe ratio and backtest overfitting

Skill positionModule 4 of 4 · Topic 2 of 3
4.2 The deflated Sharpe ratio and backtest overfitting
—Lab score— / 100Total XP—Streak—

A great Sharpe ratio, found among hundreds

The Sharpe ratio is the mean excess return divided by its standard deviation. From daily data it is annualised by 252\sqrt{252}252​: a daily mean of 0.05% and daily volatility of 1% give a daily ratio of 0.05 and an annual ratio of 0.05252≈0.790.05\sqrt{252}\approx0.790.05252​≈0.79. Like any estimate it has a standard error, roughly (1+SR2/2)/T\sqrt{(1+\mathrm{SR}^2/2)/T}(1+SR2/2)/T​ for TTT years of data: even a true Sharpe of 0.8 measured over four years is only known to about ±0.57\pm0.57±0.57, so two strategies with Sharpe 0.8 and 0.3 are statistically hard to tell apart.

E[max⁡i≤NSR^i]≈σSR2ln⁡N,SR^defl=SR^best−E[max⁡]\mathbb{E}\big[\max_{i\le N}\widehat{\mathrm{SR}}_i\big]\approx\sigma_{\mathrm{SR}}\sqrt{2\ln N},\qquad \widehat{\mathrm{SR}}_{\mathrm{defl}}=\widehat{\mathrm{SR}}_{\mathrm{best}}-\mathbb{E}\big[\max\big]E[i≤Nmax​SRi​]≈σSR​2lnN​,SRdefl​=SRbest​−E[max](1)

Now try NNN strategies. Even if every one has zero true Sharpe, the estimates scatter around zero with spread σSR\sigma_{\mathrm{SR}}σSR​, and the best of them is positive and grows with NNN, roughly σSR2ln⁡N\sigma_{\mathrm{SR}}\sqrt{2\ln N}σSR​2lnN​. With a spread of 0.5 and 100 trials, the best is expected near 0.52ln⁡100≈1.520.5\sqrt{2\ln100}\approx1.520.52ln100​≈1.52 from luck alone. This is backtest overfitting. The deflated Sharpe ratio (Bailey and López de Prado) corrects the observed best Sharpe for the number of trials, the skewness and kurtosis of returns and the sample length. In this topic's simplified form: subtract the expected best-of-NNN noise before believing the number.

Sharpe numbersDaily mean 0.05% and daily volatility 1%: SR=0.05252≈0.794\mathrm{SR}=0.05\sqrt{252}\approx0.794SR=0.05252​≈0.794. With SR=0.8\mathrm{SR}=0.8SR=0.8 over T=4T=4T=4 years, SE≈(1+0.32)/4≈0.574\mathrm{SE}\approx\sqrt{(1+0.32)/4}\approx0.574SE≈(1+0.32)/4​≈0.574. Among 100 strategies with noise spread 0.50.50.5, the expected best is 0.52ln⁡100≈1.5170.5\sqrt{2\ln100}\approx1.5170.52ln100​≈1.517. If your best backtest shows SR=1.5\mathrm{SR}=1.5SR=1.5, the deflated value is about 1.5−1.0=0.51.5-1.0=0.51.5−1.0=0.5 when the expected best-of-NNN noise is 1.01.01.0: half of the headline number is explained by luck.
  • Sharpe ratio: mean excess return over volatility; annualise daily data by 252\sqrt{252}252​.
  • Best of NNN: noise alone gives a best Sharpe near σSR2ln⁡N\sigma_{\mathrm{SR}}\sqrt{2\ln N}σSR​2lnN​.
  • Defences: record every trial, keep a final holdout, prefer simple ideas with a reason, deflate the winner.
A backtest is a hypothesis, not a resultThe only clean test of a strategy is data that played no part in choosing it: a final holdout you look at once, or live trading. Everything else, however carefully cross-validated, has been looked at repeatedly by someone choosing among ideas. State how many ideas were tried, adjust for it, and be suspicious of any Sharpe above 2 on daily equity data with a short history.

Lab · what's graded

  • An annualised Sharpe ratio15 pts
  • The standard error of a Sharpe ratio15 pts
  • The best of many from noise15 pts
  • What to do with the winner15 pts
  • Defences against overfitting10 pts
  • A deflated Sharpe ratio15 pts
  • Why the best backtest may be luck15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

Daily excess returns have mean 0.05% and standard deviation 1%. What is the annualised Sharpe ratio (multiply the daily ratio by the square root of 252)? Give it to three decimals.

SR=SR =SR=accepted: ± 0.005
2Numeric answer15 ptsNot answered

A strategy has an annual Sharpe ratio of 0.8 measured over T = 4 years. Use SE = sqrt((1 + SR^2/2)/T). Give it to three decimals.

SE=SE =SE=accepted: ± 0.005
3Numeric answer15 ptsNot answered

You test N = 100 strategies with no real skill and a noise spread of 0.5 in the Sharpe estimates. Use E[max] = 0.5 * sqrt(2 ln N). Give the expected best Sharpe to three decimals.

E[max⁡]=\mathbb{E}[\max] =E[max]=accepted: ± 0.01
4Choice15 ptsNot answered

The best of 200 backtested strategies has an annual Sharpe of 1.0 over five years. What is the right response?

5Choice10 ptsNot answered

Select every good defence against backtest overfitting.

6Numeric answer15 ptsNot answered

Your best backtest shows a Sharpe ratio of 1.5, and the expected best Sharpe from pure noise with that many trials is 1.0. What is the deflated Sharpe ratio, observed minus expected?

SRd=SR_d =SRd​=accepted: ± 0.001
7Explain in words15 ptsNot answered

In two sentences, explain why the best Sharpe ratio among many tested strategies is inflated.

Math modeKeyboard or LaTeX inputTask 1 of 7 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub