When sending a SELL order in a LONG position (reducing the position), I got the following error:
Exceeded the maximum allowable position at current leverage.
I can understand that if you increase a position you can have this error but it does not make any sense to me to have this error when reducing a position. Due to this the order didnt get executed. Can anybody explain this? It happened in a period with a lot of volatility so maybe the error was other but API answered that?
A one-way margin account may create a short position by placing a SELL order, therefore the error received may be encountered when placing a SELL order.
If your intention is to reduce your position, and not open a position in the opposite direction, set the
reduceOnly parameter to true
The account is using hedge mode so the orders are already reduce only:
Position_side = LONG
side = SELL
This would never open a short but reduce the position. For that reason the error does not make sense.
Was this a one-time occurrence or are you still unable to place the order?
I could send the order again just after the error… but this already happened two times in different positions. They are big orders, around 300k$, my theory is that the order book gets empty and binance protects the sell market order from getting really bad prices (-5%) or so. If is that message should be updated.
The reason that you were not able to send a reduced only order was that your notional value was higher than allow for the leverage.
To calculate, please use this formula:
MAX(BUY positions + BUY order - SELL order, SELL positions +SELL order - BUY order)
Please note that BUY amounts are positives and SELL amounts is negative
You can check the max amount allow for each leverage level here: Leverage & Margin of Futures Contracts | Binance Futures
But do you realize it does not make sense what you are saying right? You say I can not reduce a position because the notional value is higher than allow for the leverage, then what I am supposed to do? leave there the position for always?
The scenario I guess is the next:
- Open a LONG with notional value 80k.
- Coinsgoes up, notional value is 120k now but leverage only allows 100k position.
- I send SELL to reduce position but because notional is higher I cannot reduce the position?
Or I am missing something or this does not make any sense to me.
Probably you are unable to place a reduce only because you have another Sell order already placed, and you are trying to place a more aggressive order.
Please check if you not have any other SELL order pending