I read somewhere that the stock market had become more mean-reverting and less trending in recent years, and I wanted to see if I could put that to the test. Many of the books I’ve read have been about trend-following investing. So if the trend is dead (or dying), I’d certainly like to know about it.
But how to test “trendiness”?
I decided to code an oscillator in AmiBroker. It works like this:
Any time the index price has a set of three ascending or three descending closes in a row, that little ‘trendlet’ sequence is counted. Longer runs of ascending or descending trends are recorded as multiple trendlets, as they should be, since a longer trend should have more weight than a shorter trend.
As you can see in the lead image, the brackets denote sets of three ascending or descending trendlets. Note the overlaps, and also note that one price breaks the set (marked “X”) and so doesn’t count as a trendlet.
Now count the number of trendlets over a moving lookback window, and keep a running total. The fragment above, if looked through a moving window of 12 bars, would have 6 trendlets.
Then I smooth the curve with a moving average, as otherwise it can be very jagged. We can then get an immediate visual sense of how an index (or stock or commodity etc) has changed its trendiness over time. For the longterm trendiness of indexes, I chose a lookback of 120 and a moving average smoothification of 120.*
Look at the S&P 500 index since the 1920s. The index’s trendiness has been much higher in the past than it is now. In fact, it appears to be highest in the 1950’s through the 1970’s. Since then, the market has gotten less and less trendy.
My conclusion: trading systems and methods that rely on trend following are less likely to work – at least for stocks – than they were 30-40 years ago. Whether the market is getting more mean-reverting, or just getting more random, is not addressed by this oscillator. Perhaps for a future post I’ll take a look at that.
One thing I find interesting about the trendiness of the S&P 500 is that the early decades of the 1900s have a lower value that is similar to recent times. The market has gotten more trendy and then less trendy over the past 100 years. I wonder why?
One other observation: the oscillation in the indicator for the S&P seems pretty regular. Is there some sort of seasonal component to trendiness, and can one exploit this by deploying trend-following systems only when trendiness is at a peak?
Below I have some other indexes displayed with their trendiness oscillators. The sets of data are much smaller than the S&P, but there’s definitely an evolution in all of them, either with the average level or the amplitude of the swings. Also note the general trendiness levels of each market. Some markets are simply more trendy than others. You might need to click the image to view it better.
* smoothification: noun. The act of smudging a perfectly good set of number because you don’t like all the embarrassing peaks and valleys.