sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.89k stars 2.2k forks source link

STOP_MARKET does not work well with futures_create_order and binance testnet #1317

Open ArronHsiao opened 1 year ago

ArronHsiao commented 1 year ago

Hello!

I'm attempting to use client.futures_create_order to place a closePosition="true" STOP_MARKET order on Binance testnet. However, I'm frequently encountering an error message that reads: "binance.exceptions.BinanceAPIException: APIError(code=-1103): param quantity not found.". It works time to time but fails often..

Here's the code I'm using:

order_stop = client.futures_create_order( symbol="BTCUSDT", side = "SELL", type = "STOP_MARKET",
workingType= "MARK_PRICE", stopPrice=stop_loss_price, closePosition="true" )

Could you please help me understand why I'm receiving this error message and what I can do to resolve it?

Thank you for your assistance!

Environment (please complete the following information):