Bybit API Wrapper. Up-to-date, most-complete, well-organized, well-documented, easy-to-use, multi-task and multi-thread compatible Bybit Cryptocurrency Exchange Rest and Websocket Api Wrapper
MIT License
1
stars
0
forks
source link
GetOrderHistoryAsync does not return list of orders #9
Could you fix this so that one can get the list of orders like so?
foreach (var order in response.Data) { if (order.AveragePrice != null) { fr.Price = (decimal)order.AveragePrice; if (order.Quantity != null) fr.Quantity = (decimal)order.Quantity; if (order.OrderStatus != null) fr.OrderStatus = order.OrderStatus.GetLabel(); return fr; } }
When calling
GetOrderHistoryAsync
, the Data property is null and therefore there is no way to get the list of orders.The Raw property does contain the string as in this example:
{"retCode":0,"retMsg":"OK","result":{"list":[{"orderId":"745f9896-0291-4c9c-8e98-05c43f297849","orderLinkId":"","blockTradeId":"","symbol":"SOLUSDT","price":"153.040","qty":"5.0","side":"Buy","isLeverage":"","positionIdx":0,"orderStatus":"Filled","cancelType":"UNKNOWN","rejectReason":"EC_NoError","avgPrice":"145.7600","leavesQty":"0.0","leavesValue":"0","cumExecQty":"5.0","cumExecValue":"728.8","cumExecFee":"0.40084","timeInForce":"IOC","orderType":"Market","stopOrderType":"UNKNOWN","orderIv":"","triggerPrice":"0.000","takeProfit":"0.000","stopLoss":"0.000","tpTriggerBy":"UNKNOWN","slTriggerBy":"UNKNOWN","triggerDirection":0,"triggerBy":"UNKNOWN","lastPriceOnCreated":"0.000","reduceOnly":false,"closeOnTrigger":false,"smpType":"None","smpGroup":0,"smpOrderId":"","tpslMode":"","tpLimitPrice":"","slLimitPrice":"","placeType":"","createType":"CreateByUser","createdTime":"1715475404714","updatedTime":"1715475404718"}],"nextPageCursor":"page_token%3D122826%26","category":"linear"},"retExtInfo":{},"time":1715475424948}
Could you fix this so that one can get the list of orders like so?
foreach (var order in response.Data) { if (order.AveragePrice != null) { fr.Price = (decimal)order.AveragePrice; if (order.Quantity != null) fr.Quantity = (decimal)order.Quantity; if (order.OrderStatus != null) fr.OrderStatus = order.OrderStatus.GetLabel(); return fr; } }