From cbb2ce3708b7f1a88e6b255ef2006ac98b360788 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Fri, 15 May 2020 04:55:28 +0300 Subject: [PATCH] Simplify PriceFilter --- freqtrade/pairlist/PriceFilter.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/freqtrade/pairlist/PriceFilter.py b/freqtrade/pairlist/PriceFilter.py index a7c2bd2d9..166515148 100644 --- a/freqtrade/pairlist/PriceFilter.py +++ b/freqtrade/pairlist/PriceFilter.py @@ -58,14 +58,12 @@ class PriceFilter(IPairList): :param tickers: Tickers (from exchange.get_tickers()). May be cached. :return: new whitelist """ - # Copy list since we're modifying this list - for p in deepcopy(pairlist): - ticker = tickers.get(p) - if not ticker: - pairlist.remove(p) - - # Filter out assets which would not allow setting a stoploss - if self._low_price_ratio and not self._validate_ticker_lowprice(ticker): - pairlist.remove(p) + if self._low_price_ratio: + # Copy list since we're modifying this list + for p in deepcopy(pairlist): + ticker = tickers[p] + # Filter out assets which would not allow setting a stoploss + if not self._validate_ticker_lowprice(ticker): + pairlist.remove(p) return pairlist