Last Updated on December 18, 2021 by Oddmund Groette
Moving averages in trading are widely discussed and used in the media and likewise frequently used by analysts when making calls about the future. Most traders and investors have probably heard about the death cross, but like most of the averages, it’s mostly useless in predicting the future. We believe they were much more useful in the past before the personal computer came about. As the markets have become faster and more efficient, the usefulness of moving averages has slowly eroded.
We argue that moving averages are mostly useless as stand-alone indicators in trading strategies, except for long-term trend-following strategies. But moving averages serve a purpose as trend filters for other indicators and strategies.
- Trend following strategies and systems explained
- A simple trend following system/strategy in the S&P500
- Trend-following system/strategy in gold (12-month moving average)
Anyway, let’s do some simple quantified testing:
What is a moving average?
First, we need to establish what a moving average is. It might be obvious to most readers, but our experience is that traders’ mathematical abilities are poor.
So what is a moving average?
Simple moving average (SMA)
A moving average is an average of a time series of numbers that adds observations to the average as time goes by, while the last numbers in the time series get excluded from the calculations. Here is an example of an average of ten observations:
10, 9, 11, 13, 5, 6, 7, 9, 3, 2
To find the average, you add all the numbers together (which is 75) and divide by the number of observations (10). Thus, the average is 7.5.
As we add observations, the calculation change:
10, 9, 11, 13, 5, 6, 7, 9, 3, 2, 13, 8
The above sequence has two more observations, and the two first observations in bold are excluded from the calculation.
The above is called a simple moving average. A simple average puts equal weighting on all observations.
Exponential moving average (EMA)
Opposite, an exponential moving average puts more weight on the most recent observations. The calculations are a bit more cumbersome than a simple moving average, but you can find the calculations here.
Other moving averages
There are other averages as well. In Amibroker, we find the following moving averages:
- DEMA – double exponential moving average
- DispMA – displaced moving average
- Linear regression – least squares moving average
- TEMA – triple exponential moving average
- TSF – time series forecast
- Wilders – Wilders moving average
- WMA – Weighted moving average
Some of them are self-explanatory, but quite frankly, we have no clue about the others, and we will stick to the “ordinary” SMA and EMA.
The visual differences between the SMA and EMA
The difference between the averages looks like this:
The 50-day EMA reacts faster than the SMA, clearly indicated in the chart above, precisely EMA’s aim.
What is the best time frame for moving averages?
There is, of course, no best time frame for a moving average. You can’t possibly fit one-time frame into a lot of different markets.
Are the moving averages good indicators?
Moving averages are extremely popular among traders. This must indicate they are very beneficial?
Well, our experience indicates they are not very beneficial as a trading tool. In certain markets/instruments it works well, while in others we find it useless.
However, it all depends on the use. On its own, our testing reveals acceptable results in trend-following strategies in commodities. But in stocks and indices, it doesn’t show much promise.
Moreover, moving averages are best used together with other tools to form strategies.
How do you use moving averages?
In this section, we briefly list the most common uses of the averages:
Moving averages and trend-following:
This is a label that, just like most of the trading topics, is loosely defined. What exactly is trend-following? I use the definition in Curtis Faith’s The way of the Turtle (page 22):
In trend-following, the trader attempts to capitalize on large price movements over the course of several months. Trend followers enter the trades when markets are at historical highs or lows and exit when a market reverses and sustains that movement for a few weeks.
Curtis Faith was part of the famous Turtle experiment in the 1980s. Below are some of the strategies mentioned in his book The Way of The Turtle:
- Donchian trend: Entry is done when the price sets a 20-day high and when an exponential moving average of 25 days is above the 350-day average. The exit is when the 25-day EMA crosses below the 350-day EMA.
- Dual moving average: Go long when the 100-day SMA crosses above the 350-day SMA. Opposite for short (which is also the exit for longs). Thus, the strategy is always in the market.
- Triple moving average: Buy when the 150-day SMA crosses above the 250-day SMA, but only when both averages are above the 350-day SMA. Exit when the 150-day SMA crosses below the 250-day SMA.
These strategies are easy to test. We tested on several ETF’s and the result is like this:
- Donchian Trend: The S&P 500 has 9 trades since 1993 and returned a CAGR of 8.3% with 86% of the time invested. The drawdown was slightly better than buy and hold. Gold returned 5.81% vs. 8.6% for buy and hold but with slightly less drawdown. We tested only longs.
- Dual moving average: For all our ETFs, the strategy is inferior to buy and hold with small improvements in the maximum drawdown.
- Triple moving average: Same results as for the dual moving average.
Trend-following works best for commodities, like sugar, coffee, cotton, gasoline, etc. We have never found any value in trend strategies related to stocks or the stock market. On the contrary, mean-reverting strategies work best on stocks, like for example this strategy:
Moving averages and support and resistance:
A pretty common feature is to use moving averages as support and resistance levels, which is often of great interest for analysts in the media. Unlike support and resistance in classical technical analysis, the support and resistance of moving averages are dynamic: they change.
Let’s find out if there is any value in MAs and support:
- Entry is when either the close or today’s low penetrate the moving average. Entry is the closing price.
- We exit when today’s close is higher than yesterday’s high.
We test for a wide range of days in the moving average: from 5 to 250 days with 5-day intervals. In Amibroker the code is like this:
Buy= Cross(MA(C,MAdays),Close) OR Cross(MA(C,MAdays),Low);
In the S&P 500, the best results are in a cluster of around 100 days. However, the results are not pretty good. The best result is an average of 80 days, which returns a 3.8% CAGR, less than half the buy and hold. For other ETFs, the result is even worse.
What happens if we add another criterion? Let’s add that the Relative Strength Indicator must be lower than 30:
Buy= ( Cross(MA(C,80),Close) OR Cross(MA(C,80),Low) ) AND RSI(2)<30;
The results are pretty good: CAGR is 3.41% but with many fewer trades:
Unfortunately, it’s not the moving average crossover that makes the strategy decent, but the RSI.
Moving averages and profit targets:
One other use of moving averages is to use them as profit targets or stop-losses. For example, when a price hits a moving average, you exit the trade. We find many strategies on the internet that use this kind of target, but we have never managed to find them much useful.
Moving averages and stop-losses:
If you buy above a moving average, you can use the same moving average as a stop-loss. Thus, you are using a dynamic stop loss because the moving average obviously fluctuates with the price of the instrument you are trading. It’s normally trend-following strategies that use averages as stop-losses.
Moving averages as filters:
Moving averages are mostly used as a filter for other indicators or variables. For example, if the S&P 500 is above the 200-day moving average, it’s bullish, and bearish if it’s below the average. Some analysts claim markets show different price behavior depending on where the price is compared to a certain moving average. Do quantified tests verify this? Let’s do some testing:
The table below shows the average gain in percent in the S&P 500 from close to close when it’s over or below the n-day moving average:
The first row indicates the S&P 500 has a 0.02% average return from the close of today until the close of tomorrow when the close today is below the 5-day simple moving average. Clearly, the S&P 500 performs the best when it’s below the average. The index is clearly mean-revertive. Below is the equity curve when the S&P 500 is below the 5-day average:
Opposite, gold shows slightly different tendencies where long-term trends are more prevalent.
We conclude our results indicate practically the opposite of what is touted in the financial media. However, we do have some strategies that have shown good results with moving averages as filters. We will get back to those in later articles.
Death crosses (moving averages):
This rather gloomy title is often referred to in the financial media. A death cross is when two moving crossovers indicate a possible imminent bear market. However, this is yet another useless indicator touted in the media, and we believe it has no value for a trader.
The indicator’s logic is as follows: when a short-term moving average crosses below a long-term moving average, the sentiment changes to a negative one.
Golden crosses (moving averages):
A golden cross is the opposite of a death cross, but our research has found little value in the cross.
Can you use moving averages in indicators?
Yes, some indicators are based on moving averages:
MACD is based on moving averages:
MACD is an abbreviation for Moving Average Convergence Divergence. The indicator uses two moving averages: typically, it’s a 12-day and 26-day period. We have no idea why these days are used, but you can change to whatever time frame you prefer. The MACD is the difference between the two averages and oscillates around zero. Below is how it looks like on a chart:
Some years ago we made a strategy based on the indicator with promising results:
Bollinger Bands are based on moving averages:
Another famous indicator is the Bollinger Bands, developed by John Bollinger. The indicator uses a moving average and adds two bands over and under two standard deviations away from the moving average. You can set the number of days to what you want, and likewise incorporate the size of the standard deviation as you please. The default standard deviation is normally two.
The Bollinger Band is a volatility filter. A standard deviation of two captures 95% of the past movement within those two bands. However, the assumption is that price action forms a normal distribution, which is often not the case, hence the expression “fat-tails”, “tail-risk”, etc.
Here is a chart with Bollinger Bands included:
Conclusion about moving averages in trading:
Are moving averages useful for a trader? We would say they are of limited use, except as filters. We have rarely found profitable moving average trading strategies. Typical the media likes to refer to moving averages, but we guess it’s just an argument for the sake of having something to discuss.