tradingview-webhooks-bot
tradingview-webhooks-bot copied to clipboard
TypeError: can't multiply sequence by non-int of type 'str'
First of all ı want to thank you for your project. Than ı have a problem while ı am sending a "market" order. When I change order type to "limit", it doesn't cause any problem, sending order correctly. How can ı fix this problem? Thanks for your help.
[Alert Received] POST Received: {'type': 'market', 'side': 'buy', 'amount': '1000', 'symbol': 'MATIC/USDT', 'price': 'None', 'key': '2b5d9b96dfb7c18841bbd50f822d7f0ef7172732943856016074fd7f'} Sending: MATIC/USDT market buy 1000 None [2020-04-06 09:55:20,811] ERROR in app: Exception on /webhook [POST] Traceback (most recent call last): File "C:\Anaconda3\lib\site-packages\flask\app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "C:\Anaconda3\lib\site-packages\flask_compat.py", line 39, in reraise raise value File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "C:\Anaconda3\lib\site-packages\flask\app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "C:\Users\Kahraman\Desktop\tradingview-webhooks-bot-master\tradingview-webhooks-bot\webhook-bot.py", line 38, in webhook send_order(data) File "C:\Users\Kahraman\Desktop\tradingview-webhooks-bot-master\tradingview-webhooks-bot\actions.py", line 53, in send_order data['symbol'], data['type'], data['side'], data['amount'], calc_price(data['price'])) File "C:\Anaconda3\lib\site-packages\ccxt\binance.py", line 1096, in create_order request['quoteOrderQty'] = self.decimal_to_precision(amount * price, TRUNCATE, precision, self.precisionMode) TypeError: can't multiply sequence by non-int of type 'str' 127.0.0.1 - - [06/Apr/2020 09:55:20] "POST /webhook HTTP/1.1" 500 -
Did you figure out what was wrong?
No I did not, can you help me?
hey, sorry for late reply, try changing: 'amount': '1000' to 'amount': 1000