From d849694a70ec4f66ea47c4d0a0ff434abd58ef49 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste LE STANG Date: Tue, 2 Jan 2018 14:43:38 +0100 Subject: [PATCH] Adding URL to market graph and number of trades/pair in /performance commande --- freqtrade/rpc/telegram.py | 3 ++- freqtrade/tests/rpc/test_rpc_telegram.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index e5e18ad5b..ef54bf8b5 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -476,9 +476,10 @@ def _performance(bot: Bot, update: Update) -> None: .order_by(text('profit_sum DESC')) \ .all() - stats = '\n'.join('{index}.\t{pair}\t{profit:.2f}% ({count})'.format( + stats = '\n'.join('{index}.\t[{pair}]({url})\t{profit:.2f}% ({count})'.format( index=i + 1, pair=pair, + url=exchange.get_pair_detail_url(pair), profit=round(rate * 100, 2), count=count ) for i, (pair, rate, count) in enumerate(pair_rates)) diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index 313e1e78a..dd91e847b 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -404,7 +404,7 @@ def test_performance_handle( _performance(bot=MagicMock(), update=update) assert msg_mock.call_count == 1 assert 'Performance' in msg_mock.call_args_list[0][0][0] - assert 'BTC_ETH\t6.20% (1)' in msg_mock.call_args_list[0][0][0] + assert '[BTC_ETH](https://www.bittrex.com/Market/Index?MarketName=BTC-ETH)\t6.20% (1)' in msg_mock.call_args_list[0][0][0] def test_daily_handle(