Closed slavslavin closed 1 week ago
HI, Is it possible to add tp/sl partial orders after postion has ben opened?
Example: Postion entry price: 100 Quantity: 100 some coins
I want to add next orders: Market takeprofit for 50 coins with price 120 Market stop loss for 50 coins with price 80
Market takeprofit for 50 coins with price 140 Market stop loss for 50 coins with price 60
I use next code to add Take profit order:
await client.V5Api.Trading.PlaceOrderAsync(Category.Linear, symbol, side: OrderSide.Sell, type: NewOrderType.Market, quantity: 50, timeInForce: TimeInForce.GoodTillCanceled, reduceOnly: true, price: null, closeOnTrigger: false, clientOrderId: "myClientOrderId", takeProfitTriggerBy: TriggerType.LastPrice, takeProfitOrderType: OrderType.Market, takeProfit: 120, stopLossTakeProfitMode: StopLossTakeProfitMode.Partial);
Stop loss order:
await client.V5Api.Trading.PlaceOrderAsync(Category.Linear, symbol, side: OrderSide.Sell, type: NewOrderType.Market, quantity: 50, timeInForce: TimeInForce.GoodTillCanceled, reduceOnly: true, price: null, triggerBy: TriggerType.LastPrice, closeOnTrigger: false, clientOrderId: clientOrderId, stopLossOrderType: OrderType.Market, stopLoss: 80, stopLossTakeProfitMode: StopLossTakeProfitMode.Partial);
But it doesnt work.
Could you help me?
Hi, yes that is possible, but for existing positions you should use client.V5Api.Trading.SetTradingStopAsync instead
client.V5Api.Trading.SetTradingStopAsync
HI, Is it possible to add tp/sl partial orders after postion has ben opened?
Example: Postion entry price: 100 Quantity: 100 some coins
I want to add next orders: Market takeprofit for 50 coins with price 120 Market stop loss for 50 coins with price 80
Market takeprofit for 50 coins with price 140 Market stop loss for 50 coins with price 60
I use next code to add Take profit order:
Stop loss order:
But it doesnt work.
Could you help me?