From 6d2afdb1466eb097968280928b0e05dccf8784d1 Mon Sep 17 00:00:00 2001 From: Gert Wohlgemuth Date: Thu, 3 May 2018 02:18:35 -0700 Subject: [PATCH] added support for showing the exposed real value on the count table (#634) --- freqtrade/rpc/telegram.py | 5 +++-- freqtrade/tests/rpc/test_rpc_telegram.py | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 81749d778..086c408ac 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -357,8 +357,9 @@ class Telegram(RPC): message = tabulate({ 'current': [len(trades)], - 'max': [self._config['max_open_trades']] - }, headers=['current', 'max'], tablefmt='simple') + 'max': [self._config['max_open_trades']], + 'total stake': [sum((trade.open_rate * trade.amount) for trade in trades)] + }, headers=['current', 'max', 'total stake'], tablefmt='simple') message = "
{}
".format(message) logger.debug(message) self.send_msg(message, parse_mode=ParseMode.HTML) diff --git a/freqtrade/tests/rpc/test_rpc_telegram.py b/freqtrade/tests/rpc/test_rpc_telegram.py index 86dfd6f41..72408c908 100644 --- a/freqtrade/tests/rpc/test_rpc_telegram.py +++ b/freqtrade/tests/rpc/test_rpc_telegram.py @@ -1001,9 +1001,12 @@ def test_count_handle(default_conf, update, ticker, mocker) -> None: msg_mock.reset_mock() telegram._count(bot=MagicMock(), update=update) - msg = '
  current    max\n---------  -----\n        1      {}
'.format( - default_conf['max_open_trades'] - ) + msg = '
  current    max    total stake\n---------  -----  -------------\n' \
+          '        1      {}          {}
'\ + .format( + default_conf['max_open_trades'], + default_conf['stake_amount'] + ) assert msg in msg_mock.call_args_list[0][0][0]