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.
- ...
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!