Lesson 9 of 15
Drawdown Analysis
Drawdown Analysis
A drawdown measures the decline from a historical peak to the current value of an equity curve. It quantifies ongoing losses from the high-water mark.
Drawdown Formula
For each time step t:
peak_t = max(equity_curve[:t+1])
drawdown_t = (equity_t - peak_t) / peak_t
Drawdowns are always ≤ 0 (or 0 when at a new peak).
Maximum Drawdown
max_drawdown = min(drawdowns)
This is the single largest peak-to-trough decline over the entire history — a key metric for strategy risk.
Example
Equity curve: [100, 110, 105, 95, 100, 108, 115]
| t | Value | Peak | Drawdown |
|---|---|---|---|
| 0 | 100 | 100 | 0.0 |
| 1 | 110 | 110 | 0.0 |
| 2 | 105 | 110 | −0.0455 |
| 3 | 95 | 110 | −0.1364 |
| 4 | 100 | 110 | −0.0909 |
| 5 | 108 | 110 | −0.0182 |
| 6 | 115 | 115 | 0.0 |
Max drawdown = −0.1364
Python runtime loading...
Loading...
Click "Run" to execute your code.