From 7ac55e5415f94d7db285c20d093a902b039d05de Mon Sep 17 00:00:00 2001 From: nightshift2k Date: Sun, 4 Jul 2021 21:08:42 +0200 Subject: [PATCH 1/2] AgeFilter, RangeStabilityFilter, VolatilityFilter changed `float_timestamp` to `int_timestamp` --- freqtrade/plugins/pairlist/AgeFilter.py | 4 ++-- freqtrade/plugins/pairlist/VolatilityFilter.py | 2 +- freqtrade/plugins/pairlist/rangestabilityfilter.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/plugins/pairlist/AgeFilter.py b/freqtrade/plugins/pairlist/AgeFilter.py index 8f623b062..09d8588c1 100644 --- a/freqtrade/plugins/pairlist/AgeFilter.py +++ b/freqtrade/plugins/pairlist/AgeFilter.py @@ -64,7 +64,7 @@ class AgeFilter(IPairList): since_ms = int(arrow.utcnow() .floor('day') .shift(days=-self._min_days_listed - 1) - .float_timestamp) * 1000 + .int_timestamp) * 1000 candles = self._exchange.refresh_latest_ohlcv(needed_pairs, since_ms=since_ms, cache=False) if self._enabled: for p in deepcopy(pairlist): @@ -89,7 +89,7 @@ class AgeFilter(IPairList): if len(daily_candles) >= self._min_days_listed: # We have fetched at least the minimum required number of daily candles # Add to cache, store the time we last checked this symbol - self._symbolsChecked[pair] = int(arrow.utcnow().float_timestamp) * 1000 + self._symbolsChecked[pair] = int(arrow.utcnow().int_timestamp) * 1000 return True else: self.log_once(f"Removed {pair} from whitelist, because age " diff --git a/freqtrade/plugins/pairlist/VolatilityFilter.py b/freqtrade/plugins/pairlist/VolatilityFilter.py index 5ae8e3e9f..a50bf55b9 100644 --- a/freqtrade/plugins/pairlist/VolatilityFilter.py +++ b/freqtrade/plugins/pairlist/VolatilityFilter.py @@ -72,7 +72,7 @@ class VolatilityFilter(IPairList): since_ms = int(arrow.utcnow() .floor('day') .shift(days=-self._days - 1) - .float_timestamp) * 1000 + .int_timestamp) * 1000 # Get all candles candles = {} if needed_pairs: diff --git a/freqtrade/plugins/pairlist/rangestabilityfilter.py b/freqtrade/plugins/pairlist/rangestabilityfilter.py index 8be61166b..6f013c750 100644 --- a/freqtrade/plugins/pairlist/rangestabilityfilter.py +++ b/freqtrade/plugins/pairlist/rangestabilityfilter.py @@ -65,7 +65,7 @@ class RangeStabilityFilter(IPairList): since_ms = int(arrow.utcnow() .floor('day') .shift(days=-self._days - 1) - .float_timestamp) * 1000 + .int_timestamp) * 1000 # Get all candles candles = {} if needed_pairs: From 5626ca5a06dcbc29cad9a925945351765188ace1 Mon Sep 17 00:00:00 2001 From: nightshift2k Date: Mon, 5 Jul 2021 10:39:22 +0200 Subject: [PATCH 2/2] removed unnecessary casting to int() --- freqtrade/plugins/pairlist/AgeFilter.py | 8 ++++---- freqtrade/plugins/pairlist/VolatilityFilter.py | 8 ++++---- freqtrade/plugins/pairlist/rangestabilityfilter.py | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/freqtrade/plugins/pairlist/AgeFilter.py b/freqtrade/plugins/pairlist/AgeFilter.py index 09d8588c1..744b1268d 100644 --- a/freqtrade/plugins/pairlist/AgeFilter.py +++ b/freqtrade/plugins/pairlist/AgeFilter.py @@ -61,10 +61,10 @@ class AgeFilter(IPairList): if not needed_pairs: return pairlist - since_ms = int(arrow.utcnow() - .floor('day') - .shift(days=-self._min_days_listed - 1) - .int_timestamp) * 1000 + since_ms = (arrow.utcnow() + .floor('day') + .shift(days=-self._min_days_listed - 1) + .int_timestamp) * 1000 candles = self._exchange.refresh_latest_ohlcv(needed_pairs, since_ms=since_ms, cache=False) if self._enabled: for p in deepcopy(pairlist): diff --git a/freqtrade/plugins/pairlist/VolatilityFilter.py b/freqtrade/plugins/pairlist/VolatilityFilter.py index a50bf55b9..9383e5d06 100644 --- a/freqtrade/plugins/pairlist/VolatilityFilter.py +++ b/freqtrade/plugins/pairlist/VolatilityFilter.py @@ -69,10 +69,10 @@ class VolatilityFilter(IPairList): """ needed_pairs = [(p, '1d') for p in pairlist if p not in self._pair_cache] - since_ms = int(arrow.utcnow() - .floor('day') - .shift(days=-self._days - 1) - .int_timestamp) * 1000 + since_ms = (arrow.utcnow() + .floor('day') + .shift(days=-self._days - 1) + .int_timestamp) * 1000 # Get all candles candles = {} if needed_pairs: diff --git a/freqtrade/plugins/pairlist/rangestabilityfilter.py b/freqtrade/plugins/pairlist/rangestabilityfilter.py index 6f013c750..a6d1820de 100644 --- a/freqtrade/plugins/pairlist/rangestabilityfilter.py +++ b/freqtrade/plugins/pairlist/rangestabilityfilter.py @@ -62,10 +62,10 @@ class RangeStabilityFilter(IPairList): """ needed_pairs = [(p, '1d') for p in pairlist if p not in self._pair_cache] - since_ms = int(arrow.utcnow() - .floor('day') - .shift(days=-self._days - 1) - .int_timestamp) * 1000 + since_ms = (arrow.utcnow() + .floor('day') + .shift(days=-self._days - 1) + .int_timestamp) * 1000 # Get all candles candles = {} if needed_pairs: