Continuing from my previous post on moving averages, let’s take a look at using a moving average as a trend indicator. Again, here is some material from the unpublished part of my book, on using the slope of a moving average as a trend indicator, and a look at a standard triple moving average trend indicator.
There are many books and trading methodologies that suggest that some kind of moving average–derived trend indicator can be a useful tool. The idea usually presented is that, in an uptrend, the upswings will be larger than the downswings, so traders should use a tool to identify the uptrend and then trade only with that trend. Because these ideas are so common in the trading literature, it is worth our time to investigate them here.
What are we looking for in a trend indicator?
First, think about what you would need to see from a trend indicator to make it useful. Though there could be different answers to this question, I suggest that they all are probably some variation of this: long trades should work better when the indicator shows an uptrend, and the downtrend condition should produce a more favorable environment for short trades. A simple way to test this would be to identify the trend indicator and then categorize all days according to whether the indicator labels them uptrend, downtrend, or neutral. (Note that if you are testing this mathematically, you need to assign the current bar’s return to the previous condition. For instance, imagine a situation where a large up day turns the trend indicator to an uptrend. If you include that day in the uptrend designation, you will assume that you were holding a long position from the previous day’s close, which is possible only if you knew what was going to happen the next day in advance. This is a small, but critical, adjustment [and a reference to this potential error].) Once we have categorized the days according to trend condition, we can measure the mean return and volatility for each group. If the trend indicator provides useful information, we should be able to see some difference between the two groups. Ideally, the uptrend days would have a higher mean return and perhaps a higher probability of closing up than in the downtrend days.
Slope of a single moving average
Consider a very simple trend indicator: the slope of a moving average. Immediately, we face the ubiquitous moving average question: “What length of moving average?” By changing the length of the moving average, we can usually make a trend flip to either up or down on almost any bar, so there is an arbitrary element to this definition. The 50-period average is commonly used in this capacity, so we will limit our testing to this one choice. [Many other lengths were tested, but only the 50 is presented here.] Another issue to consider is that, though a trader can easily identify the slope of a moving average visually, doing so in a structured, quantitative manner is a little bit more difficult. In this case, we draw a linear regression line through the last five data points, equally weighted, of the average itself, and use the slope of that linear regression line as the trend indicator.
Table 16.20 shows the results of a test of a 50-period moving average slope trend indicator; it shows excess returns (in this case, excess return is the raw return for the signal group minus the raw return for all bars) for the up and down trend conditions relative to all days in this test. (Note that “All” excludes days categorized as neutral when the slope of the average was flat.) In addition, we have calculated two measures of volatility: the standard deviation of raw (not excess) returns, and the mean of the 20-day historical volatility readings for each set. Last, the percentage of days that close up is calculated for each category.
The results are not impressive for this trend indicator. Considering the random column first to better understand the baseline, we do see a negative excess return for the downtrend and a positive return for the uptrend condition, with a slightly higher chance of close up (51.7 percent of days close up in uptrend condition versus 51.4 percent for all days. (This is not statistically significant.) Volatility is slightly higher for the downtrend, but roughly in line across all groups. Turning to equities, we find something surprising: the downtrend shows a very large, nearly 2 percent, positive excess return, while the uptrend shows well over a 1 percent negative excess return; this is precisely the opposite of what we should see if the uptrend indicator is valid. In fact, for equities, this suggests we might be better off taking long trades in the downtrend condition because we would be aligned with a favorable statistical tailwind. Futures show a situation that is more like what we would expect, with a fairly large negative excess return for downtrend, and a large positive excess return for uptrend. Forex, paradoxically enough, looks more like equities, but the actual excess returns are very small, and are not statistically significant.
Lag kills
How can this be? If you try this experiment yourself, put a 50-period moving average on a chart, and just eyeball it, you will see that the slope of the moving average identifies great trend trades. It will catch every extended trend trade and will keep you in the trade for the whole move—actually, for the whole move and then some, and there’s the rub. The problem is the lag, the same problem that any derived indicator faces. Whether based on moving averages, trend lines, linear regression lines, or extrapolations of existing data, they can respond to changes in the direction of momentum of prices only after those changes have happened. A moving average slope indicator will also get whipsawed frequently when the market is flat and the average is rapidly flipping up and down. It is possible to introduce a band around the moving average to filter some of this noise, but this will be at the expense of making valid signals come even later.
Figure 16.23 illustrates the problem with a 50-period moving average applied to a daily chart of the U.S. Dollar Index. It would have been slightly profitable to trade this simple trend indicator on this particular chart, but notice how much of the move is given up before the indicator flips. The chart begins with the market in an uptrend (moving average sloping up), and nearly one-third of the entire chart has to be retraced before the moving average flips down. Once the market bottoms in November, a substantial rally ensues before the trend indicator flips up. This lag, coupled with the fact that markets tend to make sharp reversals from both bottoms and tops, greatly reduces the utility of this tool as a trend indicator.
Multiple moving averages
Another common idea is to use the position of two or more moving averages to confirm a trend change. For example, three moving averages of different lengths could be applied to a chart, and the market could be assumed to be in an uptrend when the averages are in the correct order, meaning that the shortest average would be above the medium-length average and both of those would be above the longer-term moving average, with the reverse conditions being used for a downtrend. This type of plan allows for significant stretches of time when the trend is undefined; for instance, when the medium-length average is above the longer-term average, but the shortest average is in between the two. This, like all moving average crosses, is attractive visually because the eye is always drawn to big winners, to the clear trends that this tool catches. However, like all moving average crosses, the whipsaws erode all profits in most markets, leaving the tool with no quantifiable edge. In addition, more moving averages usually introduce more lag, with no measurable improvement compared to a simple moving average crossover.
One of the most popular moving average trend indicators today is based on simple 10-, 20-, and 50-period moving averages. Traders using this tool are told to take long trades only when it indicates an uptrend and to short only when it indicates a downtrend. It is reasonable to ask how the market behaves in both of those conditions. Table 16.21 shows that traders using this tool in Equities (and it is primarily used by stock traders) will consistently find themselves on the wrong side of the market, fighting the underlying statistical tendency. Simply put, stocks are more likely to go down when this tool flags an uptrend, and up when it flags a downtrend—traders using it as prescribed are doing exactly the wrong thing. For the other asset classes, the message is mixed. There is possibly an edge in futures, particularly on the short side, and forex looks more random than the actual randomly generated test set. At least in this sample of markets, this test suggests that traders relying on this trend tool or on tools derived from it are likely to have a difficult time overcoming these headwinds.
This is…a rather 10,000 foot view IMO. It’s well-known that an SMA is a laggy indicator (with lag n/2). What an SMA has going for it is that it’s smooth–it in and of itself does not haphazardly change slope randomly, so a faster indicator crossing above a simple moving average is probably the best way to use it.
On the other hand, indicators such as an EMA, or Ehlers’s FRAMA (one of the first indicators I investigated on my blog), are more responsive, but have their own issues (responding to what? To the randomness/mean reversion at the front of the data?). The bigger issue I’ve found, however, is determining what constitutes a slope as going “up” or “down” in a timely fashion, and keep the security’s price history in mind, without being unnecessarily laggy.
Agreed… this was just intended to be a very high level look at a tool a lot of people are using. Though we all know about the lag, I don’t think many people realize that an indicator like this so consistently puts you on the wrong side of trades in stocks, so that’s a valuable message imo.
Not necessarily. 😉 I have also shared some simple rules that do show an edge, and I’ll continue to do so in the near future.
Hello! Great work!
I got two questions though:
1) would you get better results by using a shorter moving average (eg 9 period moving average)?
2) in what you refer to as “equities”, there might be stocks which perform consistently better than others. So those are the ones I´m gonna trade. What do you mean by “equities”? Is that the SPY?
This is the 1st time i´m reading your blog. Congrats! Will be coming back soon!
Thank you for your kind words on my blog. I’m glad you found something useful here. 🙂
1. I looked at short and long MAs… there’s a tradeoff with both and shorter isn’t necessarily better here.
2. Maybe… but there’s a lot of natural variation just due to randomness. I would not be at all confident that the ones that performed best in backtest would be the ones you should trade, at least not without a lot of work and support. To me, that’s a dangerous direction to think in.
Hey Adam! Will your book be available through Amazon?
As for 2: OK. but let s say you get great results in ur backtests trading what you refer to as equities. in that case, what would u trade? The spy ? See…from my tests, i believe it is hard to find a strategy that will work for the majority of stocks. some strategies performance better in banking stocks, Others do better in energy stocks and so on. So perhaps…since you ré trading out of the usa…Maybe u should run specific backtests on sector etfs instead of just running it on equities.
Please tell me what u think! It’s Been a while since i last came across such a decent blog!
Pingback: ES SP500 Spoo-nalysis (Page 909) - Index Futures Trading | Big Mike Trading
Pingback: Random Line Theory (Page 25) - Traders Hideout | Big Mike Trading
Interesting post, I am just trying to make sure I understand the tables correctly. Using Table 16.20 as an example:
So the average bar across the entire data set closed up by .023% (2.3 bps), and when the slope of the 50-period MA indicated a downtrend the average bar closed up by 3.051% (305.1 bps), leading to a mean excess return of 3.028% (305.1-2.3 bps)?
I think you are looking at the standard deviation row, which is a measure of volatility. Mean excess return is given as a separate row in the tables so you don’t have to subtract to find that number.
Adam,
I think I got confused because you said ” the downtrend shows a very large, over 3 percent,positive excess return, while the uptrend shows well over a 1 percent negative excess return”
On table 16.20 the Mean Excess Return for Equities in the “Down” mode is only 177.2 bps (1.77%). Did you mean to use this number instead of saying 3 percent?
The mean excess return in the “Up” mode shows as -129.6 bps so I see where you got the second part of the quote from (“while the uptrend shows well over a 1 percent negative excess return”)
Have you done any work on price momentum?
It seems to be the most academically accepted market inefficiency.
Yes, quite a bit. It is one of the main tools I use. (See my recent post https://adamhgrimes.com/what-works/ for a very high level perspective.)
This is interesting…this is similar to “3 ducks” trading strategy by Captain Currency…which uses the same 60 bar average applied to 3 different timeframes…4 hour, 1 hour, 5 min…they all are used as different filters…4 hour timeframe moving average is used as a “trend filter”, like your slope example (best slope equals best trend)…1 hour timeframe moving average is used as a “line in the sand”, trade only when price is still below this line (in the 1 hour timeframe the slope is irrelevant…it’s more to keep you on “trending side” of the market)….and the 5 min is used for entry, trading below last major swing…if price is below all three moving averages on all timeframes…When you think about it on one chart…it’s more like trading only when price is below the 60 MA with and good slope and it’s still below its 20 MA …on the 4 hour chart…it would be interesting to see you analyze this type of system…just a slight twist
Pingback: ICYMI October 26th | Kairos Opportunities
Great stuff Adam. Thank you. Again confirms that we should ignore the chimera’s and focus on buying/selling pressure and price momentum.
Pingback: Reader question: Multiple timeframes? - Adam H Grimes