Slow & Steady wins the race... 50/200 day moving average strategy
I came up with this idea while getting frustrated with a dynamic portfolio momentum strategy. The usual idea is to pick stocks that that have the most momentum up or down and go long/short accordingly; here I select the stocks whose 50 day MA are the closest to its 200 day MA, I go long on the ones just above and short the ones just below. Here I select the portfolio every 10 trading days.
I also use the total number of stocks with their slowMA < fastMA Vs. slowMA > fastMA as an indication of the general market direction, and weight more to the long/short side accordingly. The wlong and wshort recorded variables are the %s invested on the long and short side (per stock).
The idea is that stocks with similar 50 & 200 day moving averages are more likely to be fairly valued and the algo will avoid some of the wild swings that plague momentum strategies. The 50/200 day crossover is also a very common signal, so stocks might be more likely to continue in the direction of the 50day MA because a lot of investors enter and exit positions at that threshold.
The backtests for this are pretty memory hungry so you can't do tests over a very long time or you will get an error before it's done. This test goes through the '08-'09 crash and into the bull market on the other side, it seems to handle the transition pretty (at least in this case).
I completely made this up so please share any thoughts, criticisms, and ideas to improve it.
David Edwards