From 44bf59668b9531324ffa35d11f1fb66810a3b30a Mon Sep 17 00:00:00 2001 From: Bloodhunter4rc Date: Wed, 12 Apr 2023 13:16:53 +0200 Subject: [PATCH 1/2] prevents continous fetching every x bot_loop seconds , adheres to refresh_period, in case the pairlist returned from the remote end is empty. --- freqtrade/plugins/pairlist/RemotePairList.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/freqtrade/plugins/pairlist/RemotePairList.py b/freqtrade/plugins/pairlist/RemotePairList.py index 764c16f1a..0bf81c89d 100644 --- a/freqtrade/plugins/pairlist/RemotePairList.py +++ b/freqtrade/plugins/pairlist/RemotePairList.py @@ -142,7 +142,10 @@ class RemotePairList(IPairList): """ if self._init_done: - pairlist = self._pair_cache.get('pairlist') + if self._pair_cache.get('pairlist') == ["Empty"]: + return [] + else: + pairlist = self._pair_cache.get('pairlist') else: pairlist = [] @@ -181,7 +184,10 @@ class RemotePairList(IPairList): pairlist = self._whitelist_for_active_markets(pairlist) pairlist = pairlist[:self._number_pairs] - self._pair_cache['pairlist'] = pairlist.copy() + if pairlist: + self._pair_cache['pairlist'] = pairlist.copy() + else: + self._pair_cache['pairlist'] = ["Empty"] if time_elapsed != 0.0: self.log_once(f'Pairlist Fetched in {time_elapsed} seconds.', logger.info) From 84d2d5e2a636ea84524342f0ee4eb25a487cea3c Mon Sep 17 00:00:00 2001 From: Bloodhunter4rc Date: Wed, 12 Apr 2023 19:32:28 +0200 Subject: [PATCH 2/2] Change ["Dummy"] to [None]. --- freqtrade/plugins/pairlist/RemotePairList.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/plugins/pairlist/RemotePairList.py b/freqtrade/plugins/pairlist/RemotePairList.py index 0bf81c89d..24822bcd7 100644 --- a/freqtrade/plugins/pairlist/RemotePairList.py +++ b/freqtrade/plugins/pairlist/RemotePairList.py @@ -142,10 +142,10 @@ class RemotePairList(IPairList): """ if self._init_done: - if self._pair_cache.get('pairlist') == ["Empty"]: - return [] - else: + if self._pair_cache.get('pairlist') != [None]: pairlist = self._pair_cache.get('pairlist') + else: + return [] else: pairlist = [] @@ -187,7 +187,7 @@ class RemotePairList(IPairList): if pairlist: self._pair_cache['pairlist'] = pairlist.copy() else: - self._pair_cache['pairlist'] = ["Empty"] + self._pair_cache['pairlist'] = [None] if time_elapsed != 0.0: self.log_once(f'Pairlist Fetched in {time_elapsed} seconds.', logger.info)