diff --git a/pyfolio/timeseries.py b/pyfolio/timeseries.py index 2b34d3b7..c99f1725 100644 --- a/pyfolio/timeseries.py +++ b/pyfolio/timeseries.py @@ -890,7 +890,7 @@ def get_max_drawdown_underwater(underwater): The maximum drawdown's recovery. """ - valley = underwater.idxmin() # end of the period + valley = underwater.index[underwater.values.argmin()] # end of the period # Find first 0 peak = underwater[:valley][underwater[:valley] == 0].index[-1] # Find last 0