I’m trying to post new order on Binance Futures Testnet and get error -2019 margin is insufficient
. I looked at my account and there are available $14k. I try to post order for XRPUSD, quantity = 1000, price=0.62. I use python-binance-futures-connector lib.
try:
response = cm_futures_client.new_order(
symbol="XRPUSD_PERP",
side="BUY",
type="LIMIT",
positionSide="BOTH",
quantity=100,
reduceOnly=False,
timeInForce="GTC",
price=0.6280
)
return response
except ClientError as error:
print("Exception:")
message = "Found error. status: {}, error code: {}, error message: {}".format(
error.status_code, error.error_code, error.error_message)
print(message)
Also I have problem with using float quantity. It occurs error -1111, error message: Precision is over the maximum defined for this asset.
I tried to use this code but nothing changes
quantity = float(round(100.051, 2))