Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Strange undefined errors around some tickers

It seems like my code is running into a lot of issues around some stocks. I'm not sure why, especially since the error messages seem to be very nondescript. For example,

"Something went wrong. Sorry for the inconvenience. Try using the built-in debugger to analyze your code. If you would like help, send us an email."

is a message I kept getting for a long time (just this message, no extra exception message), seemingly linked to this line of code:

context.stocks = symbols('SPY',
'AMZN',
'AAPL',
'GOOG',
)

I then switched to SIDs, because I read on the forums that using tickers was a potential problem.

context.stocks = [sid(8554), #SPY
sid(16841), #AMZN
sid(24), #AAPL
sid(46631), #GOOG
sid(42950), #FB
sid(2765), #FDX
sid(33729), #DAL
]

(I'm using these as placeholders for groups of stocks, for now)

However, the issue then changed to

"Exception: inputs are all NaN There was a runtime error on line 75."

line 75 being a function that takes in context and data as inputs.

These issues all occur maybe 2-3 years after the beginning of my backtests, so I find it really strange that it's not erroring out at the beginning, but rather somewhere in the middle. Are these issues usually linked to stock variables? I use data.can_trade(stock) on pretty much every function so I find it strange that it would have this kind of issue, unless it's somehow linked to data.history() where a stock changes between the current date and the x number of days I check history for?