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

Unknown error in PlaceAlgoOrder #78

Closed overstartup closed 1 year ago

overstartup commented 1 year ago

I want to set a stop lost and take profit by PlaceAlgoOrder, but it returns -1 error without any message.

my code:

    var StopProfitResult1 = api.PlaceAlgoOrder(preOrder.Symbol, trademode, orderSide, OkexAlgoOrderType.OCO, preOrder.Quantity,
                                                 positionSide: positionSide, slOrderPrice: -1, slTriggerPrice: preOrder.StopLostPrice,
                                                 tpOrderPrice: -1, tpTriggerPrice: preOrder.TakeProfitPrice);

StopProfitResult1.RequestBody:

{"instId":"SOL-USDT-SWAP","ordType":"oco","posSide":"long","side":"sell","slOrdPx":"-1","slTriggerPx":"14.3506904678614","sz":"10","tdMode":"cross","tpOrdPx":"-1","tpTriggerPx":"14.8679285964158"}

arashreshadi commented 1 year ago

Me too, api.PlaceAlgoOrder( "XRP-USDT-SWAP", OkexTradeMode.Isolated, OkexOrderSide.Buy, OkexAlgoOrderType.OCO, 200, null, false, OkexPositionSide.Long, null, OkexAlgoPriceType.Last, 0.24m, 0.25m, OkexAlgoPriceType.Last, 0.10m, 0.10m, 0.18m, 0.18m );