One of the first things that a trader is taught is that “the trends is your friend,” and you have to “go with the flow.” A simple and highly popular approach which identifies the trend is the moving average. There is probably more money being traded today using moving averages than with all other technical indicators combined.
Popularity is difficult to quantify, but according to a quick review into the free indicator/EA repository of desynced.net, it is the foremost popular indicator used as a basis for EA and indicator construction:
|Popularity Rank||Indicator||EAs Based Upon||Indicators Based Upon|
|8||Larry Williams Percent Range||62||183|
|9||Movement Directional Index||59||240|
Moving averages have enjoyed such popularity because they provide the clearest method to identify a trend, smoothing the erratic data to see the trend more clearly.
Simply put, a simple moving average is the average of a currency over a set period of time. For example, a 9-day simple moving average is the average of the last 9 day’s prices. It is calculated by taking the sum of the last 9 days of a currency’s close price and then dividing by 9. It is called simple when there is equal weight given to each price over the calculation period. Other types of moving averages are weighted averages and exponentially smoothed averages, which we will discuss later.
There are three critical parts to any moving average:
- Length (and/or Time Frame)
- Calculation Method (Simple, Exponential, Smoothed, Linear Weighted)
- Crossover Method (Simple, Dual and Triple)
We will cover each in turn, exploring the variables of each, uncovering their strengths and weaknesses. All these parts must first, however, be placed in the context of the vulnerabilities of the moving average itself (its problems with lag, noise and whipsaws), for making the choice between the different methods, lengths and crossover techniques are ways of countering these vulnerabilities.
Vulnerabilities of the Moving Average
The moving average is one of the most popular and useful indicators to depict a trend, but one should also be aware of its two inherent vulnerabilities:
- It lags the markets;
- It can be subject to market noise;
- It can be vulnerable to sideways and whipsaw markets.
Let us show you an example of these vulnerabilities from a screenshot of a 25 daily simple moving average superimposed upon the EURUSD daily chart of 2011:
You can easily see that from Jan to May 1, 2011, the market had remained above the 25-day moving average, which means that it was in a strong uptrend. The moving average would have helped us see the trend and stay bullish on EURUSD for over five months. That is the strength of the moving average and during that time those who followed the trend set by the moving average would have racked up significant gains.
Now let us examine three weaknesses of the moving average over the same period. The first weakness is that when the trend changed direction in early May, the moving average did not show this trend change till 400-500 pips later, until price crossed under the moving average at 1.4300. This is the problem of lag, which means that a significant move will have already occurred before the indicator was able to generate a signal. The second weakness is that in the middle of February the market dipped briefly below the moving average, signaling a false trend change. You can see another false trend change occur earlier in December when the market briefly rose above the moving average. This is the problem of market noise, a term that refers to all the price data that distorts the picture of the underlying trend, such as small corrections and intraday volatility. The third weakness can be seen from May to September 2011, where the market stayed in a sideways, very noisy, very narrow 300 pip range, with the market weaving up and down through the 25-day moving average. This is the problem of a sideways and noisy market. This sideways, noisy period would have represented significant losses for traders employing moving averages as they would have entered and been beaten up on numerous fake trend signals and subsequent stop-outs. Let us go over these three weaknesses in turn.
Weakness #1: The Problem of Lag
We have to remember that the moving average is trend-following. It can follow the trend when it is already developed but it cannot forecast a new one. In fact, it is a lagging indicator, in that it can still be rising after the price has hit resistance and crashed. In the picture above, the moving average was still rising when the EURUSD hit resistance at 1.4900 and crashed down 500 pips on May 5, 2011. You would have been able to catch some of the fall, as the price fell below the 1.4300 moving average and hit the floor of 1.3900, but it would have been nice to be able to catch more of the move from when it happened.
Fixing Lag: There are a couple possibilities. You can reduce the length (number of days) in the moving average to make it more responsive. A shorter period moving average is more sensitive to recent prices. You can also change the calculation method, opting for an exponential or linear weighted moving average that gives more value to recent price changes.
Weakness #2: The problem of Noise
A price series with prices varying far from the moving average is said to have a lot of noise, like the static you get from a car radio when it is out of range. A moving average is designed to smooth out the erratic data so that we can better able to detect a trend. Nevertheless, even in the best of moving averages, erratic data (in the form of volatile price spikes and short corrections) can still escape the containment of the moving average. We can see this in the picture above, in the middle of February 2011, where short-lived bearish correction caused prices to temporarily fall below the 25-daily moving average, putting some trend traders in short trades that would have ended in losses. Numerous false trend changes of this sort entered into the picture during the summer of 2011, when the market moved in a sideways, directionless fashion with significant noise.
Fixing Noise: There are a couple of possibilities. You can apply more days to the moving average to reduce noise. You can increase the length (number of days) in the moving average to smooth it out and make it less responsive; for instance, if you increase the days from 25 to 50, the noisy outliers become contained within the larger moving average, which makes the moving average safer to trade. An abnormally high or low price in a 50 period moving average is less significant than in a 25 or 10 period moving average because deviant price carries less weight in the calculation. Opting for simple or smoothed averages would also ally yourself with a form of calculating the moving averages that emphasizes the smoothness (anti-noise) factor over the speed (anti-lag) factor.
Weakness #3: The problem of a sideways market
It is exceedingly difficult for any moving average based trend following strategy to overcome the pain of a sideways market. Sideways markets usually occur after a run up or down, consolidating in a narrow range before deciding which path to take again. The sideways EURUSD occurred during three summer months of 2011 (June, July and August), just after it fell hard in May. It was not sure if it should try to recover from the fall or keep falling. During the summer the market moved up and down through the moving average, and it would have done this up and down weaving, called a whipsaw (rapid movement of prices up and down in a volatile market, throwing up misleading signals to buy or sell at the end of the move), even if the moving average were reduced to 5 or 10, or increased to 50 or 200. Moreover, it would have produced this sideways whipsaw activity no matter the calculation method applied to it (no matter if it was smoothed or exponential). This vulnerability represents the greatest threat to traders employing the moving average as a determinant of trend direction, as it can result in numerous losses.
Fixing Sideways Markets: There is perhaps no sure-fire way to detect in advance the existence of a sideways market. Often it is best to follow the trend when it occurs, preparing to make the big money when it occurs 30% of the time, and also preparing yourself to survive the inevitable losses during sideways activity with sound money management. In the sideways situation of the summer of 2011, it was possible to take the summer off and avoid the legendary choppiness of the summer. Most big money traders are on holiday during the summer, which helps explain why there is no money in the market to sustain a trend direction. Hint: Trend traders should likewise take the summer off, or at least reduce the leverage on their positions. The only other option is to zoom in on a shorter (5 or 15 minute) time frames that may contain mini-trends. These smaller time frames are generally far too noisy for most trend traders but they might bear some fruit during a sideways market.
Now that we have explored some of the vulnerabilities of the moving average and proposed some fixes, we will explore some of these fixes in more detail. Basically, they deal with the length of the moving average, the calculation method, and the crossover technique.
1. Altering Lengths (and/or Time Frames) to Overcome Twin Problems of Lag and Noise
Navigating the narrow straight of length is like trying to simultaneously avoid the Scylla (6-headed sea monster) of lag, and Charybdis (whirlpool) of choppiness. The remedies for overcoming lag and noise tend to cure the one problem at the same time they bring about the side effect of the other. To overcome lag, we decrease length, which creates more noise and to overcome noise, we increase the length, which creates more lag.
First point: Decreasing length or time frame can mitigate the problem of lag.
Let us zoom into May of 2011 for the EURUSD, when the market stopped its bullish advance and turned bearish. I noticed how the 25-day period moving average did not enter into the short trend until after the market plunged 500 pips. It would have been nice to capture this trend reversal sooner than later. Could a decrease of the length catch the trend reversal sooner? Yes, it would.
Here is a screenshot of May 2011 comparing a 25-day moving average versus shorter 10-day moving average:
As you can see, the market crossed under the 10-Day SMA much faster, 200 pips faster, than the 25-Day SMA. That is a significant pip advantage for the faster period moving average, and thus it was successful in reducing the lag. However, it comes at a price: more noise. If you look at the market before and after this period you will see that using this shorter 10-day SMA resulted in more false signals (highlighted in the purple circles above) from mini corrections that reverted back to the main trend. The losses from these fake-outs would have negated the 200-pip advantage, it gained picking up on the faster trend change on May 5, 2011.
Another way of reducing lag is reducing the time frame. For instance, if one wanted to get into the trend faster, one can decrease the daily period from 25 to 10, or the 10-day moving average can be translated into a 60 period moving average on H4 (6 four hour bars in 24 hrs; thus, 10X6= 60) to arrive at the same thing.
Ultimately, it is the noise in the market that undermines the performance of the moving average, and smoothness negates the noise. The foremost way to make a moving average smoother is to increase the length or time frame. A longer period average and a larger timeframe both have greater smoothing effects, and thus they both carry the benefit of staying the course of the trend, avoiding the false reversals and whipsaws. If one was really noise-adverse, one would plot the moving average of this year on a 50-day moving average or a 200-day moving average.
In the world of stocks, the 50-day moving average crossing over/under the 200-day has been coined the “Golden Cross.” Here is the 50-200 MA “Golden Cross” on EURUSD H4 chart:
You can see in the chart above that trading the “golden crossover” on the EUR/USD H4 time frame would have generated considerable profit for 2010. One could have ridden a large downward trend from April to June and two significant upward trends from July to October 2010. The only hit you would have received would be the false short signal during August, which turned out to be a short-lived correction from the upward advance.
The problem with the longer period average is that it can extend the time it takes for a market to turn around, and by the time it turns around the move may be over. To prevent the late arrival to a bull or a bear party, traders decrease the length (or time frame) and modify the calculation method of the moving average. But, as we have seen, the problem selecting shorter lengths is opening yourself to greater noise and choppiness, more false signals that can bleed your account.
2. Altering the Calculation Methods to Solve the Problems of Lag and Noise
Altering the length parameter of moving averages is the foremost way of dealing with lag and noise, but there are various calculations methods that can weigh in on solving the two problems. Some calculation methods weigh in on the side of speed (to reduce lag) and others weigh in on the side of smoothness (to reduce noise).
The four major calculation methods are: simple, exponential, smoothed and weighted.
|MODE_SMA||0||Simple Moving Average||Equal weight is given to each price over the calculation period. Bias: Smooth (anti-noise)|
|MODE_EMA||1||Exponential Moving Average||More weight is given to recent prices in attempt to reduce lag. Bias: Speed (anti-lag)|
|MODE_SMMA||2||Smoothed Moving Average||Similar to a SMA; however, rather than subtracting the oldest value, the previous smoothed average value is subtracted. Bias: Smooth (anti-noise)|
|MODE_LWMA||3||Linear Weighted Moving Average||Designed to put more weight on recent data and less weight on past data. Bias: Speed (anti-lag)|
Simple Moving Average:
The most commonly used type of moving average, the simple moving average (SMA) is calculated by adding and then averaging a set of numbers representing the market. The SMA is by far the more popular mode, and it is considered highly useful because of its smoothing effect.
The formula for the SMA is as follows:
Where N – Number of Calculation Periods
It is just simple arithmetic. We all have been taught how to average in public school, measuring 10 of something, adding them up and then dividing by 10. In this case, we would be adding up the average number of 10 closing prices. The next day you add the newest close price to the total and subtract the oldest close price, keeping the total number of close prices a constant of 10.
The SMA Advantage: The SMA emphasizes smoothness, that is, it tries to smooth out the erratic behavior of the market in order to see the trend. However, there are those who do not like the fact that the SMA lags behind the latest data point by nature of its smoothing, and they prefer to give more weight to more recent data points, as in the weighted and exponential moving averages.
Exponential Moving Average:
The Exponential Moving Average (EMA) is calculated by adding the moving average of a certain share of the current closing price to the previous value.
The formula for the EMA is as follows:
CLOSE(i) — the price of the current period closure;
EMA(i-1) — Exponentially Moving Average of the previous period closure;
P — the percentage of using the price value.
The EMA advantage: Exponential moving averages assign more meaning to the recent prices and less to the closing price from the period’s beginning. Thus it is faster at detecting a trend reversal. Naturally, and depending on the length, it can be more susceptible to market noise.
Smoothed Moving Average (SMMA):
The smoothed moving average is like a simple moving average with twice the smoothing effect. The first value of this smoothed moving average is calculated as the simple moving average (SMA):
SUM1 = SUM(CLOSE, N)
SMMA1 = SUM1/N
The second and succeeding moving averages are calculated according to this formula:
PREVSUM = SMMA(i-1) *N
SMMA(i) = (PREVSUM-SMMA(i-1)+CLOSE(i))/N
SUM1 — is the total sum of closing prices for N periods;
PREVSUM — is the smoothed sum of the previous bar;
SMMA1 — is the smoothed moving average of the first bar;
SMMA(i) — is the smoothed moving average of the current bar (except for the first one);
CLOSE(i) — is the current closing price;
N — is the smoothing period.
SMMA Advantage: The SMMA emphasizes smoothness even more so than the SMA, trying to smooth out the erratic behavior of the market in order to see the trend. You will see that the SMMA line looks like a doubling of the length of the EMA. However, the problem with the SMMA is that it could lag too far behind the price movement.
Linear Weighted Moving Average (LWMA):
Like the EMA, the latest data is of more value than more early data. A weighted moving average is calculated by multiplying each one of the closing prices within the considered series, by a certain weight coefficient.
SUM(i, N) — is the total sum of weight coefficients.
LWMA Advantage: Like the EMA, the LWMA assigns more meaning to the recent prices and less to the closing price from the period’s beginning. Thus, they are faster at detecting a trend reversal, though they can be more prone to market noise.
In the end, while one may have a bias for the simple for its smoothness or the exponential for its speed, one can never know which will be the real queen of the game until both are given a fair trial.
3. Choosing the Crossover technique (Single, Dual, and Triple) as ways to deal with Lag and Noise.
Single MA Crossover
In its simplest form, called the Single Moving Average Crossover, you go long or short when the closing price crosses over/under the moving average. You buy when the closing price crosses over the moving average, and sell when it crosses under the moving average.
Here is an example of 200-MA on EURUSD H4 chart (Sept-2010 to Sept-2011):
You can see that it did successfully pick up the three large downtrends (+410, +600, +460) on the EURUSD over the last year. You could have picked up these profits with the dual crossover alone without having to pay attention to the news of the debt contagion in Europe. Though it has less false trades than the single moving average, it is still vulnerable to sideways markets. The dual crossover suffered during the summer (Jun-Sept) of 2011, and it suffered in the spring (Mar-April) of 2012.
Benefits: The major benefit of the dual crossover is that it is still a relatively simple and popular trend following technique while overcoming some of the potential choppiness of the single crossover method. Because you are delaying the entry till the fast moving average cross instead of the closing price cross, you can sidestep many false cross signals.
Drawbacks: The drawback of the dual crossover is that waiting for the crossover event can delay the entry and exit. This delay can cause you to lose part or all of the move.
Triple Moving Average
The triple moving average employs three moving averages of various lengths (fast, medium and slow): when the fast moving average crosses a medium moving average, and the medium crosses a slow moving average, a bullish or bearish signal is generated depending on the direction of the crossovers.
The common moving averages used for this event are 4, 9 and 18 periods, particularly on the daily time frame (at least in the world of stocks). When the 4-day (fast MA) crosses above/below the 9-day moving average (mid MA), the event has “started”, and it is confirmed when the 9-day moving average (mid MA) crosses above/below the 18-day moving average (slow MA). A bullish signal is generated when the crossover above, and a bearish signal is generated on the crossover below.
Wait a minute, you ask: isn’t the entry trigger given when the mid-MA crosses over/under the slow MA, and thus isn’t very much like the dual crossover in that respect? Yes, that is true. There is overlap in the entry. The real difference lies in the exit. Traders use the triple moving average to more quickly exit their positions. They exit when the fast MA crosses above/below the mid MA. While it may seem like a good idea at first, in practice it has the disadvantage of getting out of the trend too early, before it has had a chance to fully mature. It is wise to back-test this idea to see if it offers any extra edge other than the other two types of crossovers; but from experience, it seems to have offered no extra edge and often diminished the returns.
The moving average is perhaps the simplest of the trend following indicators, but its proper usage can be more complicated than one suspects. Again and again, we warn about the vulnerabilities of the moving average, namely its problem with lag (catching the trend too late), and its problem with noise and choppiness (catching too many false trend reversals). The additional problem is that lag and noise are twin problems that one needs to navigate between, and if one veers to avoid the one, one gets too close to the other. It is like trying to steer between Scylla and Charybdis, where Scylla the 6-headed sea monster represents the problem of lag (that eats away your potential pips) and Charybdis the whirlpool represents the problem of noise and choppiness (which can sink your account in a series of churning waves). Modifying the length, calculation method and crossover method are ways to steer the moving average away from one problem and closer to the other. Here is a table that sums up the dilemma:
|Length||Shorter Length||Longer Length|
|Calculation Method||EMA, LMA||SMA, SMMA|
|Single, Dual and Triple||Single (and Triple)||Dual|
To overcome lag, we decrease length or use EMA/LMMA calculation methods or use the single (and triple) MA crossover techniques, all of which creates more noise. To overcome noise, we increase the length or use SMA/SMMA calculation methods or the dual moving average technique, all of which creates more lag.
It may be possible to find that Greek “middle way”, the balance between the two extremes: an optimized length, calculation and crossover method that is appropriately fast enough to reduce lag and yet smooth enough to reduce noise. If you can find it, the more power to you.
But if you have to make a decision between the two, it is probably better to choose, like Odysseus did, the lesser of the two evils. It is probably better to pass closer to lag of Scylla rather than noise of Charybdis, because in the end it is preferable to lose out on some potential profit (from not getting into the trend fast enough), rather than become mired in a broiling and dangerous whipsaw-whirlpool market activity that can sink all your profits. You would be better off losing a few sailors than your whole ship.