Chipy Backtest Strategy
Chipy Backtest Strategy
So I took a look at your algorithm. You appear to be trying to see if the Chicago Cubs win, if that predicts the market will go up the next day.
As I was reading through your code, I thought, "oh, he's going to have look-ahead bias." But it looks like you got that! You knew that Cubs games happen after the market closes, and you timeshifted the win/loss by a day.
Great work. Too bad it's not a strong financial theory ;0
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 Dan. Although the Cubs do play the most day games in the league, most of the finish times are after the market closes. I put this together as a demo for the Chicago Python Users Group (chipy.org). Turns out it's a better strategy (mostly because it is in cash during 2008-2009 offseason) if you sell when the Cubs win and buy when the Cubs lose (Sorry Cubbies), although still not really a money maker. One of the issues we explored during our meeting was determining if we could generate some sort of outperformance with a better trading strategy (i.e. not going in and out of cash). I put all the documents from the meetup here.