JKorf / Bitget.Net

A C# .netstandard client library for the Bitget REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/Bitget.Net/
MIT License
12 stars 9 forks source link

Planned orders / SL Trigger #39

Open SRNebu2007 opened 1 week ago

SRNebu2007 commented 1 week ago

Describe the bug I want to ceate a sl trigger for an open position on futures trading. With API V1 and V2 I can not get the open trigger positions from server for validation they already exist and maybe have to be changed or whatever.

To Reproduce var asd = await bitgetClient.FuturesApiV2.Trading.GetOpenTriggerOrdersAsync(Bitget.Net.Enums.BitgetProductTypeV2.UsdtFutures, Bitget.Net.Enums.BitgetFuturesPlanType.PositionProfitPlan); var reseultUntriggeredOrders = await bitgetClient.FuturesApi.Trading.GetPlanOrdersAsync("ETHUSDT_UMCBL");

V2 interfave returns: [ServerError] 40812: The condition planType is not met V1 returns no data (status 200)

I have created the sl trigger via the app and it exists

Expected behavior Both functions should return the manually created SL-Trigger

SRNebu2007 commented 1 week ago

I have checked nearly all plantypes in V2 version. For all it's teh same error

JKorf commented 4 days ago

These are the supported values for the V2 endpoint planType parameter: NormalPlan: average trigger order TrackPlan: trailing stop order ProfitLoss: take profit and stop loss orders(including the profit_plan, loss_plan, moving_plan, pos_profit and pos_loss)

I validated that these call return successfully, though I don't have plan orders open so let me know if this fully fixes your issue

SRNebu2007 commented 12 hours ago

I have tried all parameters but did not get any open/planned order. In the app I can see those orders but not via the endpoint. I wanted to check via postman but the APi is not very friendly to use with postman. :-(