Is anyone aware of a good strategy for debugging "Exception: inputs are all NaN" that occurs only occasionally when back-testing my algorithm? For certain time spans, everything works fine. I'm trying to lock down the exact date it occurs so I can diagnose the problem.
I've already tried using to use "set_symbol_lookup_date('2016-03-08')" to avoid pulling bad/old data, but it doesn't help.
For reference, I'm running a SMA on an EMA result. My guess is one of two:
- Either there's no stock price information (on a specific day) and it's pulling a NaN and crashing.
- or talib.EMA is calculating a zero and feeding that into talib.SMA. Does zero cause a NaN runtime error?
Here's the code for reference:
b = talib.EMA(a, timeperiod=21)
c = talib.SMA(b, timeperiod=4)
b pulls through a few variables but originates here:
high_price = history(bar_count=50, frequency='1m', field='high')
my_sid_series = high_price[context.stock]
hp = talib.EMA(my_sid_series, timeperiod=10)
Thanks for any help!