parent
6555454bd2
commit
5f6eae52a2
@ -695,14 +695,18 @@ class Telegram(RPCHandler):
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
trades = self._rpc._rpc_performance()
|
trades = self._rpc._rpc_performance()
|
||||||
stats = '\n'.join('{index}.\t<code>{pair}\t{profit:.2f}% ({count})</code>'.format(
|
output = "<b>Performance:</b>\n"
|
||||||
index=i + 1,
|
for i, trade in enumerate(trades):
|
||||||
pair=trade['pair'],
|
stat_line = (f"{i+1}.\t <code>{trade['pair']}\t{trade['profit']:.2f}% "
|
||||||
profit=trade['profit'],
|
f"({trade['count']})</code>\n")
|
||||||
count=trade['count']
|
|
||||||
) for i, trade in enumerate(trades))
|
if len(output + stat_line) >= MAX_TELEGRAM_MESSAGE_LENGTH:
|
||||||
message = '<b>Performance:</b>\n{}'.format(stats)
|
self._send_msg(output)
|
||||||
self._send_msg(message, parse_mode=ParseMode.HTML)
|
output = stat_line
|
||||||
|
else:
|
||||||
|
output += stat_line
|
||||||
|
|
||||||
|
self._send_msg(output, parse_mode=ParseMode.HTML)
|
||||||
except RPCException as e:
|
except RPCException as e:
|
||||||
self._send_msg(str(e))
|
self._send_msg(str(e))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user