Sub topic 3
Drawdowns and why losses are harder to recover than they look
This chapter assumes you can read basic Python, work with percentages, and have already met standard deviation as a measure of volatility. It builds on that to look at a different question: how far an asset falls from its high, and what it takes to climb back. This is educational material and not financial advice.
What a drawdown is
A drawdown is the percentage decline from a previous peak to a later low. It answers a question that volatility does not: "How much money would I have lost if I had bought at the worst moment and held?"
Standard deviation treats up moves and down moves symmetrically. It also says nothing about the order of returns. A drawdown is path-dependent and only looks at falls. This is the number most holders feel emotionally.
Three terms are worth fixing:
- Peak: the highest price seen so far.
- Trough: the lowest price reached after that peak, before a new peak.
- Maximum drawdown: the largest peak-to-trough decline in the period you examine.
The formula for the drawdown on any day is:
drawdown = price / running_peak - 1The result is zero at a new high and negative otherwise. A reading of -0.25 means the price is 25% below its highest close so far.
Computing maximum drawdown
The loop below keeps a running peak and records the worst drawdown it sees.
prices = [100, 104, 98, 110, 105, 120, 90]
peak = prices[0]
max_drawdown = 0.0
for price in prices:
peak = max(peak, price)
drawdown = price / peak - 1
max_drawdown = min(max_drawdown, drawdown)
print(f"Maximum drawdown: {max_drawdown:.2%}")This prints Maximum drawdown: -25.00%. The price peaked at 120 and then fell to 90, and 90 / 120 - 1 = -0.25. The smaller dips (104 to 98, and 110 to 105) were real but never the worst.
Drawdown duration and recovery time
Depth is only half the story. Time spent below the old peak, sometimes called time under water, matters just as much. A 25% drawdown that recovers in a week is a different experience from one that lasts two years.
The next version reports the peak, the trough and the recovery point, and it handles the case where the price never recovers.
prices = [100, 104, 98, 110, 105, 120, 90, 95, 125]
def max_drawdown_report(prices):
peak_value = prices[0]
peak_index = 0
worst = 0.0
worst_peak_index = 0
worst_trough_index = 0
for i, price in enumerate(prices):
if price > peak_value:
peak_value, peak_index = price, i
drawdown = price / peak_value - 1
if drawdown < worst:
worst = drawdown
worst_peak_index = peak_index
worst_trough_index = i
recovery_index = None
target = prices[worst_peak_index]
for i in range(worst_trough_index + 1, len(prices)):
if prices[i] >= target:
recovery_index = i
break
return worst, worst_peak_index, worst_trough_index, recovery_index
worst, p, t, r = max_drawdown_report(prices)
print(f"Max drawdown: {worst:.2%}")
print(f"Peak at day {p}, trough at day {t}")
print(f"Recovered at day {r}" if r is not None else "Not recovered yet")The output is a -25.00% drawdown with the peak on day 5, the trough on day 6 and recovery on day 8. Day 7 closed at 95, which is still below the old peak of 120, so the holder was under water for two more days after the trough.
The asymmetry of recovery
Losses and gains are measured against different starting points. After a loss, your base is smaller, so the same percentage gain produces fewer currency units.
The break-even gain after a loss L (as a fraction) is 1 / (1 - L) - 1.
for loss in [0.10, 0.25, 0.50, 0.80]:
gain_needed = 1 / (1 - loss) - 1
print(f"After a {loss:.0%} loss you need a {gain_needed:.0%} gain to break even")| Loss | Gain needed to break even |
|---|---|
| 10% | 11% |
| 25% | 33% |
| 50% | 100% |
| 80% | 400% |
The curve is gentle at first and then bends sharply upward.
Below about 20% the asymmetry is small. Beyond 50% it dominates. This is why avoiding deep losses matters more than capturing every gain.
The same effect inside average returns
The asymmetry also explains why average returns mislead. Suppose an asset gains 50% one month and loses 50% the next. The arithmetic average is 0%, but the result is not break-even:
value = 1000
value *= 1.50
value *= 0.50
print(value)This prints 750.0. You are down 25% despite an "average" return of zero. Higher volatility drags down the compound growth rate even when the average return stays the same. Crypto, with large swings in both directions, is especially exposed to this effect.
Crypto drawdowns in practice
Large drawdowns are routine in crypto, not rare. Bitcoin has fallen roughly 80% from its late-2017 high to its late-2018 low, and roughly 75% from its late-2021 high to its late-2022 low. Recovering the 2017 peak took about three years. Smaller tokens have often fallen further, and many never recovered at all.
Keep these points in mind when reading drawdown figures:
- They depend on the window. A drawdown over the last 90 days says little about the last decade. Always state the period.
- They depend on data frequency. Daily closes hide intraday lows. A token can drop 40% in an hour and close the day down 15%, and a daily series records only the 15%.
- They depend on the denomination. A coin can hold its value in USD while falling sharply against Bitcoin, or the reverse. Compute drawdown in the unit you actually care about.
- They are backward-looking. The worst drawdown in your data is a lower bound on risk, not an upper bound. The next one can be deeper.
- Survivorship bias hides the worst cases. Datasets of tokens that still exist leave out those that went to zero. A drawdown of -100% has no recovery.
Common errors
- Using the entry price as the peak. Drawdown is measured from the highest value reached, which may be above what you paid. If you bought at 100 and the price rose to 150 before falling to 100, you broke even but were in a 33% drawdown.
- Averaging percentages. Two drawdowns of -20% and -30% do not combine to -25%. Multiply the growth factors: 0.8 × 0.7 = 0.56, a 44% loss.
- Mixing log and simple returns. Log returns add across time, but a drawdown is defined on price levels. Compute drawdown from prices, or convert cumulative log returns back with
expfirst. - Ignoring fees and slippage. Selling into a deep drawdown often costs more than a price chart suggests, especially in thin markets.
- Assuming recovery. The asymmetry table tells you what a recovery would require. It does not say recovery will happen.
Connecting drawdown to decisions
Drawdown gives a practical stress test. Ask: "If this asset fell 60% from here, would I still be able to hold, or would I be forced to sell?" Forced selling happens through leverage liquidations, rent or tax bills, or panic. A drawdown you can sit through is a market event. One that forces a sale locks in the loss.
This is the bridge to position sizing later in the tutorial. If you assume a plausible drawdown of 60% and can tolerate losing 1,000, the largest position is 1,000 / 0.60, about 1,667. The method relies on the drawdown estimate, so a poor estimate gives a poor limit.
Exercise
A token peaked at 8.00, fell to 2.00, and is now at 3.00. (a) What is its current drawdown from the peak? (b) What percentage gain from the current price is needed to return to the peak? (c) Why is the answer to (b) larger than the answer to (a)?
Show answer
(a) 3.00 / 8.00 - 1 = -62.5%. (b) 8.00 / 3.00 - 1 = 166.7%, so the price must rise by about 167%. (c) The loss is measured against the larger peak price, while the gain is measured against the smaller current price. Because the base is smaller, a larger percentage move is needed to cover the same absolute distance.
Exercise
Using the maxdrawdownreport function, what would it return for prices = [50, 60, 45, 70, 35, 40]? Does the price ever recover from the worst drawdown?
Show answer
The running peak reaches 60, then the price falls to 45 (-25%). The peak then rises to 70, and the price falls to 35 (-50%). The worst drawdown is -50.00%, with the peak at day 3, the trough at day 4 and no recovery (None), because 40 on day 5 is still below 70. The function reports "Not recovered yet".