Back to Community
New error when retrieving price data

I have algo's grabbing price data through data.history and they have started erroring out on all my algo's.

No matter what I change the numbers to, the error just changes to match accordingly.

code - gc_hist = data.history(context.primary_gc, 'price', 35, '1m')
error - IndexError: index 1596 is out of bounds for axis 0 with size 1595

code - gc_hist = data.history(context.primary_gc, 'price', 200, '1m')
error - IndexError: index 1761 is out of bounds for axis 0 with size 1760

The error references the line number of this line of code.

Some error out right away while others run halfway through the backtest and then give error. I don't think its something of my doing because I have had this algo for 3 months without changing it and it ran fine before. Any ideas?

2 responses

I am using futures by the way. GC to be specific

New error not present before.....I got this error after I removed the logic giving me the index error above. I even tried substituting in a stock and still same error.

71 order_optimal_portfolio(objective=opt.TargetPortfolioWeights(weights), constraints=[],
72 universe = weights.keys())
73 log.info("Going Short GC")

AttributeError: 'numpy.float64' object has no attribute 'end_date'

There was a runtime error on line 72.

This worked fine before the NoDataAfterDate issue started Sunday, Jul 23rd.