-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Way to access equity values, individual trade returns, ... #4
Comments
bt = Backtest(...)
result = bt.run()
result._trade_data # type: pd.DataFrame In result._trade_data['Equity']
result._trade_data['P/L'] backtesting.py/backtesting/backtesting.py Lines 849 to 865 in a7d1d4f
Note, this is currently private API, so it may change. |
Ok, thanks...what do you mean with a "private API"? |
|
It should be. It's the way plotting functions access raw trading data: backtesting.py/backtesting/backtesting.py Line 911 in a7d1d4f
backtesting.py/backtesting/_plotting.py Line 80 in a7d1d4f
|
It's undocumented API, without reliability (change) guarantees, not meant for public consumption. It's why the attribute is prefixed with an underscore, following a common Python convention. You are welcome to use it in testing, though. Maybe even let me know how you are using it and whether you need/expect something else from/like it too. 👍 |
Is there a way to extract the returns of the strategy and not only have a plot?
The text was updated successfully, but these errors were encountered: