I am using the Python library to disable hedge mode and then place an order. No matter if I set positionSide to LONG or BOTH, it always changes dualSidePosition
to True
after an order execution. I checked both in test and mainnet. Can you please tell why is it happening?
Which library are you using?
Can you shared code example for Futures Testnet, so that we can see if we can reproduce on our side, please? We need more details on the steps.
Python Binance. BTW you do not need any lib, even if you go to the Interface of Binance of both Test and Mainnet and make either a short or long order, it will turn to HEDGE MODE once order is placed.
If you “disable hedge mode” and GET https://testnet.binancefuture.com/fapi/v1/positionSide/dual
gives you:
{
“dualSidePosition”: false
}
You won’t be able to execute order with positionSide=LONG
or positionSide=SHORT
, it’ll throw error:
{
“code”: -4061,
“msg”: “Order’s position side does not match user’s setting.”
}
because you’re One-Way mode and LONG/SHORT is only for hedge mode, from API doc:
LONG
orSHORT
for Hedge Mode. It must be sent in Hedge Mode.
If you were able to submit order with LONG/SHORT, then it means you have Hedge Mode enabled before submitting the order. Make sure of your Position Mode during each step.