From 2aa80f915d5a494fc30637c5f785d9a92f05c72f Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Fri, 15 May 2020 04:24:18 +0300 Subject: [PATCH] Cosmetics: improve readability --- freqtrade/pairlist/PrecisionFilter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/freqtrade/pairlist/PrecisionFilter.py b/freqtrade/pairlist/PrecisionFilter.py index 35eed5392..7491cf1b0 100644 --- a/freqtrade/pairlist/PrecisionFilter.py +++ b/freqtrade/pairlist/PrecisionFilter.py @@ -44,15 +44,19 @@ class PrecisionFilter(IPairList): :return: True if the pair can stay, false if it should be removed """ stop_price = ticker['ask'] * stoploss + # Adjust stop-prices to precision sp = self._exchange.price_to_precision(ticker["symbol"], stop_price) + stop_gap_price = self._exchange.price_to_precision(ticker["symbol"], stop_price * 0.99) logger.debug(f"{ticker['symbol']} - {sp} : {stop_gap_price}") + if sp <= stop_gap_price: self.log_on_refresh(logger.info, f"Removed {ticker['symbol']} from whitelist, " f"because stop price {sp} would be <= stop limit {stop_gap_price}") return False + return True def filter_pairlist(self, pairlist: List[str], tickers: Dict) -> List[str]: