Order fill and size 0
dasch last edited by dasch
When filling an order which has a size for example of 1 with -1 will generate an division by zero Exception
File "../../libs/backtrader/order.py", line 199, in addbit self.price = (oldvalue + newvalue) / self.size ZeroDivisionError: float division by zero
i am trying to update exisiting orders when creating new orders. I am using oanda. When sending a new order, this may affect existing trades (tradesClosed, tradeReduced). Everything is working except setting the order to a size of zero, when it gets closed.
Is this a bug in backtrader or should i close trades in a different way?
dasch last edited by
Nevermind, it was some obscure error in my code.