See the code and backtest below for my take on implementing a simple trend following strategy inspired by Andreas Clenow's "Stocks on the Move".
The implementation uses a slope as trend indicator and rebalances the portfolio based on the ranked table of these slopes.
Any comments are appreciated, particular regarding the following problems:
- The strategy doesn't make any trades during the backtest period, which might be connected to problem 2
- The ATR which is used as a volatility indicator to calculate the position size often is 0. How can I make sure that sufficient data is available from the get go?
- The size of the universe is 1 in the beginning and then 55, which is far off the intended universe size of 22.
- ...
Peter Mack
Have you read through these threads:
https://www.quantconnect.com/forum/discussion/3106/stocks-on-the-move-equity-momentum
Filib Uster
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!