There are many proponents of momentum investing. A quick browse through Quantopedia suggests that momentum strategies have very good risk adjusted returns for such a simple strategy.
There are other strategies such as GEM as outlined by Antonacci, and sector rotation.
They are all pretty much the same thing. Each month, see which top x number of etfs did best over the past year. Buy the top x, liquidate everything else. Hold for a month. Repeat. Pretty simple. All of the momentum strategies outlined above differ only by the etfs that they rotate.
So I present to you my very humble code for those who are still learning the system. Again, I'm not a programmer or a professional investor, but I didn't see any momentum strategy template and I thought this might help some people out. In future code, I will use dataframes instead of lists of lists.
Also, my momentum strategy also employs a 200 day moving average trend following rule. Momentum is surprisingly uninspiring without it.
Please let me know if there are any bugs in my code or if you find it useful.