Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Stocksplit adjustment in Quantopian data

Hi everybody, I have no previous programming experience but determined to learn Python and zipline here on Quantopian. I started studying the import of price data and noted in my code that Quantopian data for Apple didn't seem to get adjusted for stock split in 2014 from memory so surely this would cause any trendfollowing algo (MA crossover) to sell unnecessarily. Any advice how to fix this problem or am I better off getting all data from Quandl which is hopehully adjusted? Also-with Quandl import: Do I need to add separate link for each symbol or can I download several symbols as a list or similar?

3 responses

Any time series you get from data.history will be fully adjusted. Adjustments are only done up until the simulation point in time, to avoid lookahead bias introduced by extremely low prices of future-heavily-split stocks and whatnot, and to improve the historical commission simulation.

Thanks Simon-but shouldn't get data before stock split get adjusted down as well-I think most broker and data vendor adjust pre stock slit data after stock split as well? The data from Quantopian shows Apple stock price of >$400 in 2013/2014 so clearly not adjusted.

It does get adjusted down, but only after the day of the split in the simulation. So, an algo walking through the simulation will see the same prices it would have seen on that day had it been live trading. If the algo on any day wants back-adjusted prices, it gets them from the history function.

There should really be a video to explain this, on a sticky post at the top of the boards.