chore: use available attribute

This commit is contained in:
Matthias
2025-08-19 20:34:58 +02:00
parent ac20596f10
commit 4919d6944e
5 changed files with 9 additions and 8 deletions

View File

@@ -31,8 +31,9 @@ class AgeFilter(IPairList):
self._min_days_listed = self._pairlistconfig.get("min_days_listed", 10)
self._max_days_listed = self._pairlistconfig.get("max_days_listed")
self._def_candletype = self._config["candle_type_def"]
candle_limit = self._exchange.ohlcv_candle_limit("1d", self._config["candle_type_def"])
candle_limit = self._exchange.ohlcv_candle_limit("1d", self._def_candletype)
if self._min_days_listed < 1:
raise OperationalException("AgeFilter requires min_days_listed to be >= 1")
if self._min_days_listed > candle_limit:
@@ -100,7 +101,7 @@ class AgeFilter(IPairList):
:return: new allowlist
"""
needed_pairs: ListPairsWithTimeframes = [
(p, "1d", self._config["candle_type_def"])
(p, "1d", self._def_candletype)
for p in pairlist
if p not in self._symbolsChecked and p not in self._symbolsCheckFailed
]
@@ -116,8 +117,8 @@ class AgeFilter(IPairList):
if self._enabled:
for p in deepcopy(pairlist):
daily_candles = (
candles[(p, "1d", self._config["candle_type_def"])]
if (p, "1d", self._config["candle_type_def"]) in candles
candles[(p, "1d", self._def_candletype)]
if (p, "1d", self._def_candletype) in candles
else None
)
if not self._validate_pair_loc(p, daily_candles):

View File

@@ -91,7 +91,7 @@ class PercentChangePairList(IPairList):
)
candle_limit = self._exchange.ohlcv_candle_limit(
self._lookback_timeframe, self._config["candle_type_def"]
self._lookback_timeframe, self._def_candletype
)
if self._lookback_period > candle_limit:

View File

@@ -40,7 +40,7 @@ class VolatilityFilter(IPairList):
self._pair_cache: TTLCache = TTLCache(maxsize=1000, ttl=self._refresh_period)
candle_limit = self._exchange.ohlcv_candle_limit("1d", self._config["candle_type_def"])
candle_limit = self._exchange.ohlcv_candle_limit("1d", self._def_candletype)
if self._days < 1:
raise OperationalException("VolatilityFilter requires lookback_days to be >= 1")
if self._days > candle_limit:

View File

@@ -89,7 +89,7 @@ class VolumePairList(IPairList):
raise OperationalException(f"key {self._sort_key} not in {SORT_VALUES}")
candle_limit = self._exchange.ohlcv_candle_limit(
self._lookback_timeframe, self._config["candle_type_def"]
self._lookback_timeframe, self._def_candletype
)
if self._lookback_period < 0:
raise OperationalException("VolumeFilter requires lookback_period to be >= 0")

View File

@@ -34,7 +34,7 @@ class RangeStabilityFilter(IPairList):
self._pair_cache: TTLCache = TTLCache(maxsize=1000, ttl=self._refresh_period)
candle_limit = self._exchange.ohlcv_candle_limit("1d", self._config["candle_type_def"])
candle_limit = self._exchange.ohlcv_candle_limit("1d", self._def_candletype)
if self._days < 1:
raise OperationalException("RangeStabilityFilter requires lookback_days to be >= 1")
if self._days > candle_limit: