I use the library python-binance.
When I connect my binance client, if I try to make a SHORT order, If Hedge mode is not active (more about Hedge mode activation) I got the following error :
binance.exceptions.BinanceAPIException: APIError(code=-4061): Order's position side does not match user's setting.
The code :
from binance.client import Client
client = Client(
api_key,
api_secret,
)
# Here : I want to get if client accoutn has hedge mode enable or not like :
# hedge_mode = client.get_hedge_mode_active() <--- This method does not exists on library
order = client.futures_create_order(
symbol = "XRPUSDT",
side = SIDE_BUY,
positionSide = "SHORT",
type = ORDER_TYPE_MARKET,
quantity = 500,
)