The Sharpe ratio
▸ Pretest — guess, even if you don't know
A strategy has annualized return of 20% and annualized volatility of 10%. The risk-free rate is 4%. What's its Sharpe ratio?
The formula
The Sharpe ratio answers one question: how much return does a strategy earn per unit of risk it takes?
The annualized Sharpe ratio — "annualized" means scaled to a per-year figure, so different strategies can be compared:
In words: take the strategy's expected yearly return, subtract the risk-free rate, and divide the result by the yearly standard deviation of the returns.
Symbol by symbol:
- — read "the expected value of r" — the annualized expected return of the strategy.
- — read "r sub f" — the annualized risk-free rate — what cash earns with essentially no risk (typically the 1-year Treasury yield).
- — read "sigma sub r" — the annualized standard deviation of the strategy's returns, also called its volatility — how much the returns swing around their average.
Concrete example (same as the pretest): return 20%, risk-free rate 4%, volatility 10%. Sharpe = (20% − 4%) / 10% = 1.6.
Why subtract ? Because you could have earned that much with zero risk. Only the return above cash — the excess return — is payment for the volatility you endured. So the Sharpe ratio is excess return per unit of volatility. It's unitless (a percentage divided by a percentage), and higher is better — most of the time. Caveats below.
How to compute it from a return series
import numpy as np
def annual_sharpe(daily_returns, rf_annual=0.04, trading_days=252):
rf_daily = rf_annual / trading_days
excess = daily_returns - rf_daily
return (excess.mean() / excess.std(ddof=1)) * np.sqrt(trading_days)
Why multiply by ? There are about 252 trading days in a year, and the two halves of the ratio grow at different speeds as you stretch the time horizon:
- The mean return scales linearly with time: over T days it is T times the daily mean.
- The standard deviation scales with the square root of time: over T days it is √T times the daily value.
- Their ratio — the Sharpe — therefore scales as √T. Going from daily to annual, T = 252, so you multiply by √252 ≈ 15.9.
Benchmarks — what's a good Sharpe?
For long-horizon strategies:
- 0.3–0.5: Buy-and-hold US equity (SPY ~0.4 over the past century).
- 0.5–1.0: Reasonable trend-following or factor strategy.
- 1.0–1.5: Strong systematic strategy.
- 1.5–2.0: Exceptional — be skeptical, audit the backtest carefully.
- >2.0: Almost always a backtest bug, look-ahead bias — accidentally letting the simulation peek at future data — transaction costs ignored, or a very specific high-frequency strategy.
For shorter horizons (daily reallocation, intraday), Sharpe can be higher. High turnover — how often the strategy trades — lets it compound smaller edges more often. But after honest cost modeling, even those rarely sustain above ~3 in production.
Renaissance Technologies' Medallion Fund allegedly runs Sharpe ~7+. They are a unique outlier; do not benchmark yourself against them.
The standard error of an estimated Sharpe (this is huge)
You never observe a strategy's true Sharpe. You estimate it from a limited stretch of history, and that estimate is noisy. Statisticians measure this noise with the standard error (SE) — the typical distance between an estimate and the true value it's aiming at.
Two new pieces of notation here:
- A "hat" over a symbol, as in (read "S-R hat"), marks an estimate computed from data, as opposed to the unknown true quantity.
- The symbol reads "is approximately equal to."
Lo (2002) derived the approximate standard error for an iid normal return series — "iid" means independent and identically distributed: each period's return is a fresh, unrelated draw from the same distribution. For observations, stated in per-period units:
In words: take 1, add half of the squared per-period Sharpe estimate, divide by the number of observations, then take the square root. That's roughly how far your measured Sharpe typically sits from the truth.
Units matter here. The Sharpe in this formula is the per-period (e.g., daily) Sharpe, and is the number of those periods. To get the SE of the annualized Sharpe, compute in daily units first, then multiply by .
Worked example — annual Sharpe = 1.0, five years of daily data ():
- Daily Sharpe: .
- Per-period SE: .
- Annualized SE: .
Now turn that SE into a 95% confidence interval (CI) — a range built as the estimate plus or minus about two standard errors. If you repeated the whole experiment many times, the range would contain the true value about 95% of the time. The symbol reads "plus or minus."
So with 5 years of data, a strategy with measured annual Sharpe = 1.0 has a 95% confidence interval of roughly . Read that interval aloud: the true Sharpe could plausibly be anywhere from 0.1 to 1.9. You barely have evidence that it's positive at all. With 10 years, the interval tightens roughly to [0.4, 1.6]. With 30 years, [0.6, 1.4].
A convenient shortcut for modest Sharpe values: the annualized SE is approximately . That's the same formula, but with counted in years and the annual Sharpe plugged in directly. For 5 years of a Sharpe-1 strategy: SE ≈ . Close to the exact 0.45; the shortcut is slightly conservative.
This is why short backtests can't validate a strategy. A 2-year backtest showing Sharpe of 1.0 is consistent with a true Sharpe of zero (i.e., no edge).
Sharpe's failure modes
-
Assumes returns are roughly normal. Some strategies earn small, steady premia — regular little payments — while occasionally suffering a catastrophic loss. Selling cheap out-of-the-money options (insurance-like bets that rarely pay out) is the classic example. Such a strategy shows a high Sharpe right up until the blowup. Sharpe doesn't see the fat tail — the higher-than-normal chance of an extreme loss. This is the single most important caveat.
-
Compares strategies with different timescales unfairly. A high-frequency strategy with 10× the number of independent trades naturally has a √10 ≈ 3.2× higher Sharpe than a daily strategy with the same per-trade edge.
-
Ignores higher moments. Skewness — the lopsidedness of the return distribution — and kurtosis — how heavy its tails are — don't enter the formula at all. Two alternative ratios partially correct for this: Sortino (its denominator counts only downside deviation, the volatility of losing periods) and Calmar (its denominator is the max drawdown — the worst peak-to-trough loss).
-
In-sample optimism bias. If a backtest Sharpe was selected as the best of many candidates — parameter tuning, strategy search — it is biased upward. The deflated Sharpe ratio (López de Prado 2018) corrects for this. We'll see it later in D4 (backtest methodology).
Try it
Implement the Sharpe computation from the code sketch above, from memory if you can:
Implement sharpe(daily_returns, rf_annual): convert the annual risk-free rate to daily (rf_annual / 252), subtract it from the daily returns to get excess returns, then return excess.mean() / excess.std(ddof=1) * sqrt(252).
Predict and pace yourself
Before the next lesson:
- If you compute Sharpe on a 5-year backtest and get 1.5, what's a rough 95% confidence interval?
- If you tested 100 random strategies on the same data and reported only the best, would its Sharpe be a reliable estimate of its true Sharpe?
⧉ Review cardWhat is the Sharpe ratio formula?
⧉ Review cardWhat's a typical Sharpe for buy-and-hold SPY?
⧉ Review cardWhat is the approximate SE of an annualized Sharpe estimate, and what CI does 5 years of data give a Sharpe-1 strategy?
⧉ Review cardWhat's Sharpe's biggest blind spot?
◈ Calibration check
Could you compute a Sharpe ratio from a return series, and explain its standard error?
1 = guessing · 5 = could teach it
⏻ End of lesson
Mark it read to book its 4 review cards into your deck.