-
-
Notifications
You must be signed in to change notification settings - Fork 987
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
buy()
method does not work.
#510
Comments
Do you see any warnings issued? |
No |
I believe you should have seen this warning printed: backtesting.py/backtesting/backtesting.py Lines 1073 to 1077 in 267d99f
See #134. |
For anyone having this issue; the size of the buy needs to be set to 1, and you need to give it enough cash to buy whole bitcoins. Just times the BTC price by 10. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I'm importing data from Coinbase API (you don't need any API keys to reproduce the issue, just copy-paste the snippet below)
self.buy()
andself.sell()
do not work at all. Althoughself.plot()
works flawlessly and the data is normally plotted, trades are not executed at all. Possibly there's something wrong with data formatting but it does not return any warning nor errors, so I'm not sure whether it's an issue with my data or the backtesting.py library.When I used Forex data for this script then everything worked.
You may need to install cbpro
pip install cbpro
The text was updated successfully, but these errors were encountered: