Closed GitteryCoder closed 6 years ago
hi @GitteryCoder, I think the question you raised is quite important and it's definitely worth investigating it carefully. It's crucial not just to know if these are bugs or not, but also to add some description of the API to this repository. I know that handling order book changes is a key point in the most of the trading strategies, so I will come back to you soon. All the exchanges provide order book updates with a different way, so, I think it's important to describe what's the best way to handle order book using Bitmex API
Thanks,
HI @GitteryCoder, See the answers below,
To provide for the developers better way to handle all this action types, I wrapped the result DTO into BitmexSocketDataMessage . In addition, I added examples (check out the app) and a short description how to handle order book L2.
"Discard Partial
action" - not always, for instance, Partial
action brings full depth snapshot of the order book within L2 subscription (2100 rows for XBTUSD). So, I would recommend to you here to make a decision case by case
"If I subscribe to orderBook10, all I get are zero entries. Why?" - that happened because you used the wrong model, it should have been OrderBookSocketDto, but within the last commit, I renamed the class to make naming a bit more explicit and now it's OrderBook10Dto. To be even more specific and avoid bugs like yours, I added BitmetSocketSubscriptions. Please use it when you create a subscription request to be sure that you specify the appropriate model for the subscription.
Hi Semashkinvg,
In my code I did this:
This gave me the output:
Questions:
There is no indication of whether the action is "partial", "update", "delete" or "insert". Am I supposed to make the guess that if price is 0 then it is an "update", and if size is 0 then it is a "delete" etc?
Also according to https://www.bitmex.com/app/wsAPI#subscriptions I should discard all data before "partial" but how can I know whether a message is "partial" or "insert"?
If I subscribe to orderBook10, all I get are zero entries. Why?