Trading Dev AcademyFree quant education

Free lesson · Risk

Sharpe ratio: return per unit of risk

Open interactive lessonPractice calculationsExplore labs

Start with the idea

Sharpe measures average excess return relative to return variability. It is sensitive to horizon, financing conventions, serial correlation and rare losses. A smooth path from stale pricing can create a deceptively high ratio.

Symbols, units & horizon
  • R_p: portfolio return per observation period
  • R_f: matching risk-free return
  • σ_p: SD of excess returns, using a constant risk-free rate in the displayed identity
  • E: expected return, estimated with sample mean
  • A or 252: assumed observations per year
  • Sharpe: mean excess return divided by its SD
  • √A: IID square-root annualisation approximation

When and why to use this

Use Sharpe to compare risk-adjusted histories only after aligning currency, frequency, financing and costs. Pair it with drawdown, tail risk and confidence intervals.

Sharpe=𝔼[Rp]−Rfσp,annualised=Sharpedaily×252
Algebra and arithmetic

Derive square-root annualisation

  1. For IID periodic excess return with mean m and SD s, an A-period sum has mean Am and variance As². The ratio is Am(sA)=A(ms).
  2. This concerns additive excess returns; annual compounded returns and serial dependence require additional care. Using n IID normal observations, an asymptotic annualised SE is An+Sann2(2n).
Work it by hand

Daily excess mean=.0005, SD=.008: daily ratio=.0625 and annual approximation=.0625√252=.992. For monthly Sann=.89 and n=36, approximate SE=√(12/36+.89²/72)=.587.

Sharpe is the number that lets you compare a 5%-vol bond strategy with a 40%-vol crypto strategy: Sharpe normalises return by volatility. Equal Sharpe does not imply equivalent liquidity, tail risk, financing or feasible leverage. There is no universal institutional deployment threshold.

Sharpewhat it feels likeyears of data to be confident it is > 0
0.5long, grinding drawdowns; hard to hold≈ 16
1.0roughly a losing year in six≈ 4
2.0losing months, rarely losing quarters≈ 1
3.0+HFT / market making; capacity-limitedmonths

The last column comes from the CLT: the standard error of an annualised Sharpe estimate over T years is roughly An+Sharpe2(2n). Here n is the number of IID approximately normal observations and A is observations per year. With n = AT and modest daily Sharpe, SE is approximately 1/√T. Dependence and selection can materially increase uncertainty.

Mean daily return 0.05%, daily σ 0.8%, risk-free ≈ 0. Annualised Sharpe?

Daily Sharpe =0.00050.008=0.0625; times 252=15.87 gives 0.99.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

from statistics import mean, stdev
from math import sqrt

def sharpe(excess_returns, periods_per_year=252):
    """Supply aligned portfolio minus risk-free returns, all as decimals."""
    sd = stdev(excess_returns)
    if sd == 0:
        raise ValueError("Sharpe undefined for zero sample SD")
    periodic = mean(excess_returns)/sd
    return periodic, periodic*sqrt(periods_per_year)

print(sharpe([.01, -.005, .002, .008]))

Continue learning

Risk Management — all lessons
  1. Start with gains, losses and an ordered sample
  2. Value at Risk and maximum drawdown: two views of the bad days
  3. Sharpe ratio: return per unit of risk
  4. Kelly criterion: the fraction that maximises growth
  5. Monte Carlo: your backtest is one draw from a distribution
  6. Expected shortfall and scenario risk

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations