binance-trade-bot icon indicating copy to clipboard operation
binance-trade-bot copied to clipboard

APIError(code=-1100): Illegal characters found in parameter 'price'

Open techn0tr0ll opened this issue 3 years ago • 7 comments

The bot is printing this error, while trying to buy coins

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

techn0tr0ll avatar Oct 30 '21 10:10 techn0tr0ll

for me too...

israelins85 avatar Nov 04 '21 15:11 israelins85

Debuging I saw price as 4.403e-05

israelins85 avatar Nov 04 '21 15:11 israelins85

Mmhh... The weird thing is, that the printed api request (?) in the bot does not show this format... But I'm not sure, if this the original request body content

Here is the example of this request "body" :

{'symbol': '******', 'orderId': ****, 'orderListId': -1, 'clientOrderId': '*******', 'transactTime': 1636040436845, 'price': '2.57450000', 'origQty':******', 'executedQty': '0.00000000', 'cummulativeQuoteQty': '0.00000000', 'status': 'NEW', 'timeInForce': 'GTC', 'type': 'LIMIT', 'side': 'SELL', 'fills': []}

techn0tr0ll avatar Nov 04 '21 16:11 techn0tr0ll

At binance_api_manager.py:263 add this line rounded_from_coin_price = format(from_coin_price, '.20f').rstrip('0').rstrip('.')

change the line 265 to self.logger.info(f"BUY QTY {order_quantity} of <{origin_symbol}> for price {rounded_from_coin_price}")

change the line 275 to price=rounded_from_coin_price,

israelins85 avatar Nov 04 '21 16:11 israelins85

I made a pull request for this #439

israelins85 avatar Nov 04 '21 17:11 israelins85

Same problem, running for first time today. Problem was with SHIB.

ikito avatar Nov 11 '21 17:11 ikito

Applying the patch solves the issue on my side.HTH! Too many SHIB recently :)

kooltux avatar Nov 12 '21 00:11 kooltux