Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pipeline does not adjust for splits

According to the following article, pipeline should adjust the prices based on splits.

https://www.quantopian.com/posts/the-pipeline-api-dividends-and-splits-what-you-need-to-know

However, I have tested this against the AAPL split, and found the pipeline simply uses the raw price and not the adjusted price. See the notebook attached.

This doesn't seem desirable as during research it is difficult to calculate returns. For example day10 price - day1 price is not the real return if a stock split on day5.

Did I misunderstand this, or is it a bug?

3 responses

Ken, I think you're misunderstanding the pipeline output. The key thing to remember is that pipeline is adjusted to the "current date" from the perspective of the pipeline.

Your notebook is outputting the pipeline results for June 2 2014, then June 3 2014, etc. After the market close on June 2, there is no split yet - so all of the prices for Apple come out over 600. But then after the close on June 6 2014, the split appears, and the prices are in the 90s.

I modified your notebook and brought in the simple moving average. As you can see, the SMA is also correctly using split-adjusted pricing, but only after the split.

Hope that helps.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

I've come to this again when in my paper trading algo UVXY and SVXY have been selected by performance change , though no such change has been there

I've changed window for SMA for 2 days from previous notebook, and it is obvious that mean value for last entry is calculated from last two entries (unadjusted) 7.97 and 39.76 producing incorect average 23.87
Name: (2018-09-17 00:00:00+00:00, Equity(41969 [UVXY])), dtype: float64
(Timestamp('2018-09-18 00:00:00+0000', tz='UTC'), Equity(41969 [UVXY])) 10_day_mean_close 7.821500e+00
close 7.978000e+00
open 7.650000e+00
volume 2.494165e+07
Name: (2018-09-18 00:00:00+00:00, Equity(41969 [UVXY])), dtype: float64
(Timestamp('2018-09-19 00:00:00+0000', tz='UTC'), Equity(41969 [UVXY])) 10_day_mean_close 2.387250e+01
close 3.976700e+01
open 3.954000e+01
volume 1.253833e+07
Name: (2018-09-19 00:00:00+00:00, Equity(41969 [UVXY])), dtype: float64