Fix telegram profit stats when fiat_display_currency is not set

This commit is contained in:
mrpabloyeah
2025-06-01 13:53:17 +02:00
parent d1cca4ac51
commit c4eb26be9d

View File

@@ -1044,12 +1044,15 @@ class Telegram(RPCHandler):
else:
# Message to display
if stats["closed_trade_count"] > 0:
fiat_closed_trades = (
f"∙ `{fmt_coin(profit_closed_fiat, fiat_disp_cur)}`\n" if fiat_disp_cur else ""
)
markdown_msg = (
"*ROI:* Closed trades\n"
f"∙ `{fmt_coin(profit_closed_coin, stake_cur)} "
f"({profit_closed_ratio_mean:.2%}) "
f"({profit_closed_percent} \N{GREEK CAPITAL LETTER SIGMA}%)`\n"
f"∙ `{fmt_coin(profit_closed_fiat, fiat_disp_cur)}`\n"
f"{fiat_closed_trades}"
)
else:
markdown_msg = "`No closed trade` \n"