Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Quantopian Assets Prices Doesn't Match Real Prices

Hi,

While trying to compare a specific assets prices taken from Quantopian to real prices (taken from Yahoo) I find prices doesn't make sense.
I've checked the following asset ():

start = pd.Timestamp("2015-01-01")
test_pricing = get_pricing(symbols(2), start, start + pd.Timedelta(days=34), fields="close_price")
print test_pricing

And got:
2015-01-02 00:00:00+00:00 15.841
2015-01-05 00:00:00+00:00 15.612
2015-01-06 00:00:00+00:00 14.993
2015-01-07 00:00:00+00:00 15.252
2015-01-08 00:00:00+00:00 15.632
2015-01-09 00:00:00+00:00 16.001
2015-01-12 00:00:00+00:00 16.370
2015-01-13 00:00:00+00:00 16.440
2015-01-14 00:00:00+00:00 15.432
2015-01-15 00:00:00+00:00 15.133
2015-01-16 00:00:00+00:00 14.933
2015-01-20 00:00:00+00:00 15.332
2015-01-21 00:00:00+00:00 15.522
2015-01-22 00:00:00+00:00 16.001
2015-01-23 00:00:00+00:00 15.771
2015-01-26 00:00:00+00:00 15.682
2015-01-27 00:00:00+00:00 15.692
2015-01-28 00:00:00+00:00 16.001
2015-01-29 00:00:00+00:00 15.891
2015-01-30 00:00:00+00:00 15.821
2015-02-02 00:00:00+00:00 15.791
2015-02-03 00:00:00+00:00 16.320
2015-02-04 00:00:00+00:00 16.480

while in yahoo (https://finance.yahoo.com/quote/ARNC/history?period1=1419890400&period2=1423087200&interval=1d&filter=history&frequency=1d) prices ranges at around 35...

Any explanation for that?

Thanks,
Eran

3 responses

The short answer is stock splits and dividends. Yahoo close prices are "adjusted for both dividends and splits." (see the note at the bottom of the Yahoo pricing table) adjusting for every dividend and split up through the current date (ie 10-15-2017 in this case). However, Quantopian gives you much more control. When using the "get_pricing" method the prices are split and dividend adjusted only up to the end date used in the method. The "real" prices are in this case the ones reported by Quantopian. Those are the prices you could have actually bought and sold the stock for at that time. If you want to see the two match, simply set the end date to today.

Ok, I said that was the 'short' answer. ARNC is complicated. In 2016 Alcoa (AA) created a parent company called Arconic (ARNC). AA shareholders got 1 share of ARNC stock for every 3 shares they held of AA. They didn't offer fractional shares so you would have gotten cash for any difference. Additionally, AA shareholders received a 'distribution' worth 80.1% of the outstanding AA stock. It seems that different sources account for the split and distribution differently. Technically, ARNC didn't exist before 11-1-2016 (https://en.wikipedia.org/wiki/Arconic) which is part of the confusion when trying to get pricing before that date.

So, basically, Quantopian prices (and volumes) are only adjusted to the end date of the 'get_pricing' method while most other sources (eg Yahoo) adjust them to the current date. Most prices and volumes therefore WILL appear different between the platforms but is perfectly correct. One thing to note is that the Quantopian prices will show the same prices that one would have seen if they had looked at Yahoo on the end date. Make sense? This is very important in backtesting in that the Q data won't include any future info and isn't subject to future bias.

Hi Again,

I've taken the prices for asset "AABA" (Yahoo) using the following command:

pricing = get_pricing(symbols('AABA'), start_date="2017-11-17", end_date="2017-11-24", fields='close_price')
print pricing.tail()

When comparing to https://finance.yahoo.com/quote/AABA/history?p=AABA I see that for instance, for date 2017-11-17 the close prices are different.
As I used current day, as the end day so according to the explanation in previous response I should have gotten the exact same price.

Please advice..
Thanks.

Take a look at the Q FAQs "Why is your close price different from other data sources?" (https://www.quantopian.com/faq#data ). That probably explains the difference you are seeing in AABA. For a little piece of mind you may want to verify the high and low prices each day. Those all match.