BitMEX/sample-market-maker

bulk order endpoint issue after last commit

Opened this issue · 3 comments

Fresh install
this is what I get.

leftoverbuy in usd value 184.05378513198326
leftoversell in usd value 0

[1, 0] buy, sell
2021-11-18 17:05:12,956 - INFO - market_maker - Creating 1 orders:
2021-11-18 17:05:12,957 - INFO - market_maker - Buy 100 @ 58344.0
2021-11-18 17:05:12,957 - INFO - bitmex - sending req to https://testnet.bitmex.com/api/v1/order/bulk: {"orders": [{"price": 58344.0, "orderQty": 100, "side": "Buy", "clOrdID": "-Puk
-QfCUFw", "symbol": "XBTUSD", "execInst": "ParticipateDoNotInitiate"}]}
2021-11-18 17:05:13,715 - ERROR - bitmex - Unable to contact the BitMEX API (404). Request: https://testnet.bitmex.com/api/v1/order/bulk
{"orders": [{"price": 58344.0, "orderQty": 100, "side": "Buy", "clOrdID": "-Pu0UFw", "symbol": "XBTUSD", "execInst": "ParticipateDoNotInitiate"}]}
2021-11-18 17:05:13,715 - INFO - market_maker - Shutting down. All open orders will be cancelled.
2021-11-18 17:05:13,716 - INFO - market_maker - Resetting current position. Canceling all existing orders.
2021-11-18 17:05:13,716 - INFO - bitmex - sending req to https://testnet.bitmex.com/api/v1/order: {"filter": "{"ordStatus.isTerminated": false, "symbol": "XBTUSD"}", "count": 500}
2021-11-18 17:05:15,134 - INFO - ws_thread - Websocket Closed

What am I doing wrong ??

Same problem for me.

I found the solution.

follow the getting started info:

  1. Create a Testnet BitMEX Account and deposit some TBTC.
  2. Install: pip install bitmex-market-maker. It is strongly recommeded to use a virtualenv.
  3. Create a marketmaker project: run marketmaker setup

at the end you have 3 relevant file/dir ( lucio is my name )

A) C:\Users\lucio\AppData\Local\Programs\Python\Python39\Lib\site-packages\market_maker... ...after 2
B) C:\Users\lucio\market_maker........after 3
C) C:\Users\lucio\settings.py ( file where you add your API credential).......after 3. Attention there is a file with the same name in B. do not use that one 96

The marketmaker which gets executed when you

Run it: marketmaker [symbol]

is A which contains the market_maker.py and the bitmex.py files you have to modify to get rid of bulk order.

@sencdaarvaarjemee and I were probably modifying the right files in the wrong directory B

I am not an expert and I do not understand the reason for this duplication of names and set up. The installation process is very unclear, difficult to understand and badly documented in my opinion. on the other side the code is very well written.

if somebody can explain me the reason for having 2 dir with the same name A and B I would appreciate

Tx

Hey ShieldTrade, I was working for years with this bot. .
It has the two dir because it inherits from the base as to always have something to work with, to fall back on.
I have not tested the 1.6.0 version that was mentioned in the other issue. Also no clue if the ws endpoint is also fixed in the latest version.

ShieldTrade, do you say you had the same issue, but then fixed it just by using the normal install procedure ? Wat did you do different before ? I think it might now work b.c. the version upgrade ?!

might try to play around with this again soon, but for now I run an other bot.
Edit: went trough the code in https://github.com/BitMEX/sample-market-maker/blob/master/market_maker/bitmex.py
for a bit and it seems that bulkorder endpoint is now fixed. so you probably have success just b.c. of the update.
cheers