From 3b54e1e746ac75bfdcbb94b04b69d44d50d510a3 Mon Sep 17 00:00:00 2001 From: Stefano Ariestasia Date: Tue, 9 Jan 2024 14:17:35 +0900 Subject: [PATCH] add Try block to catch the failure on using FullTradesFilter on non-dry/live run --- freqtrade/plugins/pairlist/FullTradesFilter.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/freqtrade/plugins/pairlist/FullTradesFilter.py b/freqtrade/plugins/pairlist/FullTradesFilter.py index 69779d896..9d435c3a9 100644 --- a/freqtrade/plugins/pairlist/FullTradesFilter.py +++ b/freqtrade/plugins/pairlist/FullTradesFilter.py @@ -48,8 +48,13 @@ class FullTradesFilter(IPairList): :return: new allowlist """ # Get the number of open trades and max open trades config - num_open = Trade.get_open_trade_count() - max_trades = self._config['max_open_trades'] + try: + num_open = Trade.get_open_trade_count() + max_trades = self._config['max_open_trades'] + except AttributeError: + # Performancefilter does not work in backtesting. + self.log_once("FullTradesFilter is not available in this mode.", logger.warning) + return pairlist if (num_open >= max_trades) and (max_trades > 0): return []