Ensure we're not running off of empty dataframes
This commit is contained in:
parent
0d349cb355
commit
8ae604d473
@ -71,7 +71,7 @@ class RangeStabilityFilter(IPairList):
|
|||||||
timeframe='1d',
|
timeframe='1d',
|
||||||
since_ms=since_ms)
|
since_ms=since_ms)
|
||||||
result = False
|
result = False
|
||||||
if daily_candles is not None:
|
if daily_candles is not None and not daily_candles.empty:
|
||||||
highest_high = daily_candles['high'].max()
|
highest_high = daily_candles['high'].max()
|
||||||
lowest_low = daily_candles['low'].min()
|
lowest_low = daily_candles['low'].min()
|
||||||
pct_change = ((highest_high - lowest_low) / lowest_low) if lowest_low > 0 else 0
|
pct_change = ((highest_high - lowest_low) / lowest_low) if lowest_low > 0 else 0
|
||||||
|
Loading…
Reference in New Issue
Block a user