Simplify PriceFilter
This commit is contained in:
parent
f0c3a0d2f8
commit
afa7a5846b
@ -38,14 +38,12 @@ class PriceFilter(IPairList):
|
|||||||
:return: True if the pair can stay, false if it should be removed
|
:return: True if the pair can stay, false if it should be removed
|
||||||
"""
|
"""
|
||||||
if ticker['last'] is None:
|
if ticker['last'] is None:
|
||||||
|
|
||||||
self.log_on_refresh(logger.info,
|
self.log_on_refresh(logger.info,
|
||||||
f"Removed {ticker['symbol']} from whitelist, because "
|
f"Removed {ticker['symbol']} from whitelist, because "
|
||||||
"ticker['last'] is empty (Usually no trade in the last 24h).")
|
"ticker['last'] is empty (Usually no trade in the last 24h).")
|
||||||
return False
|
return False
|
||||||
compare = ticker['last'] + self._exchange.price_get_one_pip(ticker['symbol'],
|
compare = self._exchange.price_get_one_pip(ticker['symbol'], ticker['last'])
|
||||||
ticker['last'])
|
changeperc = compare / ticker['last']
|
||||||
changeperc = (compare - ticker['last']) / ticker['last']
|
|
||||||
if changeperc > self._low_price_ratio:
|
if changeperc > self._low_price_ratio:
|
||||||
self.log_on_refresh(logger.info, f"Removed {ticker['symbol']} from whitelist, "
|
self.log_on_refresh(logger.info, f"Removed {ticker['symbol']} from whitelist, "
|
||||||
f"because 1 unit is {changeperc * 100:.3f}%")
|
f"because 1 unit is {changeperc * 100:.3f}%")
|
||||||
|
Loading…
Reference in New Issue
Block a user