Back to Docs
T
Traderoid

RollingMaxDrawdown Node

Rolling peak-to-trough decline measurement

StatisticalDrawdownRisk

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

Drawdown Calculation
DD(t) = (Trough(t) - Peak(t)) / Peak(t)
Peak = High point before decline
Trough = Low point after peak
Result is negative (e.g., -25%)
Rolling Max Drawdown
MDD(window) = Min(All DD in window)
Largest decline per period
Rolling window (quarterly or annual)
Track over time to detect trends

Parameters

ParameterDefaultDescription
lookback252Rolling window (annual typical)
percentTrueReturn 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

Related Nodes