From 2bf5a3843da848d45669bd98b764991d62d476e3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 13 Mar 2019 19:41:58 +0100 Subject: [PATCH] Use close_rate for notification if available --- freqtrade/freqtradebot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index f6662e062..2eecb5802 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -855,9 +855,10 @@ class FreqtradeBot(object): """ Sends rpc notification when a sell occured. """ - profit_trade = trade.calc_profit(rate=trade.close_rate_requested) + profit_rate = trade.close_rate if trade.close_rate else trade.close_rate_requested + profit_trade = trade.calc_profit(rate=profit_rate) current_rate = self.exchange.get_ticker(trade.pair)['bid'] - profit_percent = trade.calc_profit_percent(trade.close_rate_requested) + profit_percent = trade.calc_profit_percent(profit_rate) gain = "profit" if profit_percent > 0 else "loss" msg = {