Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Wrong values of SPY returned

I have history statements in an algorithm that get the info about SPY for the last few days. Here are the highs and lows for 5 days. In one case, the results disagree with results from both Yahoo & google.

 DataFrame:  
                           Equity(8554 [SPY])  
2015-06-26 20:00:00+00:00              210.58  
2015-06-29 20:00:00+00:00              208.82  
2015-06-30 20:00:00+00:00              207.32  
2015-07-01 20:00:00+00:00              208.03  
2015-07-02 20:00:00+00:00              208.27 

 DataFrame:  
                           Equity(8554 [SPY])  
2015-06-26 20:00:00+00:00              209.16  
2015-06-29 20:00:00+00:00              205.33  
2015-06-30 20:00:00+00:00              205.28  
2015-07-01 20:00:00+00:00              206.56  
2015-07-02 20:00:00+00:00              206.81 

On 2015-06-29 , Qunatopian returns a high of $208.82. But when I check Yahoo & Google I get $209.83 -- a whole dollar higher!
So why do the sources have different results for this data point??? Is this a fluke? Could there be "intentional" incorrect data? (I have heard of such things as a way to track where data comes from.) The open and close prices seem fine.

This makes it tough to debug and independently confirm results if the data is different!

3 responses

As I look into it more, it seems Quantopian is right (not a big surprise). I looked at the carts on Yahoo, and they contradicted the OHLC data that Yahoo itself has. It does surprise me that "major" sources like Yahoo or Google have incorrect data.

I encountered a similar issue. Its not that one has incorrect data - unfortunately different data vendors represent price data in difference ways. For example, some will adjust the historical data based off of the effects of splits, dividends etc while others will not. It sucks when one needs to data mine with one vendor and then backtest using another's data set.

I'm also curious if that accounts for the large difference between paper trading vs backtesting results

A while ago we shared a comparison of backtesting and paper trading, here's the thread if you're interested: https://www.quantopian.com/posts/backtesting-to-live-trading-progression-example

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.