move pairlist filters out of config[]

This commit is contained in:
Matthias
2019-11-19 06:34:54 +01:00
parent 66a273b31b
commit c22b00b303
7 changed files with 30 additions and 41 deletions

View File

@@ -13,7 +13,7 @@ class LowPriceFilter(IPairList):
pairlist_pos: int) -> None:
super().__init__(exchange, pairlistmanager, config, pairlistconfig, pairlist_pos)
self._low_price_percent = pairlistconfig.get('low_price_percent', 0)
self._low_price_ratio = pairlistconfig.get('low_price_ratio', 0)
@property
def needstickers(self) -> bool:
@@ -28,7 +28,7 @@ class LowPriceFilter(IPairList):
"""
Short whitelist method description - used for startup-messages
"""
return f"{self.name} - Filtering pairs priced below {self._low_price_percent * 100}%."
return f"{self.name} - Filtering pairs priced below {self._low_price_ratio * 100}%."
def _validate_ticker_lowprice(self, ticker) -> bool:
"""
@@ -41,7 +41,7 @@ class LowPriceFilter(IPairList):
compare = ticker['last'] + 1 / pow(10, precision)
changeperc = (compare - ticker['last']) / ticker['last']
if changeperc > self._low_price_percent:
if changeperc > self._low_price_ratio:
logger.info(f"Removed {ticker['symbol']} from whitelist, "
f"because 1 unit is {changeperc * 100:.3f}%")
return False
@@ -63,7 +63,7 @@ class LowPriceFilter(IPairList):
pairlist.remove(p)
# Filter out assets which would not allow setting a stoploss
if self._low_price_percent and not self._validate_ticker_lowprice(ticker):
if self._low_price_ratio and not self._validate_ticker_lowprice(ticker):
pairlist.remove(p)
return pairlist

View File

@@ -32,7 +32,7 @@ class PairListManager():
exchange=exchange,
pairlistmanager=self,
config=config,
pairlistconfig=pl.get('config'),
pairlistconfig=pl,
pairlist_pos=len(self._pairlists)
).pairlist
self._tickers_needed = pairl.needstickers or self._tickers_needed