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

Error when creating a market order BTCUSDT

Open Encrypted-Future opened this issue 2 years ago • 2 comments

When I run: client.order_market_buy(symbol='BTCUSDT', quoteOrderQty=50) I receive this error APIError(code=-1013): Quote order qty market orders are not supported for this symbol.

How can I fix it?

Encrypted-Future avatar Jul 25 '23 10:07 Encrypted-Future

You can't. That error is returned by Binance.

To find out whether a symbol can be traded with quoteOrderQty:

API users can query via api/v3/exchangeInfo. When it returns with "quoteOrderQtyMarketAllowed:False", it means that the Market Order - Total feature is suspended for the trading pair.

halfelf avatar Jul 27 '23 09:07 halfelf

When I run: client.order_market_buy(symbol='BTCUSDT', quoteOrderQty=50) I receive this error APIError(code=-1013): Quote order qty market orders are not supported for this symbol.

How can I fix it?

For Futures,

client.futures_create_order( symbol='BTCUSDT', type='MARKET', side='BUY', # Direction ('BUY' / 'SELL'), string quantity=quantity # Number of coin2 you wish to buy / sell, float )

probably should change quoteOrderQty to quantity

tempestblaze avatar Aug 11 '23 15:08 tempestblaze