Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Different results for daily and per minute backtesting - for an algorithm that trades only once per month?

So this result is rather baffling: running the full backtest from January 2003 until now on an algorithm that trades only once per month - in the first trading day of the month respectively and right when the market opens - should theoretically produce the same result, no matter if I run it in daily backtesting or minute backtesting, since nothing in the algorithm is done differently.

Yet the results are vastly different. Over 15 years, once backtest shows a return of 900%, the other a return of 450%...

3 responses

Never mind. Please disregard. Turns out that there was one other difference in the algorithm. Weight by calculated by 1.0 / number_of_stocks vs. 0.99 / number_of_stocks. I will run the backtest again in minute mode to be 100% sure it is the exact same algorithm.

OK, so after ensuring that the results are 100% the same code, I still get the problematic result I originally posted about: identical algorithm, which trades only once per month on the first day of the month on market open shows a vastly different backtest result in daily vs. minute mode. How is that possible?

The difference is because of the backtest modes. In daily mode, your algo gets fresh price data only once per day. In minute mode, your algo gets price data every single minute, creating a more accurate representation. Because of this, I'd always recommend to backtest in minute mode. For a more detailed explanation, 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.