Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added index for valley in drawdown #681

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
added index for valley in drawdown
thlautenschlaeger authored Sep 23, 2021
commit 92de3ded1bd3aa90febf5a257a141256bd2fbc83
1 change: 1 addition & 0 deletions pyfolio/timeseries.py
Original file line number Diff line number Diff line change
@@ -898,6 +898,7 @@ def get_max_drawdown_underwater(underwater):
recovery = underwater[valley:][underwater[valley:] == 0].index[0]
except IndexError:
recovery = np.nan # drawdown not recovered
valley = underwater.index[valley]
return peak, valley, recovery