-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
The modifyOrder() seems to have a bug when modifying price. Replicate with below commands:
from PyLOB import OrderBook
lob = OrderBook()
trades, orderInBook = lob.processOrder({'type':'limit','side':'bid','qty':100,'price':150,'tid':1},False,False)
print lob
lob.modifyOrder(1,{'side':'bid','qty':120,'price':150,'tid':1})
print lob
lob.modifyOrder(1,{'side':'bid','qty':120,'price':149,'tid':1})
Result:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "PyLOB/orderbook.py", line 211, in modifyOrder
self.bids.updateOrder(orderUpdate)
File "PyLOB/ordertree.py", line 66, in updateOrder
self.insertOrder(orderUpdate)
File "PyLOB/ordertree.py", line 48, in insertOrder
self.removeOrderById(quote['idNum'])
File "PyLOB/ordertree.py", line 76, in removeOrderById
order.orderList.removeOrder(order)
File "PyLOB/orderlist.py", line 50, in removeOrder
if len(self) == 0:
ValueError: __len__() should return >= 0
Metadata
Metadata
Assignees
Labels
No labels