The Analyst's Path

Maximum drawdown

Maximum drawdown is the largest percentage fall in an account's value from a peak to the lowest point after it. Neither Sharpe nor Sortino tells you what a client remembers: how far under water the account went, and for how long. Maximum drawdown answers the first question; drawdown duration and recovery time answer the second. Recovery may never happen inside the data you have, which is worth reporting.

3 min readPart of Performance & Attribution Analytics in CodeOpen in course mode

Advertisement

Neither Sharpe nor Sortino tells you the thing a client actually remembers: how far under water did the account go, and how long were they under water for? Maximum drawdown answers the first question; drawdown duration and recovery time answer the second and third.

How is maximum drawdown calculated?

The construction, in three steps, each one a single line of vectorized code once you see it:

  1. Wealth (cumulative growth) index: wealth_t = Π(1 + r_i) for i from the start through t, the value of one unit of currency left invested throughout.
  2. Running maximum: running_max_t = max(wealth_0, ..., wealth_t), the highest the wealth index has ever been, up to and including today.
  3. Drawdown series: drawdown_t = wealth_t / running_max_t - 1, always ≤ 0, and exactly 0 at every new high-water mark.

The maximum drawdown is the most negative value in that series; its index is the trough. The peak is the last index at or before the trough where the drawdown was exactly zero, the high-water mark the trough fell from. Drawdown duration is the distance from peak to trough (how long the fall took); recovery time is the distance from trough to the first later index where the drawdown returns to zero or above (how long it took to get whole again), and it is entirely possible, on real data, for recovery to never happen within the window you are looking at, which is itself a fact worth reporting explicitly rather than silently omitting. Exercise QD2.03-e04 grades max_drawdown_stats(returns), returning all five figures from one function, and its hidden tests include both a series that recovers within the window and one that does not, a solution that assumes recovery always exists (a common, quietly wrong shortcut: "find the next index where wealth exceeds the peak" without checking whether such an index exists at all) fails immediately.

Advertisement

How does drawdown help catch a too-good Sharpe ratio?

A single number worth carrying: a strategy showing a Sharpe ratio above roughly 3 on daily data with a real cost model is a bug report until proven otherwise, this is QD1.03's own diagnostic instinct (its look-ahead-bias worked example produces exactly this pattern, a 7.77 Sharpe with a 4.5% maximum drawdown, and names it implausible on sight). Drawdown is frequently the fastest way to catch that kind of number before you ever reach for a p-value: a Sharpe that spectacular should come with a drawdown large enough to look like a real market, and when it does not, look for the leak before you look for the trophy case.

Advertisement

Part of the course

This page is part of Performance & Attribution Analytics in Code (QD2.03), in Phase 12: Finance Plus, AI and the quant-code track. The module's flashcards and its quiz are in the app.