Do you want to beat the index with just a few lines of code? You don’t even need to program it. It’s simple enough to do manually. Beating the index is probably not the right term though. Killing it might be a better word.
Beating the index is supposed to be very difficult. After all, around 80-90 percent of all mutual fund managers fail to beat the index. If you think I just made that number up, you should follow the S&P Active Versus Passive (SPIVA) reports. If more people read those, fewer people would be investing with mutual funds.
In all fairness to the mutual fund managers, they start out in an impossible situation. They have steep costs to cover so they start far behind the index, and then they’re supposed to catch up during the year while staying within a very narrow tracking error budget.
If you’re not bound by such chains however, it shouldn’t really be that difficult to beat a stock index. Sticking with the theme I started last week, and followed up a few days later, I’ll continue to use the simplest possible approach. The trading model below can be greatly improved upon, but I want to demonstrate it in this simple shape to show that it still works.
We’re still dealing with 12 month momentum, but this time using single stocks. The investment universe is the S&P 500 stocks. We’ll go long anything where the current price is above the price a year ago. Simple ATR sized position are used, and we keep buying until we run out of cash. Yes, this introduces a random factor but if you run the model a few times with different randomization you’ll see that it doesn’t seem to matter much.
Let’s summarize the rules before showing the results:
- If yesterday’s close is higher than the close one year earlier, buy.
- Position size is based on 50 day ATR.
- Every Friday we check if the price is still higher than a year earlier or not.
- No leverage. Long only.
Not that bad for such simple rules. We do see a bit of a scary dip in 2008, but I can promise you that it was a much more scary dip in the index itself. Note the green area by 2008/2009. That’s when there was just no stock available where the price was higher than a year earlier, and therefore the strategy held cash.
A comparison to the index shows that you would be quite far ahead using this simple 12 months momentum rule.
Now, let’s be clear that I don’t really recommend that you trade this model. This is just a demo meant to show you that you don’t have to over-complicate things. This is just a way of breaking down trend following to the simplest possible components, to see if it still gets the job done. It appears as if it does.
While this model seems to work, it shouldn’t be that difficult to improve upon it. It has a few obvious weaknesses and perhaps you can use this as a starting point for a more realistic model.