-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ENH Added round trip tearheet and supporting functions #210
Conversation
a-campbell
commented
Nov 16, 2015
- Adds ability to split trades
- Adds ability to append "closing" trades to complete round trips open at the end of the backtest
- Adds various plotting and printing functions to visualize round trip duration, frequency, and profitability
- Adds ability to display profit attribution by sector.
- Tests for round trip extraction functions.
ac22f8c
to
788e7d7
Compare
@twiecki should you review this since you wrote a lot of this code? |
I found some issues with the code I want to have a closer look at. We also need more unittests I think. |
Also noticed while browsing: many of the new functions' docstrings report that they accept |
return ax | ||
|
||
|
||
def show_profit_attribtion(round_trips): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attribution
…in add_closing_transactions. push final transaction back by one second to avoid overlap
…st for round trip. Enhanced add_closing_trade test by adding an already closed position
Also, I think an example NB with some description would go a long way. Really like where this is going. |
You might want to consider gzipping the test data. If there is a lot it will make cloning much slower, especially when you don't have great internet. |
good call |
In other words, separates of the closing of one short/long position | ||
with the opening of a new long/short position. | ||
|
||
For example, the second transaction in this transactions DataFrame |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice/clear description.
LGTM. I think there are still the csv files present here. |
ENH Round trip tearheet and supporting functions