Type Errors in bbroker.py
sameerk-k opened this issue · 0 comments
Hi - This is probably for the main backtrader issue tracker but I got this error while running tests with this Oandav20 package. Has anyone encountered this error?
If I should post it in the backtrader respository, please let me know. Thanks.
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/cerebro.py", line 1127, in run
runstrat = self.runstrategies(iterstrat)
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/cerebro.py", line 1295, in runstrategies
self._runnext(runstrats)
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/cerebro.py", line 1619, in _runnext
self._brokernotify()
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/cerebro.py", line 1357, in _brokernotify
self._broker.next()
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/brokers/bbroker.py", line 1178, in next
self.check_submitted()
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/brokers/bbroker.py", line 581, in check_submitted
cash = self._execute(order, cash=cash, position=position)
File "/Applications/anaconda/lib/python3.6/site-packages/backtrader/brokers/bbroker.py", line 775, in _execute
opencash /= comminfo.get_leverage() # dec cash with level
TypeError: unsupported operand type(s) for /=: 'decimal.Decimal' and 'float'