0

I just recently started using pyalgotrade

I backtest bitcoin historical data

In every trade I want to trade a fraction of bitcoin, but because the quantity argument of enterlong(), has int method, it converts for example 0.5 into 0 and raises an error.

What can I do?

Thanks a lot

Hamze Kabi
  • 11
  • 2
  • I havent use PyAlgoTrader yet but just checked their documentation and yes indeed it explicitly says it accepts quantity as integer. However, since you are in your imaginary backtest environment, why would you need to test with 0.5, all you need to do is just multiply your initial capital and position quantities with 10. – Mehmet Kaan ERKOÇ Oct 14 '22 at 07:43
  • Please provide enough code so others can better understand or reproduce the problem. – Community Oct 14 '22 at 14:50

0 Answers0