max_drawdown¶
-
max_drawdown
(x, w=Window(w=None, r=0))[source]¶ Compute the maximum peak to trough drawdown over a rolling window.
- Parameters
x (
Series
) – time seriesw (
Union
[Window
,int
]) – Window or int: size of window and ramp up to use. e.g. Window(22, 10) where 22 is the window size and 10 the ramp up value. Window size defaults to length of series.
- Return type
Series
- Returns
time series of rolling maximum drawdown
Examples
Compute the maximum peak to trough drawdown
>>> series = generate_series(100) >>> max_drawdown(series)
See also