added support for showing the exposed real value on the count table (#634)

This commit is contained in:
Gert Wohlgemuth 2018-05-03 02:18:35 -07:00 committed by Michael Egger
parent bddf009a2b
commit 6d2afdb146
2 changed files with 9 additions and 5 deletions

View File

@ -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 = "<pre>{}</pre>".format(message)
logger.debug(message)
self.send_msg(message, parse_mode=ParseMode.HTML)

View File

@ -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 = '<pre> current max\n--------- -----\n 1 {}</pre>'.format(
default_conf['max_open_trades']
)
msg = '<pre> current max total stake\n--------- ----- -------------\n' \
' 1 {} {}</pre>'\
.format(
default_conf['max_open_trades'],
default_conf['stake_amount']
)
assert msg in msg_mock.call_args_list[0][0][0]