Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Simple Research Strategy

I've been playing around with the research portion of Quantopian. As I'm very new to programming, I was wondering how I could write a simple MACD strategy in research and figure out how that strategy would do across a basket of stocks. For example, 100 shares would be purchased every time the 12 day moving average crosses from below to above the 26 day moving average, and those shares would be sold when the 12 day passes from above to below the 26 day average. Thank you!

2 responses

James Welcome to Quantopian.

It's really great that you are using the Research environment, it is extremely powerful. A common workflow when developing a strategy on Quantopian is to first develop your ideas in Research and then use what you've learned, and take it to the IDE where you can backtest your algorithm and view in detail the results. So to give you some direction, play around with the talib MACD indicator in Research maybe plot some graphs, and try and come up with a clever idea to trade off of it. Once you think you have something worth backtesting go to the IDE and try and implement that same strategy (you can probably copy and paste some of that same code). Check out the sample algorithms for guidance. If you're lacking in inspiration or want to see how other folks implemented a MACD strategy search for it in the community(copy and paste their work too). I know that sounds general and I didn't write any code, but I think that is a great way to get started.

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 for the reply, I'll start off with some sample algorithms