Open arturnawrot opened 2 years ago
Do you see any warnings issued?
No
I believe you should have seen this warning printed: https://github.com/kernc/backtesting.py/blob/267d99f0d48745acf98156b2e69150c02d42f761/backtesting/backtesting.py#L1073-L1077 See https://github.com/kernc/backtesting.py/issues/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.
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