BitMEX invalid argument clOrdID

BitMEX invalid argument clOrdID
Atom
2/10/2019
vsmt


Hi, I get an invalid argument error for the BitMEX connector when the MarketQuotingStrategy tries to requote:


Error	"Order 53343094 (0x7BB32E) was not cancelled because System.InvalidOperationException: {""error"":{""message"":""Invalid argument: clOrdID"",""name"":""HTTPError""}}

I've attached the log to this post. StockSharp.Bitmex.dll version 4.4.15.0. Code snippet used to initiate the MarketQuotingStrategy:


ChildStrategies.ToList().ForEach(s => s.Stop());
var strategy = new MarketQuotingStrategy(Sides.Sell, Volume + Math.Abs(Position))
{
    WaitAllTrades = true,
};
strategy.WhenNewMyTrade().Do(OnNewOrderTrade).Apply(this);
ChildStrategies.Add(strategy);

bitMEX.csv 8 KB (965)

Tags:


Thanks:


Support

Avatar
Date: 2/11/2019
Reply


Thank you for your feedback. This error mean the order already inactive. Sometimes orders fill before cancel.

Thanks:

vsmt

Avatar
Date: 2/11/2019
Reply


The order was still active and not filled, please look at the log:

L#19: MQS_XBTUSD@BMEX_Bitmex_-KEY 10/02/2019 14:58:02 Info Registration of new (0x7BB32E) order for Sell with price 3603 and volume 1. L#26: MQS_XBTUSD@BMEX_Bitmex_-KEY 10/02/2019 14:58:02 Info Order 53343094 (0x7BB32E) accepted by the exchange. L#41: MQS_XBTUSD@BMEX_Bitmex_-KEY 10/02/2019 14:58:46 Error "Order 53343094 (0x7BB32E) was not cancelled because System.InvalidOperationException: {error:{message:Invalid argument: clOrdID,name:HTTPError}} at StockSharp.Bitmex.Native.HttpClient.MakeRequest(Uri url, IRestRequest request) at StockSharp.Bitmex.Native.HttpClient.AmendOrder(String originClientOrderId, String orderId, String clientOrderId, Nullable1 price, Nullable1 volume) at StockSharp.Bitmex.BitmexMessageAdapter.ProcessOrderReplace(OrderReplaceMessage replaceMsg) at StockSharp.Messages.MessageAdapter.SendInMessage(Message message)."

I manually stopped the strategy at 15:01 and then the order is cancelled:

L#75: MQS_XBTUSD@BMEX_Bitmex_-KEY 10/02/2019 15:01:21 Info Cancel order 53343094 (0x7BB32E). L#76: MQS_XBTUSD@BMEX_Bitmex_-KEY 10/02/2019 15:01:21 Warning Order 53343094 (0x7BB32E) has state Active. Rule cannot be stopped. L#85: MQS_XBTUSD@BMEX_Bitmex_-KEY 10/02/2019 15:01:22 Info Order 53343094 (0x7BB32E) no longer active.

Thanks: Support

Support

Avatar
Date: 2/11/2019
Reply


I have informed dev team. Please wait for a while.

Thanks:

kyle Qian

Avatar
Date: 3/19/2019
Reply


Hi, i have encounter the same issue recently. I used python API. It has been working for me for several months but it starts to throw errors recently if I try to amend the order:

400 Bad Request: {'error': {'message': 'Invalid orderID', 'name': 'HTTPError'}}

Please look into this, thanks a lot!

Thanks:

Support

Avatar
Date: 3/19/2019
Reply


The issue already fixed in our platform.

Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy