diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 1db28546e..0e1a6fe27 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -686,10 +686,16 @@ class Telegram(RPCHandler): count['losses'] ] for reason, count in stats['sell_reasons'].items() ] - sell_reasons_msg = tabulate( - sell_reasons_tabulate, - headers=['Sell Reason', 'Sells', 'Wins', 'Losses'] - ) + sell_reasons_msg = 'No trades yet.' + for reason in chunks(sell_reasons_tabulate, 25): + sell_reasons_msg = tabulate( + reason, + headers=['Sell Reason', 'Sells', 'Wins', 'Losses'] + ) + if len(sell_reasons_tabulate) > 25: + self._send_msg(sell_reasons_msg, ParseMode.MARKDOWN) + sell_reasons_msg = '' + durations = stats['durations'] duration_msg = tabulate( [ diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index 95a2f4549..1247affae 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -731,7 +731,7 @@ def test_telegram_stats(default_conf, update, ticker, ticker_sell_up, fee, telegram._stats(update=update, context=MagicMock()) assert msg_mock.call_count == 1 - # assert 'No trades yet.' in msg_mock.call_args_list[0][0][0] + assert 'No trades yet.' in msg_mock.call_args_list[0][0][0] msg_mock.reset_mock() # Create some test data