You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "custom_bitmex_strategy.py", line 508, in <module>
run()
File "custom_bitmex_strategy.py", line 500, in run
order_manager = CustomOrderManager()
File "/home/admin/my_bitmex/market_maker.py", line 217, in __init__
self.reset()
File "/home/admin/my_bitmex/market_maker.py", line 221, in reset
self.sanity_check()
File "/home/admin/my_bitmex/market_maker.py", line 452, in sanity_check
ticker = self.get_ticker()
File "/home/admin/my_bitmex/market_maker.py", line 260, in get_ticker
if ticker['buy'] == self.exchange.get_highest_buy()['price']:
File "/home/admin/my_bitmex/market_maker.py", line 143, in get_highest_buy
buys = [o for o in self.get_orders() if o['side'] == 'Buy']
File "/home/admin/my_bitmex/market_maker.py", line 140, in get_orders
return self.bitmex.open_orders()
File "/home/admin/my_bitmex/bitmex.py", line 134, in wrapped
return fn(self, *args, **kwargs)
File "/home/admin/my_bitmex/bitmex.py", line 226, in open_orders
return self.ws.open_orders(self.orderIDPrefix)
File "/home/admin/my_bitmex/ws/ws_thread.py", line 118, in open_orders
return [o for o in orders if str(o['clOrdID']).startswith(clOrdIDPrefix) and o['leavesQty'] > 0]
File "/home/admin/my_bitmex/ws/ws_thread.py", line 118, in <listcomp>
return [o for o in orders if str(o['clOrdID']).startswith(clOrdIDPrefix) and o['leavesQty'] > 0]
KeyError: 'clOrdID'
fixed it with replaceing line 117 in: https://github.com/BitMEX/sample-market-maker/blob/be124ebc90d7aa692bdf2f53e066bf5e7e25723f/market_maker/ws/ws_thread.py
from
return [o for o in orders if str(o['clOrdID']).startswith(clOrdIDPrefix) and o['leavesQty'] > 0]
to
return [o for o in orders if 'clOrdID' in o and str(o['clOrdID']).startswith(clOrdIDPrefix) and o['leavesQty'] > 0]
The text was updated successfully, but these errors were encountered: