Skip to content

Commit 86537b2

Browse files
authored
Binance - add ClientOrderId support (#563)
1 parent e159457 commit 86537b2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
557557
{
558558
Dictionary<string, object> payload = await GetNoncePayloadAsync();
559559
payload["symbol"] = order.MarketSymbol;
560+
payload["newClientOrderId"] = order.ClientOrderId;
560561
payload["side"] = order.IsBuy ? "BUY" : "SELL";
561562
if (order.OrderType == OrderType.Stop)
562563
payload["type"] = "STOP_LOSS";//if order type is stop loss/limit, then binance expect word 'STOP_LOSS' inestead of 'STOP'
@@ -934,7 +935,8 @@ private ExchangeOrderResult ParseOrder(JToken token)
934935
IsBuy = token["side"].ToStringInvariant() == "BUY",
935936
OrderDate = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(token["time"].ConvertInvariant<long>(token["transactTime"].ConvertInvariant<long>())),
936937
OrderId = token["orderId"].ToStringInvariant(),
937-
MarketSymbol = token["symbol"].ToStringInvariant()
938+
MarketSymbol = token["symbol"].ToStringInvariant(),
939+
ClientOrderId = token["clientOrderId"].ToStringInvariant()
938940
};
939941

940942
switch (token["status"].ToStringInvariant())

0 commit comments

Comments
 (0)