-
Notifications
You must be signed in to change notification settings - Fork 851
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
Tearsheet Statistics Class #129
Tearsheet Statistics Class #129
Conversation
- Add performance.py to calculate various metrics - Add tearsheet.py produce a tearsheet with equity curve, drawdown curve, and various other trade statistics
Lastest branch from upstream
…t Statistics for daily bars trading system.
To improve code coverage you might add a test which run your example |
@femtotrader Ok I will add it |
Add test_mac_backtest_tearsheet
@nwillemse looks like a Python3 issue with |
I don't understand why in Python 2 we are having legacy int, and in Python 3 we have Numpy int64 I see two differents ideas:
I would try something like int_t = (*six.integer_types, np.int64)
@staticmethod
@dispatch(int_t)
def display(x): # flake8: noqa
return round(x / PriceParser.PRICE_MULTIPLIER, 2) |
an error would occur.
@nwillemse -- is there any chance you could try to add Femto's suggestion to your own repo (make a branch from this branch, and add the suggested change to that branch)? If that works, we know #100 needs to be merged in, in order for this PR to be merged in. I think #100 should probably get merged in for the sake of best practice anyway @mhallsmoore, as the suggested library was built for handling these 2-3. |
#100 has now been merged, so @nwillemse should now be able to add this in and we can get this one merged too. |
Hi now that #100 is merged, how do I rerun these checks? Do you just need to merge the latest master into my tearsheet branch... |
:( Any ideas @femtotrader ?? |
Well. |
I've just tried re-running the Python 3.4 and 3.5 builds. Python 2.7 seems to work ok. Here is the error received from the Python 3.4 run:
Is this related to our integer types issue? It's coming up in the multipledispatch code. |
Yep, something to do with that @mhallsmoore. Not sure why it works locally for me with python3. Just pulled @nwillemse's branch to check things out. If I could make it fail locally that would be helpful. |
Got it. int64 is a numpy thing. Would explain why multipledispatch doesn't like it. Unsure why environment is making this an int64 though on travis and locally it's fine. Making a separate PR now which should solve. |
Ok, I've merged in @ryankennedyio's fix and am just running the builds again for this PR. Python 2.7 and 3.4 work, just waiting on 3.5... |
All builds now pass. Although coverage has decreased somewhat, so in the future we'll need to get it back to 90% again with some additional tests. Happy to merge now though. This is a great feature! Thanks to everyone for putting in the effort to get it into the codebase, and for @nwillemse for creating it in the first place. |
First version of the
Tearsheet
statistics class with an example mac_backtest_tearsheet.py. Currently only bars supported until we can figure out a common interface toBars
andTicks
(i.e. addget_last_price()
method to both)Missing some trade statistics because we don't have position entry/exit dates, # bars in trade, etc.
Comments?
Closes #90