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 )


For your first question, there is no dedicated endpoint for closing a position. But you can make use of closePosition attribute to do so.
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 .

Hey, the way I do it is I create an opposite order and make sure to set REDUCE ONLY so you don’t end up with an accidental opposite order

1 Like

how to put the syntax REDUCE ONLY

Set reduceOnly=true