binance-futures-connector-python
binance-futures-connector-python copied to clipboard
Order's position side does not match user's setting
I get error message even when dualSidePosition = True
from binance.um_futures import UMFutures
key = 'abcd'
secret = 'efgh'
base_url = "https://testnet.binancefuture.com"
um_futures_client = UMFutures(key=key, secret=secret, base_url=base_url)
dualSidePosition = True
positionSide = 'BOTH'
print(um_futures_client.get_position_mode())
#print(um_futures_client.account())
def futures_change_position_mode():
return um_futures_client(dualSidePosition= True)
response = um_futures_client.new_order(
symbol="BTCUSDT",
side="SELL",
type="MARKET",
quantity=0.001,
)
response = um_futures_client.new_order(
symbol="BTCUSDT",
side="BUY",
type="MARKET",
quantity=0.001,
)
@Daanish283 i Fix this error using
response = um_futures_client.new_order(
symbol="TRXUSDT",
side="BUY",
type="LIMIT",
quantity=393,
timeInForce="GTC",
price=0.06356,
**positionSide**="LONG"
)
i have to add positionSide
- Please confirm which position mode you are staying with:
hedgeorone-way.- GET /fapi/v1/positionSide/dual -
- Place the order with correct parameters
- If you are working
hedgemode, this topic tells how to place order. https://dev.binance.vision/t/enable-hedge-mode-on-futures-api/59
- If you are working