Trading Dev AcademyFree quant education

Free lesson · Risk

Value at Risk and maximum drawdown: two views of the bad days

Open interactive lessonPractice calculationsExplore labs

Start with the idea

VaR locates a loss threshold at a chosen confidence and horizon. Drawdown tracks the path below a previous wealth peak. Neither is a maximum possible loss, and they answer different questions about survival.

Symbols, units & horizon
  • F: cumulative distribution function of P&L, where negative values are losses
  • F⁻¹: quantile, not reciprocal
  • α: confidence probability, e.g. .95
  • μ, σ: P&L mean and SD at the same horizon
  • VaR: negative lower-tail P&L quantile, may be negative for an all-gain distribution
  • Eₜ: equity at t, not expectation here
  • maxₛ≤ₜ: highest equity observed up to t
  • DDₜ: fractional drawdown
  • MDD: largest drawdown over the path

When and why to use this

Use VaR for comparable horizon risk summaries, drawdown for path-sensitive limits, and tail measures or scenarios for losses beyond a quantile.

Value at Risk is a quantile of the P&L distribution. "95% one-day VaR of $5,000" means: on 95% of days you will not lose more than $5,000. It says nothing about the other 5% — those days can be much worse, and VaR's silence about them is its most criticised feature.

VaRα=−F−1(1−α),parametric: VaR95%≈1.645σ−μ
Quantile transformation + table lookup

Convert a P&L quantile into normal VaR

  1. For normal P&L X=μ+σZ, its lower quantile is FX−1(1−α)=μ+σΦ−1(1−α).
  2. Negate it and use normal symmetry: VaRα=σΦ−1(α)−μ. Quantiles come from a normal table or inverse-CDF calculation, not elementary algebra.
Work it by hand

μ=$100 and σ=$3,000: 95% VaR≈1.645×3000−100=$4,835.

Three ways to compute it: parametric (assume normal, use 1.645σ), historical (sort your actual daily P&Ls, take the 5th percentile), Monte Carlo (simulate). Historical methods preserve observed tail events but cannot reveal unseen ones; normal parametric methods impose thin tails. Expected Shortfall (the average loss given you are past VaR) fixes the blind spot and is useful for examining tail severity.

Daily P&L: mean $0, σ = $3,000, assume normal. 99% VaR?

The 1% quantile of a normal is at 2.326σ: 2.326×3000=6,978. Real distributions have fatter tails, so the true 99% VaR is usually larger than this.

Maximum drawdown

Max drawdown is the largest peak-to-trough decline in the equity curve. It is path-dependent, which volatility is not: the same set of daily returns in a different order gives a different drawdown. Traders feel drawdown directly — it is the number that makes people quit — which is why it is often more useful than σ for deciding size.

DDt=maxs≤t⁡Es−Etmaxs≤t⁡Es,MDD=maxt⁡DDt
Algebra and arithmetic

Calculate peak-relative drawdown

  1. At each date update Ht=max⁡(Ht−1,Et), starting with initial capital. The loss from the peak is Hₜ−Eₜ.
  2. Divide by positive Hₜ for percentage drawdown; retain the largest value to obtain MDD.
Work it by hand

Equity 100,110,99,105 has peaks 100,110,110,110 and drawdowns 0,0,10%,4.545%. MDD=10%.

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 NormalDist

def normal_var(mean_pnl, sd_pnl, confidence=.95):
    if sd_pnl < 0 or not 0 < confidence < 1:
        raise ValueError("Require SD >= 0 and confidence in (0,1)")
    return sd_pnl*NormalDist().inv_cdf(confidence)-mean_pnl

def drawdowns(equity):
    peak = equity[0]
    if peak <= 0:
        raise ValueError("Positive starting equity required")
    result = []
    for value in equity:
        peak = max(peak, value)
        result.append((peak-value)/peak)
    return result, max(result)

print(normal_var(0, 1000), drawdowns([100,130,120,140]))

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