Update telegram to sort performance by absolute performance

This commit is contained in:
Matthias
2021-05-15 19:49:21 +02:00
parent 6b2a38ccfb
commit 2d7735ba04
3 changed files with 11 additions and 8 deletions

View File

@@ -711,8 +711,11 @@ class Telegram(RPCHandler):
trades = self._rpc._rpc_performance()
output = "<b>Performance:</b>\n"
for i, trade in enumerate(trades):
stat_line = (f"{i+1}.\t <code>{trade['pair']}\t{trade['profit']:.2f}% "
f"({trade['count']})</code>\n")
stat_line = (
f"{i+1}.\t <code>{trade['pair']}\t"
f"{round_coin_value(trade['profit_abs'], self._config['stake_currency'])} "
f"({trade['profit']:.2f}%) "
f"({trade['count']})</code>\n")
if len(output + stat_line) >= MAX_TELEGRAM_MESSAGE_LENGTH:
self._send_msg(output, parse_mode=ParseMode.HTML)