From 77ef3240cd17b932f499a19e7820e39818cf1aa9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 22 Feb 2020 11:16:20 +0100 Subject: [PATCH] Implement log messages --- freqtrade/freqtradebot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index d9126370b..4b54b79e1 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -246,9 +246,10 @@ class FreqtradeBot: :return: float: Price """ if not refresh: - rate = self._sell_rate_cache.get(pair) + rate = self._buy_rate_cache.get(pair) # Check if cache has been invalidated if rate: + logger.info(f"Using cached buy rate for {pair}.") return rate config_bid_strategy = self.config.get('bid_strategy', {}) @@ -577,7 +578,7 @@ class FreqtradeBot: """ Sends rpc notification when a buy cancel occured. """ - current_rate = self.get_buy_rate(trade.pair, True) + current_rate = self.get_buy_rate(trade.pair, False) msg = { 'type': RPCMessageType.BUY_CANCEL_NOTIFICATION, @@ -640,6 +641,7 @@ class FreqtradeBot: rate = self._sell_rate_cache.get(pair) # Check if cache has been invalidated if rate: + logger.info(f"Using cached sell rate for {pair}.") return rate config_ask_strategy = self.config.get('ask_strategy', {}) @@ -1078,7 +1080,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) - current_rate = self.get_sell_rate(trade.pair, True) + current_rate = self.get_sell_rate(trade.pair, False) profit_percent = trade.calc_profit_ratio(profit_rate) gain = "profit" if profit_percent > 0 else "loss"