From 9b86054f6ae2a787bafa762a8ec64d7d1ba9c970 Mon Sep 17 00:00:00 2001 From: Kavinkumar <33546454+mkavinkumar1@users.noreply.github.com> Date: Thu, 10 Mar 2022 23:20:20 +0530 Subject: [PATCH] Update telegram.py --- freqtrade/rpc/telegram.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 3f0e0e030..057eee9a0 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -287,8 +287,8 @@ class Telegram(RPCHandler): f"{msg['profit_extra']}") is_fill = msg['type'] == RPCMessageType.SELL_FILL is_sub_profit = msg['profit_amount'] != msg.get('cumulative_profit') - profit_prefix = 'Sub ' if is_sub_profit else 'Cumulative ' if sub_trade else '' - if is_sub_profit and sub_trade: + profit_prefix = ('Sub ' if is_sub_profit else 'Cumulative ') if msg['sub_trade'] else '' + if is_sub_profit and msg['sub_trade']: if self._rpc._fiat_converter: cp_fiat = self._rpc._fiat_converter.convert_amount( msg['cumulative_profit'], msg['stake_currency'], msg['fiat_currency']) @@ -301,7 +301,7 @@ class Telegram(RPCHandler): message = ( f"{msg['emoji']} *{msg['exchange']}:* " f"{'Sold' if is_fill else 'Selling'} {msg['pair']} (#{msg['trade_id']})\n" - f"*{f'{profit__prefix}Profit' if is_fill else f'Unrealized {profit_prefix}Profit'}:* " + f"*{f'{profit_prefix}Profit' if is_fill else f'Unrealized {profit_prefix}Profit'}:* " f"`{msg['profit_ratio']:.2%}{msg['profit_extra']}`\n" f"{cp_extra}" f"*Buy Tag:* `{msg['buy_tag']}`\n"