Moving averages are a favorite tool of active traders. However, when markets consolidate, this indicator leads to numerous whipsaw trades, resulting in a frustrating series of small wins and losses. Analysts have spent decades trying to improve the simple moving average. In this article, we look at these efforts and find that their search has led to useful trading tools. (For background reading on simple moving averages, check out Simple Moving Averages Make Trends Stand Out.)

Pros and Cons of Moving Averages
The advantages and disadvantages of moving averages were summed up by Robert Edwards and John Magee in the first edition of Technical Analysis of Stock Trends, when they said "and, it was back in 1941 that we delightedly made the discovery (though many others had made it before) that by averaging the data for a stated number of days…one could derive a sort of automated trendline which would definitely interpret the changes of trend…It seemed almost too good to be true. As a matter of fact, it was too good to be true."

With the disadvantages outweighing the advantages, Edwards and Magee quickly abandoned their dream of trading from a beach bungalow. But 60 years after they wrote those words, others persist in trying to find a simple tool that would effortlessly deliver the riches of the markets.

Simple Moving Averages
To calculate a simple moving average, add the prices for the desired time period and divide by the number of periods selected. Finding a five-day moving average would require summing the five most recent closing prices and dividing by five.

• If the most recent close is above the moving average, the stock would be considered to be in an uptrend.
• Downtrends are defined by prices trading below the moving average. (For more, see our Moving Averages tutorial.)

This trend-defining property makes it possible for moving averages to generate trading signals. In its simplest application, traders buy when prices move above the moving average and sell when prices cross below that line. An approach such as this is guaranteed to put the trader on the right side of every significant trade. Unfortunately, while smoothing the data, moving averages will lag behind the market action and the trader will almost always give back a large part of their profits on even the biggest winning trades.

Exponential Moving Averages
Analysts seem to like the idea of the moving average and have spent years trying to reduce the problems associated with this lag. One of these innovations is the exponential moving average (EMA). This approach assigns a relatively higher weighting to recent data, and as a result it stays closer to the price action than a simple moving average. The formula to calculate an exponential moving average is:

﻿\begin{aligned}&\text{EMA}=(\text{Weight}\times\text{Close})+((1-\text{Weight})\times\text{EMAy)}\\&\textbf{where:}\\&\text{Weight}=\text{the smoothing constant selected by the analyst}\\&\text{EMAy}=\text{the exponential moving average from yesterday}\end{aligned}﻿

A common weighting value is 0.181, which is close to a 20-day simple moving average. Another is 0.10, which is approximately a 10-day moving average.

Although it reduces the lag, the exponential moving average fails to address another problem with moving averages, which is that their use for trading signals will lead to a large number of losing trades. In New Concepts in Technical Trading Systems, Welles Wilder estimates that markets only trend a quarter of the time. Up to 75% of trading action is confined to narrow ranges, when moving-average buy-and-sell signals will be repeatedly generated as prices rapidly move above and below the moving average. To address this problem, several analysts have suggested varying the weighting factor of the EMA calculation. (For more, see How are moving averages used in trading?)

Adapting Moving Averages to Market Action
One method of addressing the disadvantages of moving averages is to multiply the weighting factor by a volatility ratio. Doing this would mean that the moving average would be further from the current price in volatile markets. This would allow winners to run. As a trend comes to an end and prices consolidate, the moving average would move closer to the current market action and, in theory, allow the trader to keep most of the gains captured during the trend. In practice, the volatility ratio can be an indicator such as the Bollinger Band®width, which measures the distance between the well-known Bollinger Bands®. (For more on this indicator, see The Basics Of Bollinger Bands®.)

Perry Kaufman suggested replacing the "weight" variable in the EMA formula with a constant based on the efficiency ratio (ER) in his book, New Trading Systems and Methods. This indicator is designed to measure the strength of a trend, defined within a range from -1.0 to +1.0. It is calculated with a simple formula:

﻿\begin{aligned}&\text{ER}\ =\ \frac{\text{total price change for period}}{\text{sum of absolute price changes for each bar}}\\&\textbf{where:}\\&\text{ER}\ =\ \text{efficiency ratio}\end{aligned}﻿

Consider a stock that has a five-point range each day, and at the end of five days has gained a total of 15 points. This would result in an ER of 0.67 (15 points upward movement divided by the total 25-point range). Had this stock declined 15 points, the ER would be -0.67. (For more trading advice from Perry Kaufman, read Losing To Win, which outlines strategies for coping with trading losses.)

The principle of a trend's efficiency is based on how much directional movement (or trend) you get per unit of price movement over a defined time period. An ER of +1.0 indicates that the stock is in a perfect uptrend; -1.0 represents a perfect downtrend. In practical terms, the extremes are rarely reached.

To apply this indicator to find the adaptive moving average (AMA), traders will need to calculate the weight with the following, rather complex, formula:

﻿\begin{aligned}&\text{C}\ =\ [(\text{ER}\ \times\ (\text{SCF}\ - \ \text{SCS}))\ +\ \text{SCS}]^{2}\\&\textbf{where:}\\&\text{SCF}\ =\ \text{the exponential constant for the fastest}\\&\qquad\quad\ \ \text{ EMA allowable (usually 2)}\\&\text{SCS}\ =\ \text{the exponential constant for the slowest}\\&\qquad\quad\ \ \text{ EMA allowable (often 30)}\\&\text{ER}\ =\ \text{the efficiency ratio that was noted above}\end{aligned}﻿

The value for C is then used in the EMA formula instead of the simpler weight variable. Although difficult to calculate by hand, the adaptive moving average is included as an option in almost all trading software packages. (For more on the EMA, read Exploring The Exponentially Weighted Moving Average.)

Examples of a simple moving average (red line), an exponential moving average (blue line) and the adaptive moving average (green line) are shown in Figure 1.

Figure 1: The AMA is in green and shows the greatest degree of flattening in the range-bound action seen on the right side of this chart. In most cases, the exponential moving average, shown as the blue line, is closest to the price action. The simple moving average is shown as the red line.

The three moving averages shown in the figure are all prone to whipsaw trades at various times. This drawback to moving averages has thus far been impossible to eliminate.

Conclusion
Robert Colby tested hundreds of technical-analysis tools in The Encyclopedia of Technical Market Indicators. He concluded, "Although the adaptive moving average is an interesting newer idea with considerable intellectual appeal, our preliminary tests fail to show any real practical advantage to this more complex trend smoothing method." This doesn't mean traders should ignore the idea. The AMA could be combined with other indicators to develop a profitable trading system. (For more on this topic, read Discovering Keltner Channels And The Chaikin Oscillator.)

The ER can be used as a stand-alone trend indicator to spot the most profitable trading opportunities. As one example, ratios above 0.30 indicate strong uptrends and represent potential buys. Alternatively, since volatility moves in cycles, the stocks with the lowest efficiency ratio might be watched as breakout opportunities.