I think there are two separate issues being raised in this thread. I'll try to identify and address them separately.
1) The pricing of an AAPL changes when the
end_date argument to
get_pricing is changed. This is expected behavior. The
get_pricing function returns prices that are adjusted for all corporate actions that occurred prior to the
end_date. If the
end_date is changed, it's possible that there are more or fewer corporate actions included in the adjustment.
get_pricing function was designed this way because we are very focused on providing data that is 'point in time' wherever possible on Quantopian. In this context, providing point in time data translates to the
end_date representing a perspective date. If you make a call to
end_date='2016-01-01', the query can be thought of as a "get me the last 2 years of pricing as though I was asking on January 1, 2016". Thus, any corporate actions that occurred after
2016-01-01 are not considered in the split and dividend adjustment.
The above approach is different from how most stock price visualization tools like Yahoo or Nasdaq display prices. In most other places, the default is for all pricing data to be adjusted with a perspective date of today. Because of this, Quantopian community members often expect this to be the default of
get_pricing. In other words, someone might expect
end_date='2016-01-01' to be interpreted as "get me pricing data from 2014 to 2016 as though I'm asking today". It's perfectly reasonable to expect this interpretation, especially given how most other sites operate. However, at Q, our primary focus is on supporting research that can lead to algorithms that perform well out-of-sample. We think that the ability to control the perspective date of a query is an important feature that helps our community achieve that type of research, so we make it the default behavior of each of our API functions.
2) Historical data on Yahoo Finance is adjusted for splits and dividends, but it still doesn't match up with Q pricing data, even if
get_pricing is called with
end_date='2019-06-23'. This one was a little harder to figure out. I poked around and looked at the link that Leo shared (thanks Leo!), but something still didn't match up between Q's adjusted pricing data and Yahoo's split and dividend adjusted pricing data.
I spent some time writing a notebook to compare the two and it looks to me like Yahoo might have a bug with how they compute dividend adjustment ratios. I'm far from an expert on the topic, but I worked through the problem using Yahoo's definition of how they adjust their pricing data and I think that Yahoo is using their split adjusted close prices in the dividend adjustment ratio calculation, which I don't think yields an appropriate ratio. I attached the notebook I used to figure this out along with some prose to explain what I did along the way. Let me know if this helps explain things or if you have any questions about the notebook.
P.S. Thank you @Vladimir for sharing the resources that help explain how Q does point in time price adjustments!