Close future Position ( python )

Hey Dears,

I saw in other topics : if I want to close a (for ex LONG ) future position , I must open other position with different side ( SHORT ) .

1- actually there is no way to request to close position ( like MARKET Price ) ? ( I didn’t saw in documentation )

2- if I do the work that other topics says , I must pay the FEE twice ? ( once for setting order and once for closing )

TNX

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)

Thank you ishuen so much .