Hi.
For your first question, there is no dedicated endpoint for closing a position. But you can make use of closePosition attribute to do so. https://binance-docs.github.io/apidocs/futures/en/#new-order-trade
And yes, unfortunately, since the closing operation is the same as placing a new order, the commission fee is required.
Well the closePosition is only available for stop and take profit type orders.
in some situations the price has a pump and suddenly it goes to some levels that if you want to put order in that price you cant because the order would immediately trigger so we need to close the position using market order that has no closePosition attribute…
what should i do in this situation for closing the position?
(I cant just place a market order because it needs quantity to set and as the position size is changing every second i cant set the quantity and make sure that it closes completely or it doesn’t open new position with less size on the other side)