From f09af888b153794ff135de9acedf493666124e9c Mon Sep 17 00:00:00 2001 From: Yazeed Al Oyoun Date: Wed, 12 Feb 2020 21:55:38 +0100 Subject: [PATCH] modified get_buy/sell_rate refresh to true on notify_sell_cancel and notify_buy_cancel --- freqtrade/freqtradebot.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 455396352..158b631c1 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -566,7 +566,7 @@ class FreqtradeBot: """ Sends rpc notification when a buy cancel occured. """ - current_rate = self.get_buy_rate(trade.pair, False) + current_rate = self.get_buy_rate(trade.pair, True) msg = { 'type': RPCMessageType.BUY_CANCEL_NOTIFICATION, @@ -1062,8 +1062,7 @@ class FreqtradeBot: """ profit_rate = trade.close_rate if trade.close_rate else trade.close_rate_requested profit_trade = trade.calc_profit(rate=profit_rate) - # Use cached ticker here - it was updated seconds ago. - current_rate = self.get_sell_rate(trade.pair, False) + current_rate = self.get_sell_rate(trade.pair, True) profit_percent = trade.calc_profit_ratio(profit_rate) gain = "profit" if profit_percent > 0 else "loss"