BitMEX / sample-market-maker

Sample BitMEX Market Making Bot
Apache License 2.0
1.7k stars 757 forks source link

It crashes when there is rally #17

Closed btcre closed 6 years ago

btcre commented 7 years ago

Running in Windows 8.1 pro, 8G RAM, latest python 2.7.14 FYI Bot is great, thank you :)

2017-09-18 09:30:03,226 - INFO - market_maker - Contracts Traded This Run: -2000 2017-09-18 09:30:03,226 - INFO - market_maker - Total Contract Delta: 0.2591 XBT 2017-09-18 09:30:03,227 - INFO - market_maker - Creating 2 orders: 2017-09-18 09:30:03,227 - INFO - market_maker - Sell 300 @ 3808.5 2017-09-18 09:30:03,227 - INFO - market_maker - Sell 400 @ 3827.6 2017-09-18 09:30:08,164 - WARNING - bitmex - Timed out, retrying... Traceback (most recent call last): File "marketmaker", line 4, in market_maker.run() File "E:\market-maker-master\market_maker\market_maker.py", line 547, in run om.run_loop() File "E:\market-maker-master\market_maker\market_maker.py", line 515, in run_loop self.place_orders() # Creates desired orders and converges to existing orders File "E:\market-maker-master\market_maker\market_maker.py", line 325, in place_orders return self.converge_orders(buy_orders, sell_orders) File "E:\market-maker-master\market_maker\market_maker.py", line 411, in converge_orders self.exchange.create_bulk_orders(to_create) File "E:\market-maker-master\market_maker\market_maker.py", line 192, in create_bulk_orders return self.bitmex.create_bulk_orders(orders) File "E:\market-maker-master\market_maker\bitmex.py", line 97, in wrapped return function(self, *args, **kwargs) File "E:\market-maker-master\market_maker\bitmex.py", line 154, in create_bulk_orders return self._curl_bitmex(api='order/bulk', postdict={'orders': orders}, verb='POST') File "E:\market-maker-master\market_maker\bitmex.py", line 285, in _curl_bitmex return self._curl_bitmex(api, query, postdict, timeout, verb) File "E:\market-maker-master\market_maker\bitmex.py", line 262, in _curl_bitmex query={'filter': json.dumps({'clOrdID': postdict['clOrdID']})}, KeyError: 'clOrdID' 2017-09-18 09:30:11,865 - INFO - market_maker - Shutting down. All open orders will be cancelled. 2017-09-18 09:30:11,865 - INFO - market_maker - Resetting current position. Cancelling all existing orders. 2017-09-18 09:30:12,744 - INFO - market_maker - Cancelling: Buy 500 @ 3704.60 2017-09-18 09:30:12,744 - INFO - market_maker - Cancelling: Buy 400 @ 3723.10 2017-09-18 09:30:12,744 - INFO - market_maker - Cancelling: Buy 300 @ 3741.70 2017-09-18 09:30:12,746 - INFO - market_maker - Cancelling: Sell 500 @ 3817.10 2017-09-18 09:30:12,746 - INFO - market_maker - Cancelling: Sell 400 @ 3827.60 2017-09-18 09:30:12,746 - INFO - market_maker - Cancelling: Sell 300 @ 3808.50 2017-09-18 09:30:14,852 - INFO - ws_thread - Websocket Closed

ryanfox commented 6 years ago

Make sure ORDERID_PREFIX is set in settings.py.

Also, the market maker is only supporting Python 3.5+ moving forward. Try running in Python3.