From 7b9dd8424be086349ddda79050a3091eab588c02 Mon Sep 17 00:00:00 2001 From: ZerGo0 <18653821+ZerGo0@users.noreply.github.com> Date: Sat, 21 Aug 2021 13:18:59 +0200 Subject: [PATCH] Added buy_tag to Telegram sell messages and Backtest LocalTrade model --- freqtrade/freqtradebot.py | 4 ++-- freqtrade/persistence/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index e7a2a3784..ea38e3b97 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1181,7 +1181,7 @@ class FreqtradeBot(LoggingMixin): 'current_rate': current_rate, 'profit_amount': profit_trade, 'profit_ratio': profit_ratio, - 'sell_reason': trade.sell_reason, + 'sell_reason': trade.sell_reason + (f' ({trade.buy_tag})' if trade.buy_tag else ''), 'open_date': trade.open_date, 'close_date': trade.close_date or datetime.utcnow(), 'stake_currency': self.config['stake_currency'], @@ -1224,7 +1224,7 @@ class FreqtradeBot(LoggingMixin): 'current_rate': current_rate, 'profit_amount': profit_trade, 'profit_ratio': profit_ratio, - 'sell_reason': trade.sell_reason, + 'sell_reason': trade.sell_reason + (f' ({trade.buy_tag})' if trade.buy_tag else ''), 'open_date': trade.open_date, 'close_date': trade.close_date, 'stake_currency': self.config['stake_currency'], diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 5eaca7966..e8674007f 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -324,7 +324,7 @@ class LocalTrade(): 'profit_pct': round(self.close_profit * 100, 2) if self.close_profit else None, 'profit_abs': self.close_profit_abs, - 'sell_reason': self.sell_reason, + 'sell_reason': self.sell_reason + (f' ({self.buy_tag})' if self.buy_tag else ''), 'sell_order_status': self.sell_order_status, 'stop_loss_abs': self.stop_loss, 'stop_loss_ratio': self.stop_loss_pct if self.stop_loss_pct else None,