Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BadRequest error when using the /stats command #763

Closed
alangrima opened this issue Jan 26, 2023 · 5 comments
Closed

BadRequest error when using the /stats command #763

alangrima opened this issue Jan 26, 2023 · 5 comments

Comments

@alangrima
Copy link

Following a market scan, using the /stats command generates a BadRequest error:

argument of type 'BadRequest' is not iterable
2023-01-26 12:43:23,604 - telegram.helper - ERROR - Exception while handling an update:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/telegram/ext/dispatcher.py", line 555, in process_update
handler.handle_update(update, self, check, context)
File "/usr/local/lib/python3.9/dist-packages/telegram/ext/conversationhandler.py", line 626, in handle_update
new_state = handler.handle_update(update, dispatcher, check_result, context)
File "/usr/local/lib/python3.9/dist-packages/telegram/ext/handler.py", line 198, in handle_update
return self.callback(update, context)
File "/home/ubuntu/pycryptobot_7.31/pycryptobot/telegram_bot.py", line 388, in stats_pair_received
self.helper.send_telegram_message(update, output, context=context)
File "/home/ubuntu/pycryptobot_7.31/pycryptobot/models/telegram/helper.py", line 173, in send_telegram_message
context.bot.send_message(
File "/usr/local/lib/python3.9/dist-packages/telegram/bot.py", line 130, in decorator
result = func(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/telegram/bot.py", line 513, in send_message
return self._message( # type: ignore[return-value]
File "/usr/local/lib/python3.9/dist-packages/telegram/ext/extbot.py", line 199, in _message
result = super()._message(
File "/usr/local/lib/python3.9/dist-packages/telegram/bot.py", line 332, in _message
result = self._post(endpoint, data, timeout=timeout, api_kwargs=api_kwargs)
File "/usr/local/lib/python3.9/dist-packages/telegram/bot.py", line 295, in _post
return self.request.post(
File "/usr/local/lib/python3.9/dist-packages/telegram/utils/request.py", line 356, in post
result = self._request_wrapper(
File "/usr/local/lib/python3.9/dist-packages/telegram/utils/request.py", line 279, in _request_wrapper
raise BadRequest(message)

@whittlem
Copy link
Owner

I may have fixed this already. Can you tell me the exact command and config you are using?

@alangrima
Copy link
Author

Just updated but still getting the same error
This happens when running the /stats command for a pair on binance selected by the scanner. It also seems that the data.json does not contain any details.

Here is the config:

{
"binance": {
"api_url": "https://api.binance.com",
"config": {
"autorestart": 1,
"base_currency": "ETH",
"disablebuynearhigh": 1,
"enableinsufficientfundslogging": 1,
"enabletelegrambotcontrol": 1,
"granularity": "15m",
"live": 0,
"nobuynearhighpcnt": 1,
"nosellmaxpcnt": 3,
"nosellminpcnt": -9,
"quote_currency": "EUR",
"sellatresistance": 1,
"selllowerpcnt": -12,
"telegram": 1,
"trailingbuypcnt": 1,
"trailingstoploss": -1,
"trailingstoplosstrigger": 3,
"verbose": 0,
"websocket": 0,
"enable_pandas_ta": 1,
"autorestart": 1,
"graphs": 0,
"verbose": 1,
"stats": 0,
"enableinsufficientfundslogging": 1,
"enabletelegrambotcontrol": 1,
"disablelog": 0,
"buymaxsize": 20,
"buylastsellsize": 0,
"buyminsize": 0,
"sellsmartswitch": 0,
"granularity": 300
},
"api_key_file": "binance.key"
},
"coinbasepro": {
"api_url": "https://api.exchange.coinbase.com",
"config": {
"autorestart": 1,
"base_currency": "SHIB",
"disablebuynearhigh": 1,
"enableinsufficientfundslogging": 1,
"enabletelegrambotcontrol": 1,
"granularity": "15m",
"live": 0,
"nobuynearhighpcnt": 1,
"nosellmaxpcnt": 3,
"nosellminpcnt": -9,
"quote_currency": "EUR",
"sellatresistance": 1,
"selllowerpcnt": -12,
"telegram": 1,
"trailingbuypcnt": 1,
"trailingstoploss": -1,
"trailingstoplosstrigger": 3,
"verbose": 0,
"websocket": 0
},
"api_key_file": "coinbasepro.key"
},
"telegram" : {
"token" : "token",
"client_id" : "clientid",
"user_id" : "userid"
},
"scanner": {
"atr72_pcnt": 1.0,
"use_default_scanner": 1,
"enableexitaftersell": 1,
"enableleverage": 0,
"maxbotcount": 5,
"autoscandelay": 6,
"enable_buy_next": 1
}
}

@whittlem
Copy link
Owner

Ok, so you mean via the Telegram bot? You run /stats and you get an error?

@whittlem
Copy link
Owner

whittlem commented Feb 4, 2023

I have been able to re-create the issue but it's a bit of a strange case.

@whittlem
Copy link
Owner

whittlem commented Feb 5, 2023

It's fixed in v7.0.34

@whittlem whittlem closed this as completed Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants