CryptoGnome / Tradingview-Webhook-Bot

A Trading bot built using Flask & Python to that is designed to be hosted for free on Heroku, this bot can accept webhooks from Tradingview and place trades on multiple crypto exchanges.
147 stars 49 forks source link

Error when entering a trade #2

Closed klaichich closed 2 years ago

klaichich commented 2 years ago

Hello, i have done everything correctly following your guide, but every time the order is sent to the Exchange, I get these errors: [2022-07-01 12:26:22,848] ERROR in app: Exception on /webhook [POST] 2022-07-01T12:26:22.848692+00:00 app[web.1]: Traceback (most recent call last): 2022-07-01T12:26:22.848692+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 2077, in wsgi_app 2022-07-01T12:26:22.848693+00:00 app[web.1]: response = self.full_dispatch_request() 2022-07-01T12:26:22.848693+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1525, in full_dispatch_request 2022-07-01T12:26:22.848694+00:00 app[web.1]: rv = self.handle_user_exception(e) 2022-07-01T12:26:22.848694+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1523, in full_dispatch_request 2022-07-01T12:26:22.848694+00:00 app[web.1]: rv = self.dispatch_request() 2022-07-01T12:26:22.848694+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/flask/app.py", line 1509, in dispatch_request 2022-07-01T12:26:22.848695+00:00 app[web.1]: return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) 2022-07-01T12:26:22.848695+00:00 app[web.1]: File "/app/app.py", line 159, in webhook 2022-07-01T12:26:22.848696+00:00 app[web.1]: bot.run(data) 2022-07-01T12:26:22.848696+00:00 app[web.1]: File "/app/binanceFutures.py", line 182, in run 2022-07-01T12:26:22.848697+00:00 app[web.1]: self.set_risk(data['symbol'], data, stop_loss_price, take_profit_price) 2022-07-01T12:26:22.848697+00:00 app[web.1]: File "/app/binanceFutures.py", line 70, in set_risk 2022-07-01T12:26:22.848697+00:00 app[web.1]: position = exchange.fetch_positions(symbol) 2022-07-01T12:26:22.848697+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ccxt/binance.py", line 4969, in fetch_positions 2022-07-01T12:26:22.848698+00:00 app[web.1]: return self.fetch_positions_risk(symbols, params) 2022-07-01T12:26:22.848698+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/ccxt/binance.py", line 5010, in fetch_positions_risk 2022-07-01T12:26:22.848698+00:00 app[web.1]: raise ArgumentsRequired(self.id + ' fetchPositionsRisk() requires an array argument for symbols') 2022-07-01T12:26:22.848698+00:00 app[web.1]: ccxt.base.errors.ArgumentsRequired: binance fetchPositionsRisk() requires an array argument for symbols 2022-07-01T12:26:22.849543+00:00 app[web.1]: 10.1.12.232 - - [01/Jul/2022:12:26:22 +0000] "POST /webhook HTTP/1.1" 500 265 "-" "Go-http-client/1.1"

CryptoGnome commented 2 years ago

seems like you are sending it the incorrect symbol?

CryptoGnome commented 2 years ago

Please resintall now and let me know if this is fixed