Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bulk order endpoint issue after last commit #228

Open
sencdaarvaarjemee opened this issue Nov 18, 2021 · 3 comments
Open

bulk order endpoint issue after last commit #228

sencdaarvaarjemee opened this issue Nov 18, 2021 · 3 comments

Comments

@sencdaarvaarjemee
Copy link

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 ??

@ShieldTrade
Copy link

Same problem for me.

@ShieldTrade
Copy link

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

@sencdaarvaarjemee
Copy link
Author

sencdaarvaarjemee commented Dec 2, 2021

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

STRML added a commit that referenced this issue Feb 17, 2023
Additionally fix KeyError when manual orders without clOrdID are submitted

Fixes #226, #228, #237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants