burakoner / OKEx.Net

Open source .Net API wrapper for the @OKEx V5 Rest API and V5 Websocket API
MIT License
86 stars 48 forks source link

Error setting value to 'TriggerTime' on 'Okex.Net.Objects.Trade.OkexAlgoOrder'. #75

Closed overstartup closed 1 year ago

overstartup commented 1 year ago

i want to cancel all algo orders by:
var st = api.GetAlgoOrderList(OkexAlgoOrderType.Conditional, instrumentId: preOrder.Symbol); sometimes it gives this error:


[1726] Deserialize JsonSerializationException: Error setting value to 'TriggerTime' on 'Okex.Net.Objects.Trade.OkexAlgoOrder'. data: {
  "code": "0",
  "data": [
    {
      "activePx": "",
      "actualPx": "",
      "actualSide": "",
      "actualSz": "0",
      "algoId": "507432240511590400",
      "cTime": "1667253273773",
      "callbackRatio": "",
      "callbackSpread": "",
      "ccy": "",
      "clOrdId": "",
      "instId": "UNI-USDT-SWAP",
      "instType": "SWAP",
      "lever": "50",
      "moveTriggerPx": "",
      "ordId": "0",
      "ordPx": "",
      "ordType": "conditional",
      "posSide": "net",
      "pxLimit": "",
      "pxSpread": "",
      "pxVar": "",
      "quickMgnType": "",
      "reduceOnly": "false",
      "side": "buy",
      "slOrdPx": "-1",
      "slTriggerPx": "6.864",
      "slTriggerPxType": "last",
      "state": "live",
      "sz": "219",
      "szLimit": "",
      "tag": "",
      "tdMode": "cross",
      "tgtCcy": "",
      "timeInterval": "",
      "tpOrdPx": "",
      "tpTriggerPx": "",
      "tpTriggerPxType": "",
      "triggerPx": "",
      "triggerPxType": "",
      "triggerTime": ""
    }
  ],
  "msg": ""
}
overstartup commented 1 year ago

It has same error when I use: var st = api.GetAlgoOrderList(OkexAlgoOrderType.OCO, instrumentId: preOrder.Symbol);

i have stop lost and take profit record in the broker: image

overstartup commented 1 year ago

@burakoner could you please solve this issue? i need it.

burakoner commented 1 year ago

Version 5.3.0 is released with this commit https://github.com/burakoner/OKEx.Net/commit/1700b679454393180777e3a9eb06772ed0a2d159 Also nuget package is available on https://www.nuget.org/packages/OKEx.Net/5.3.0