Since there seemed to be some interest in momentum models, I thought I'd make a more detailed and more configurable version. I wanted to show what parts are useful to modify and give some ideas for further research.
What is important to understand here is that it's not about maximizing the performance. It's about finding a robust approach, which is not overly dependent on exact parameters. We're trading broad concepts here, and in this case we're looking for robust ways to capture equity momentum.
Remember that the exact settings used for the backtest below are neither the 'best' nor 'worst'. If there is such a thing. It's meant to demonstrate a concept and teach a methodology. Work on it a bit, and I'm sure you can improve it.
The attached model has plenty of settings and comments in the code, which will hopefully help readers get started and experiment with momentum.
If you find things that could be improved here, that's great. Found an error? Please post it. This model is made to be shared and improved.