Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
AttributeError when trying to use data.history in Pipeline

Hello all, I seem to be getting an attribute error saying that: AttributeError: 'module' object has no attribute 'history' on line 23 when trying to run the algo.

I am using what I can only expect is a noob workaround to get the percentage change for 9 different ETF's over the past 23 days. I am then trying to find the best performing 4, and have my pipeline only return assets that match the same sector code. For now I am just trying to see what the output is since I am taking this step by step, hence only log.info is returning the pipeline output for now.

I originally had a function to do this (commented out at the bottom of the algorithm) that seemed to work okay, and I had it scheduled to run everyday pretty much whenever the Pipeline did, so figured it made more sense to put it there. But once I did it seemed to stop working. It seems to me that I am unable to use data.history within the pipeline, since the logic stopped working when I transferred my function there... however it could also be a really silly mistake that I am missing.

Just occurred to me that I can't post the algorithm here without completing a backtest, so moved it to a notebook to make it easier to post the code.

Thanks!