From 95327750dca68592d552e9cbe59347435d2f7fac Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 4 Aug 2022 07:07:54 +0200 Subject: [PATCH] Final abs. profit should not be doubled in rpc messages --- freqtrade/freqtradebot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 757449c8c..657e0bd82 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1566,7 +1566,7 @@ class FreqtradeBot(LoggingMixin): profit_ratio = trade.calc_profit_ratio(profit_rate, amount, trade.open_rate) else: profit_rate = trade.close_rate if trade.close_rate else trade.close_rate_requested - profit = trade.calc_profit(rate=profit_rate) + trade.realized_profit + profit = trade.calc_profit(rate=profit_rate) + (0.0 if fill else trade.realized_profit) profit_ratio = trade.calc_profit_ratio(profit_rate) amount = trade.amount gain = "profit" if profit_ratio > 0 else "loss"