Fix PrecisionFilter
This commit is contained in:
parent
1b3864ebf8
commit
d457542d96
@ -14,10 +14,8 @@ class PrecisionFilter(IPairList):
|
|||||||
pairlist_pos: int) -> None:
|
pairlist_pos: int) -> None:
|
||||||
super().__init__(exchange, pairlistmanager, config, pairlistconfig, pairlist_pos)
|
super().__init__(exchange, pairlistmanager, config, pairlistconfig, pairlist_pos)
|
||||||
|
|
||||||
self._stoploss = self._config.get('stoploss')
|
# Precalculate sanitized stoploss value to avoid recalculation for every pair
|
||||||
if self._stoploss is not None:
|
self._stoploss = 1 - abs(self._config['stoploss'])
|
||||||
# Precalculate sanitized stoploss value to avoid recalculation for every pair
|
|
||||||
self._stoploss = 1 - abs(self._stoploss)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def needstickers(self) -> bool:
|
def needstickers(self) -> bool:
|
||||||
@ -63,12 +61,11 @@ class PrecisionFilter(IPairList):
|
|||||||
"""
|
"""
|
||||||
Filters and sorts pairlists and assigns and returns them again.
|
Filters and sorts pairlists and assigns and returns them again.
|
||||||
"""
|
"""
|
||||||
if self._stoploss:
|
# Copy list since we're modifying this list
|
||||||
# Copy list since we're modifying this list
|
for p in deepcopy(pairlist):
|
||||||
for p in deepcopy(pairlist):
|
ticker = tickers[p]
|
||||||
ticker = tickers[p]
|
# Filter out assets which would not allow setting a stoploss
|
||||||
# Filter out assets which would not allow setting a stoploss
|
if not self._validate_precision_filter(ticker, self._stoploss):
|
||||||
if not self._validate_precision_filter(ticker, self._stoploss):
|
pairlist.remove(p)
|
||||||
pairlist.remove(p)
|
|
||||||
|
|
||||||
return pairlist
|
return pairlist
|
||||||
|
Loading…
Reference in New Issue
Block a user