After sending an order “long market order” (which should be excecuted right away?), then after sending immediatly a StopLoss order, I receive the following respone:
{“code”:-1111,“msg”:“Precision is over the maximum defined for this asset.”}
This only occurs when sending a StopLoss for BTCUSD_PERP, not if I use the ETHUSD_PERP or BNBUSD_PERP. Any clue how to solve this? My order information is:
def order_long_market(symbol, Qty, TakeProfit, StopLoss):
global payload, Order_ID, calculated_Qty, SL_check
payload = {“symbol”: symbol,
“side”: “BUY”,
“positionSide”: “LONG”,
“type”: “MARKET”,
#“newClientOrderId”: “PythonLongMarket”,
“quantity”: Qty,
“timestamp”: 0
}
post_command(‘https://dapi.binance.com/dapi/v1/order’)
And my StopLoss command is the following:
def SL_long(symbol, StopLoss):
global payload
print(“Setting SL”)
payload = {“symbol”: symbol,
“side”: “SELL”,
“positionSide”: “LONG”,
“type”: “STOP_MARKET”,
“timeInForce”: “GTC”,
“OrderId”: “0”,
#“newClientOrderId”: “PythonStopLoss”,
“closePosition”: “true”,
“stopPrice”: 0,
#“quantity”: calculated_Qty,
“timestamp”: 0
}
payload[‘stopPrice’] = StopLoss
post_command(‘https://dapi.binance.com/dapi/v1/order’)
Thanks in advance!