Python-binance: client order_market_buy call is failing

Created on 11 Aug 2020  路  3Comments  路  Source: sammchardy/python-binance

The client order_market_buy call is failing with this error
binance.exceptions.BinanceAPIException: APIError(code=-1106): Parameter 'quoteOrderQty' sent when not required.

To Reproduce
api_test_key = 'sjdflkdsjf'
api_test_secret = 'klfdsajflk'
client = Client(api_test_key, api_test_secret)
client.API_URL = 'https://testnet.binance.vision/api'
client.order_market_buy(
quantity= 1,
quoteOrderQty = 10,
symbol='BTCUSDT')

Expected behavior
The order should be placed on the test chain and I should be able to inspect its status using its id.
According to documentation the quantity will be calculated based on the quoteOrderQty and the market availability.

Environment (please complete the following information):

  • Python version: 3.7.4
  • Catalina and windows 10
  • python-binance version v0.7.5

Most helpful comment

it is mentioned in several places, here's one of them: https://pypi.org/project/binance-connector-python/
also, placing a sell works fine, only placing a buy fails.

All 3 comments

Can you share the documentation part where it says that binance demo is supported?
AFAIK API works only for the live version.

it is mentioned in several places, here's one of them: https://pypi.org/project/binance-connector-python/
also, placing a sell works fine, only placing a buy fails.

I tested the code and I am having the same issue. The sell order works fine but the buy order status is EXPIRED.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fj317 picture fj317  路  6Comments

alexandre-a picture alexandre-a  路  4Comments

DaniZz picture DaniZz  路  3Comments

noahwoodin picture noahwoodin  路  8Comments

marzwu picture marzwu  路  4Comments