binance-futures-connector-python icon indicating copy to clipboard operation
binance-futures-connector-python copied to clipboard

Order's position side does not match user's setting

Open Daanish283 opened this issue 3 years ago • 2 comments

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 avatar Jun 25 '22 14:06 Daanish283

@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

pcastelo avatar Jun 30 '22 00:06 pcastelo

  • Please confirm which position mode you are staying with: hedge or one-way.
    • GET /fapi/v1/positionSide/dual -
  • Place the order with correct parameters
    • If you are working hedge mode, this topic tells how to place order. https://dev.binance.vision/t/enable-hedge-mode-on-futures-api/59

2pd avatar Jul 22 '22 11:07 2pd