BitMEX invalid argument clOrdID
Atom Reply
2/10/2019


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.8KB (3)

Tags:


Thanks:




3 Answers
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
Training Donator
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[T](Uri url, IRestRequest request)
at StockSharp.Bitmex.Native.HttpClient.AmendOrder(String originClientOrderId, String orderId, String clientOrderId, Nullable`1 price, Nullable`1 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.

Topic starter
Thanks: Support

Support

Avatar
Date: 2/11/2019
Reply


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


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

loading
clippy