1

I'm not able to place the below order:

symbolTicker = 'SHIBUSDT'
orderPriceBuy = 0.00002650
orderPriceSell = 0.00002700

Code:

 buyOrder = client.create_order(
                    symbol=symbolTicker,
                    side=SIDE_BUY,
                    type=ORDER_TYPE_LIMIT,
                    timeInForce=TIME_IN_FORCE_GTC,
                    quantity=orderQuantityBuy,
                    price=orderPriceBuy)

Error:

raise BinanceAPIException(response, response.status_code, response.text)
binance.exceptions.BinanceAPIException: APIError(code=-1100): Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(\.[0-9]{1,20})?$'.

What seems to be wrong?

Cassano
  • 253
  • 5
  • 36

1 Answers1

1

As the error stated the order prices need to be given as a string not as a number. It also showed you the RegEx of the legal range (which is quite nice). Note: You can't use numbers within RegEx and because the package does do RegEx checking it needs also a string. Furthermore you can also check the docs of the package where it is surely documented.

Kalle
  • 150
  • 6