-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Bitmex] Add order modify #2806
Conversation
Add `modifyOrder` to org.knowm.xchange.service.trade.TradeService, because many exchanges are able either modify exiting order or make cancel/replace it; Add order modify for Bitmex.
cancel/replace is not the equivalent of modifying an order because the order id changes then you cancel/replace |
As far I know, order modification as is, exists only on Bitmex, but other exchanges allow cancel/replace by one request, for instance: Since a new method can be implemented for modifying (when order ID doesn't change) or cancel/replace (ID is changing), it returns the respective ID, that allows use it for both operations. As an option, the method can be renamed to |
canceling and creating a new order can already by done using the existing API and is the most generic way of achieving what you want - doing it in one req is a neglectable optimization if one wants to use generic code adding methods to generic interfaces that only work for single exchanges is not the way to go just use the method BitmexTradeServiceRaw.replaceOrder in your app if you need it |
I see few benefits in the atomic cancel/replace:
|
generic interfaces should have features that are generic - at least 3/4 of exchanges have them I don't se a modify order nor add new with cancel id endpoint in Bittrex, Binance or BitBay for example there is no sense in having generic interfaces with implementations that mostly throw unsupported operation exception if you want to optimize by using exchange specific features then use methods from *ServiceRaw classes |
Absolutely agree, don't make sense to add generic function for only one exchange. After long and boring googling there is a list of such exchanges: Cancel/Replace Cex.io: https://cex.io/rest-api#cancel-replace-order] Modify: I expected more but seems there is a sufficient amount. |
I've added a issue describing your feature request #2818 and a page where we can list generic feature candidates like this one to research which exchange APIs support them: https://github.com/knowm/XChange/wiki/Generic-feature-candidates |
Update feature request based on [knowm#2818]; Update documentation; Make cancel and replace by two requests as default behaviour for exchanges that doesn't support modify or cancel/replace.
Add
modifyOrder
to org.knowm.xchange.service.trade.TradeService, because many exchanges are able either modify existing order or cancel/replace it;Add order modify for Bitmex.