Quant Terminal
A2-04A2·intro·~17 min

The Sharpe ratio

statisticssharpe-ratiorisk-adjusted-returns

▸ 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:

Sharpe=E[r]rfσr\text{Sharpe} = \frac{E[r] - r_f}{\sigma_r}

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:

Concrete example (same as the pretest): return 20%, risk-free rate 4%, volatility 10%. Sharpe = (20% − 4%) / 10% = 1.6.

Why subtract rfr_f? 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 252\sqrt{252}? 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:

Benchmarks — what's a good Sharpe?

For long-horizon strategies:

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:

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 NN observations, stated in per-period units:

SE(SR^per-period)1+12SR^per-period2N\text{SE}(\widehat{\text{SR}}_\text{per-period}) \approx \sqrt{\frac{1 + \tfrac{1}{2}\widehat{\text{SR}}_\text{per-period}^2}{N}}

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 NN is the number of those periods. To get the SE of the annualized Sharpe, compute in daily units first, then multiply by 252\sqrt{252}.

Worked example — annual Sharpe = 1.0, five years of daily data (N=1260N = 1260):

  1. Daily Sharpe: SRd=1.0/2520.063\text{SR}_d = 1.0 / \sqrt{252} \approx 0.063.
  2. Per-period SE: (1+12(0.063)2)/12600.028\sqrt{(1 + \tfrac{1}{2}(0.063)^2)/1260} \approx 0.028.
  3. Annualized SE: 0.0282520.450.028 \cdot \sqrt{252} \approx 0.45.

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 ±\pm 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 1.0±20.45=[0.1,1.9]1.0 \pm 2 \cdot 0.45 = [0.1, 1.9]. 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 (1+12SRannual2)/years\sqrt{(1 + \tfrac{1}{2}\text{SR}_\text{annual}^2) / \text{years}}. That's the same formula, but with NN counted in years and the annual Sharpe plugged in directly. For 5 years of a Sharpe-1 strategy: SE ≈ 1.5/50.55\sqrt{1.5/5} \approx 0.55. 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

  1. 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.

  2. 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.

  3. 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).

  4. 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:

▮ EXERCISE · a2-04-ex1

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:

⧉ Review card
What is the Sharpe ratio formula?
(E[r] − r_f) / σ_r. Annualized excess return divided by annualized volatility. Unitless.
⧉ Review card
What's a typical Sharpe for buy-and-hold SPY?
~0.4 over long history. Anything above ~1 is impressive sustained; above ~2 is exceptional and warrants serious audit of the backtest.
⧉ Review card
What is the approximate SE of an annualized Sharpe estimate, and what CI does 5 years of data give a Sharpe-1 strategy?
Lo (2002), in per-period units: SE ≈ √((1 + SR²/2)/N), then × √252 to annualize. Shortcut: ≈ √((1 + SR²/2)/years). For 5 years and annual Sharpe 1: SE ≈ 0.45–0.55, so the 95% CI is roughly [0.1, 1.9] — barely distinguishable from zero.
⧉ Review card
What's Sharpe's biggest blind spot?
It assumes returns are roughly symmetric. Strategies with rare catastrophic losses (e.g., short vol, selling tail options) look great by Sharpe right up until they blow up. Use Sortino, max drawdown, and stress testing alongside.

◈ 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.

Sources & further reading