Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Differences in stock info between Daily and Minute

I've noticed I get different results when summing up all the Minute information from a single day or just
using the Daily information for the same stock.
For example, I checked VXX and I get different volume information. The daily result is a little bit bigger than summing up all the Minute updates but it is less than what I see for the same date on yahoo finance.

I also tried to get the open price from the first Minute update of a day and the close price from the last Minute update of a day and I get different result from just doing a Daily update. The Daily update is more or less identical with yahoo.

What am I'm doing wrong?

Thanks, Udi

2 responses

Hey Udi, take a look at this thread: https://www.quantopian.com/posts/differences-between-minute-and-daily-backtests

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.

Thanks, your answer helped! but somewhat indirectly.
The catch I had was that using

schedule_function(trade, date_rules.every_day(), time_rules.market_close(minutes=1))  

calls trade just before calling handle_data with the same context/data
so if you are doing the summing up inside handle_data you are missing the last point.

The same is true for market_open which is called just after the first call to handle_data for the day.
So trying to reset your daily counter inside the callback will be too late.