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

[BUG] Fix #145 drawdown overlaps #150

Merged
merged 9 commits into from
Oct 4, 2015
Merged

[BUG] Fix #145 drawdown overlaps #150

merged 9 commits into from
Oct 4, 2015

Conversation

jlopezpena
Copy link
Contributor

Fix the drawdown overlaps described in #145, also making the get_drawdown function more efficient.

Add a regression test that checks that the recovery of each drawdown occurs before the peak of the next (when ordered by date).

Note: The test requires being online to pull the FB stock data (or have it cached). I couldn't find any guidelines about tests. If that is not appropriate let me know and I will work on getting an offline version of it.

Javier López Peña and others added 7 commits September 25, 2015 16:38
Fixes the drawdown overlaps
Makes data cropping more efficient
Add a unittest
Flake8 complaints
Flake 8
zip does not return a list on python 3…
@twiecki
Copy link
Contributor

twiecki commented Sep 26, 2015

Awesome, thanks for pulling that together. The question re FB is a good one. Can you change it to SPY which we provide a cached version of?

@jlopezpena
Copy link
Contributor Author

Changed the test to use SPY, and lightly modified the check in order to get more informative messages in case of error (a test error should now show the dates for the overlapping drawdown periods rather than the uninformative True does not equal False that was showing before).

Reproducing the error for SPY required inspecting over a larger number of drawdowns (20 rather than 10)

Patch is also rebased on top of the latest master branch

@twiecki
Copy link
Contributor

twiecki commented Oct 4, 2015

LGTM, thanks!

twiecki added a commit that referenced this pull request Oct 4, 2015
@twiecki twiecki merged commit 49fcf1f into quantopian:master Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants