RollingMaxDrawdown Node
Rolling peak-to-trough decline measurement
Overview
Rolling Maximum Drawdown measures the largest peak-to-trough decline within rolling windows. Unlike total maximum drawdown (single number), rolling MDD shows how severely the strategy declined in each period. Rising rolling MDD warns of approaching drawdown climax. Widening MDD indicates strategy stress.
Traders care about drawdown more than volatility: -30% drawdown is devastation; +10% volatility is acceptable. Rolling MDD answers: "In each recent quarter, how bad did it get?" High rolling MDD needs wider stops and position sizing adjustment.
Formula & Calculation
Trough = Low point after peak
Result is negative (e.g., -25%)
Rolling window (quarterly or annual)
Track over time to detect trends
Parameters
| Parameter | Default | Description |
|---|---|---|
| lookback | 252 | Rolling window (annual typical) |
| percent | True | Return as percentage |
Common Use Cases
1. Risk Monitoring
Rising rolling MDD = strategy stress increasing. If rolling MDD > 20%, escalate risk management (reduce leverage, tighten stops).
2. Position Sizing
Position size = 1 / (1 + |Rolling_MDD|). If rolling MDD = -15%, size down 15%. If rolling MDD = 0%, full size.
3. Strategy Switching
Rolling MDD spike = switch to defensive strategy. Use rolling MDD as regime loss indicator (when strategy hurts most).
4. Stop Loss Setting
Stops = 1.5 × Rolling_MDD. If rolling MDD = 10%, set stops wider at 15% (avoid whipsaws in volatile periods).
Advantages & Limitations
Advantages
- Measures worst-case scenario
- Directly interpretable
- Guides position sizing
- Intuitive risk metric
Limitations
- Only backward looking
- Doesn't predict future DD
- Window dependent
- One extreme value drives metric