Add test and fix case where no trades were closed yet

This commit is contained in:
Matthias
2020-07-23 07:12:14 +02:00
parent 0bad55637e
commit 0f18b2a0d4
2 changed files with 35 additions and 3 deletions

View File

@@ -527,7 +527,8 @@ class Telegram(RPC):
f'Profit ({stake_cur})',
],
tablefmt='simple')
message = f'<b>{nrecent} recent trades</b>:\n<pre>{trades_tab}</pre>'
message = (f"<b>{min(trades['trades_count'], nrecent)} recent trades</b>:\n"
+ (f"<pre>{trades_tab}</pre>" if trades['trades_count'] > 0 else ''))
self._send_msg(message, parse_mode=ParseMode.HTML)
except RPCException as e:
self._send_msg(str(e))