Lesson 10 of 15
Recovery Time
Recovery Time
Recovery time measures how many periods it takes to climb back to the pre-drawdown peak after the maximum drawdown trough. It is an important complement to max drawdown: a deep but quick recovery is very different from a shallow but prolonged one.
Algorithm
- Compute drawdowns to find the maximum drawdown value
- Find the trough index (where the max drawdown occurs)
- Before the trough, find the peak index (the last point achieving that high-water mark)
- Scan forward from the trough to find the first index where
equity >= peak_value - Recovery time = that index − peak index
- If never recovered, return −1
Example
Equity: [100, 110, 105, 95, 100, 108, 115]
- Peak = 110 at index 1
- Trough = 95 at index 3
- Recovery: index 6 (value 115 ≥ 110)
- Recovery time = 6 − 1 = 5
Equity: [100, 120, 100, 80, 90, 110]
- Peak = 120 at index 1; never recovers → −1
Python runtime loading...
Loading...
Click "Run" to execute your code.