Simplify PriceFilter

This commit is contained in:
hroff-1902 2020-05-15 04:55:28 +03:00
parent 2aa80f915d
commit cbb2ce3708

View File

@ -58,14 +58,12 @@ class PriceFilter(IPairList):
:param tickers: Tickers (from exchange.get_tickers()). May be cached. :param tickers: Tickers (from exchange.get_tickers()). May be cached.
:return: new whitelist :return: new whitelist
""" """
# Copy list since we're modifying this list if self._low_price_ratio:
for p in deepcopy(pairlist): # Copy list since we're modifying this list
ticker = tickers.get(p) for p in deepcopy(pairlist):
if not ticker: ticker = tickers[p]
pairlist.remove(p) # Filter out assets which would not allow setting a stoploss
if not self._validate_ticker_lowprice(ticker):
# Filter out assets which would not allow setting a stoploss pairlist.remove(p)
if self._low_price_ratio and not self._validate_ticker_lowprice(ticker):
pairlist.remove(p)
return pairlist return pairlist