Stop-Loss order attached to open position not deleted after postion is closed

Hello, I placed a stop-loss order that is tied to the open long position via the API, and a limit sell order to reduce position, and after I closed the position manually from the Binance UI by hitting the button MARKET, the postion is closed of course, and then the limit sell order is deleted automatically, but leaving the stop-loss order still open there? I think the stop-loss should be deleted as well automatically, because if I place the stop-loss order tied to the position manually from the Binance UI, the stop loss order will get deleted automatically as soon as I close the position manually from the Binance UI by hitting MARKET button.

Please pay attention to the detail: from both cases, I always close the position by hitting the MARKET button from the Binance UI.

The limit sell order placed via API is to reduce position, so I understand the logic why it gets deleted as soon as the position is closed, now the stop-loss placed via API is ALSO to reduce position (I am using STOP_MARKET type and enable the closePosition), it’s even tied to the open position, so there is absolutely no logic that you guys keep the stop-loss order and delete the limit sell order.

It does not matter if they are placed via API or via the UI, in both cases, I close the position manually from the Binance UI by hitting MARKET button.

Finally, simple logic, the position is closed, the tied stop-loss should be deleted by binance, NOT by me, this is Binance’s job to handle this, what do you think?

Hi. Could you share some more info about your approach?

  1. What is the query parameters you set to place a stop-loss order? (Ignore the signature part)
  2. Did you see any update on the position info in UI after placing that stop loss order?
  3. What is the query parameters of the limit sell order? (Ignore the signature part)

Thanks Ish for the response.

This is the stop loss order: (for the long position)

[symbol:BTCUSDT, side:BUY, positionSide:SHORT, type:STOP_MARKET, reduceOnly:null, quantity:null, price:null, newClientOrderId:null, stopPrice:34420.14, closePosition:true, activationPrice:null, callbackRate:null, timeInForce:null, workingType:CONTRACT_PRICE, priceProtect:null, timestamp:1624935229562]

This is the limit order: (not from the same long position, taken from another short position, to cover short, but you get the point)

[symbol:BTCUSDT, side:BUY, positionSide:SHORT, type:LIMIT, reduceOnly:null, quantity:0.002, price:32727.48, newClientOrderId:null, stopPrice:null, closePosition:null, activationPrice:null, callbackRate:null, timeInForce:GTC, workingType:null, priceProtect:null, timestamp:1624938255202]

Immediately after I hit the MARKET button on the Binance UI to close the position, the limit order was deleted/cancelled, while the stop loss order is still open there.

regarding your #2 question, the stop-loss order is tied to the position, check the example below

Thanks for the detail provided. This happens because in frontend, there is a special logic implemented to handle the TP/SL orders created via UI and this is not applicable to the orders created from API. The team is working on it to either improve the UI to highlight the difference or add the ability to handle the orders from API.

OK, thanks Ish, I hope it is the latter solution, which is a easier solution for Binance, why highlighting the difference to make it more complicated if Binance can just add a little extra command to just cancel all open orders of that pair after the position is closed on user’s behalf? When user clicks on the “Close All Positions” button from the mobile app, Binance is able to close all open orders for all pairs, regardless these open orders are created via API or created from the UI! So Binance is 100% able to do the same for a single pair as well.