99
1010from cachetools import LRUCache
1111
12- from freqtrade .enums . runmode import RunMode
12+ from freqtrade .enums import RunMode
1313from freqtrade .exchange .exchange_types import Tickers
1414from freqtrade .plugins .pairlist .IPairList import IPairList , PairlistParameter , SupportsBacktesting
1515
@@ -25,7 +25,8 @@ def __init__(self, *args, **kwargs) -> None:
2525 super ().__init__ (* args , ** kwargs )
2626
2727 self ._allow_inactive = self ._pairlistconfig .get ("allow_inactive" , False )
28- self ._pair_cache : LRUCache = LRUCache (maxsize = 1 )
28+ # Pair cache - only used for optimize modes
29+ self ._bt_pair_cache : LRUCache = LRUCache (maxsize = 1 )
2930
3031 @property
3132 def needstickers (self ) -> bool :
@@ -64,7 +65,7 @@ def gen_pairlist(self, tickers: Tickers) -> list[str]:
6465 :param tickers: Tickers (from exchange.get_tickers). May be cached.
6566 :return: List of pairs
6667 """
67- pairlist = self ._pair_cache .get ("pairlist" )
68+ pairlist = self ._bt_pair_cache .get ("pairlist" )
6869
6970 if not pairlist :
7071 wl = self .verify_whitelist (
@@ -78,7 +79,7 @@ def gen_pairlist(self, tickers: Tickers) -> list[str]:
7879 pairlist = self ._whitelist_for_active_markets (wl )
7980
8081 if self ._config ["runmode" ] in (RunMode .BACKTEST , RunMode .HYPEROPT ):
81- self ._pair_cache ["pairlist" ] = pairlist .copy ()
82+ self ._bt_pair_cache ["pairlist" ] = pairlist .copy ()
8283
8384 return pairlist
8485
0 commit comments