Protect against 0 values

This commit is contained in:
Matthias 2020-11-22 15:50:44 +01:00
parent 7e4fe23bf9
commit 29c6a9263d

View File

@ -74,7 +74,7 @@ class VolatilityFilter(IPairList):
if daily_candles is not None:
highest_high = daily_candles['high'].max()
lowest_low = daily_candles['low'].min()
pct_change = (highest_high - lowest_low) / lowest_low
pct_change = ((highest_high - lowest_low) / lowest_low) if lowest_low > 0 else 0
if pct_change >= self._min_volatility:
result = True
else: