Chapter 4-4 Moving Averages
Moving averages are a very simple, yet highly effective tool in technical analysis. They smooth out a data series and make it easier to spot trends. Moving averages also help form the foundation for many other technical indicators and overlays. While moving averages are not suited for predicting a change in trend, they do help identify and confirm a current trend.
Moving averages consistently come into play because a stock can essentially do only one of three things: trend up, trend down, or trade sideways in a range. Just to be clear, an uptrend is established when a stock has formed a series of higher highs and higher lows. Inversely, a downtrend is established when a stock forms a series of lower lows and lower highs. A stock trades sideways in a range when an uptrend or downtrend cannot be established. If a stock is trading in a range, an uptrend is started when the resistance or upper boundary of the range is broken and a downtrend begins when support or lower boundary is penetrated.
Now, since it is common for stocks to trend, and it is considered a good rule of thumb to always trade with the trend, identifying what the current trend actually is becomes extremely important. Therefore, effectively utilizing moving averages greatly assists most trading styles.
Moving averages are often used to forecast areas of support and resistance and are also used in conjunction with other indicators to help give more accurate entry and exit signals. Traders use these averages to help them to choose strategic areas to set price targets or stop-loss orders. Some of the common trading setups that occur through the use of moving averages include:
- Trading breakouts/breakdowns as the stock price crosses the moving average.
- Trading pullbacks to the moving average as a stock price retraces after diverging far from its moving average.
- Using the support or resistance level created by the moving average, which acts as a barrier preventing the trend from reversing.
Always remember though that moving averages work more effectively when used with other indicators. It is important to look for the current direction of the sector in which the stock trades in, as well the stock market as a whole, as they can provide valuable insight on the scenario that is most likely to occur.
Identifying the Trend
It is very easy to figure out the direction of the trend when using moving averages. You can identify trend by using any of the following three ways: direction, price, and crossovers.
The first is the easiest way to identify trend. Using the direction of the moving average to determine the trend is as simple as confirming the moving average is rising or falling. If the moving average is rising then the trend is considered up. However, if the moving average is declining, the trend is considered down.
The second method for identifying the trend is by using the current stock price in comparison to the moving average. The location of the stock price relative to the moving average can be used to establish the trend. If the stock price is above the moving average, the trend is considered up. If the stock price is below the moving average, the trend is considered down.
The third method for trend identification is based on the location of the shorter moving average relative to the longer moving average. If the shorter moving average (example: 5-day) is above the longer moving average (example: 20-day), the trend is considered up. If the shorter moving average (5-day) is below the longer moving average (20-day), the trend is considered down.
In any case, it is important not to act on every subtle change in trend, but instead look at general direction the stock is moving.
Types of Moving Averages
In technical analysis, there are three different types of moving averages: simple, exponential, and weighted. Each, due to the way they calculate the average, form a slightly different trend line.
Simple Moving Average (SMA)
A simple moving average is created by calculating the average price, also known as the mean, of a stock over a specified number of periods. Most moving averages are created using the closing price, but it is technically possible to create a moving average from the Open, the High, and the Low data points as well. Every time a new period is added, the oldest period is dropped, thus, the average changes over time. In general, the shorter the time frame used, the more volatile the moving average will appear. For instance, the line on a 5-day moving average tends to move up and down more than the line on a 200-day moving average.
Naturally, moving averages are lagging indicators and will always be trailing the stock price. This works extremely well when prices are trending. However, when prices are not trending, and are instead choppy or erratic, moving averages can give misleading signals.
The simple moving average (SMA) is the easiest to compute. A 5-day SMA takes the sum of the last 5 days prices and divides by 5. It is very easy to create, but is not always accurate. Simple moving averages have a tendency to get stuck or snagged at a particular price.
Simple Moving Average (SMA) |
|||||||||
Day |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Price |
32 |
33 |
33 |
27 |
33 |
34 |
33 |
33 |
33 |
5-Day SMA |
31.6 |
32 |
32 |
32 |
33.2 |
As you can see on Day 9 there is a large gap up in the simple moving average, but the price has remained constant at $33 for three days. This distortion is caused by the big drop in price on Day 4 skewing the average until the data was dropped from the calculation of the SMA on Day 9.
Exponential Moving Average (EMA)
In an attempt to reduce the lag in simple moving averages, exponential moving averages (EMA’s) where created. EMA’s cut down on the lag by applying more weight to recent prices relative to older prices. The actual weighting applied to the most recent price depends on the specified period of the moving average; the shorter the EMA’s period, the more weight that will be applied to the most recent price. Because there are more variables involved, the computing of an EMA is more difficult than that of an SMA. The reason for the increased amount of steps in calculating the exponential moving average is due to the added weight on recent prices. With the increased importance on recent prices there is a quicker reaction to price changes compared to a simple moving average.
Exponential Moving Averages can be specified as a percent-based EMA or as a period-based EMA. A percent-based EMA has a percentage as its single parameter while a period-based EMA has a parameter that represents the length of the EMA.
In order to calculate an exponential moving average you must first take today’s price multiplied by an EMA%. Then you must add that to yesterday’s EMA, which is multiplied by (1 – EMA%).
The exact formula is as follows:
EMA = (Today’s Closing Price * EMA%) + (Previous EMA * (1 – EMA%))
EMA% = 2 / (n + 1) n is the number of days
EMA% is the weighting attached to the current day’s value:
- 50% would be used for a 3-day exponential moving average
- 10% is used for a 19-day exponential moving average
- 1% is used for a 199-day exponential moving average
Example: The EMA% for 5 days is 2 / (5 days + 1) = 33.3% or .333
Note that the first EMA is the average for past n days.
Exponential Moving Average (EMA) |
|||||||||
Day |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Price |
32 |
33 |
33 |
27 |
33 |
34 |
33 |
33 |
33 |
5-day EMA |
32.33 |
32.53 |
30.66 |
31.4 |
32.26 |
32.73 |
32.82 |
32.87 |
You can see in the example above, by taking the same closing prices used to calculate the simple moving average before, the exponential moving average creates a much smoother trend.
Weighted Moving Average (WMA)
A weighted moving average (WMA) attaches an even greater weight to the most recent data. Weighted moving averages share similarities with exponential moving averages in that both were created to reduce lag by placing more weight on the newest data and less on older data. However, WMA and EMA have two very different formulas. The weighting for a WMA is calculated from the sum of days.
Example: For a 5-day weighted moving average the sum of days is 1+2+3+4+5 = 15
The weighting and calculation are shown below using the same closing prices as those in the EMA and SMA examples.
Weighted Moving Average (WMA) |
|||||
Day |
1 |
2 |
3 |
4 |
5 |
Price |
32 |
33 |
33 |
27 |
33 |
Weighting |
1/15 |
2/15 |
3/15 |
4/15 |
5/15 |
Weighted Value |
2.13 |
4.40 |
6.60 |
7.20 |
11.00 |
5-Day WMA |
31.33 |
The weighted values are calculated by multiplying today’s price by 5/15, yesterday’s price by 4/15, and so on. The weighted moving average is the total of the 5 weighted values.
Obviously, a lot more goes into WMA compared to SMA, making it much more difficult to calculate, but as a result the lag that plagues a simple moving average is greatly reduced in a weighted moving average. Fortunately, most trading platforms and charting sites do the laborious calculating for you.
Comparing Moving Averages
When comparing the three moving averages, there is no clear winner that works best in all circumstances. However, with intra-day trading strategies, weighted 5 and 20 period moving averages on a 2-minute chart are what we most commonly use. The 5 traces the price action of the stock, while the 20 trails, forming a smooth trend line.
Ultimately, which moving average you use will depend on your trading style. The simple moving average obviously has a lag, but the weighted and exponential moving averages are prone to quicker breaks and more failed signals. If you are a short-term trader, then a weighted moving average would most likely work best for you. However, if you are a trend trader that likes to have a stock pattern develop over time, then a simple moving average may suit you best. It is also important to consider the stock you are looking to trade and how it has moved over time in conjunction with the different moving averages.
By doing this it will help you also help you identify what is the appropriate length of time to use for your moving average. You can conceivably have a moving average set for any time period, but the most popular include the 5, 20, 50, and 200 period. Each has a different purpose, however the longer the time period, the more prevalent the trend. If you notice that there are too many crosses, lengthen the moving average to decrease its sensitivity. If instead you find the moving average is reacting too late, shorten the length of time of the moving average to increase its sensitivity.
Keep in mind though, if the price movements are too choppy and erratic, even over an extended period of time, then it is probably best not to use a moving average for analysis of that stock.
While greater sensitivity leads to quicker signals, it also leads to more failed breakouts. As a result, there is an unavoidable trade off between sensitivity and reliability. The shorter the moving average you use, the more signals will be generated. While these signals may be timely and effective some of the time, there will also be an increased amount of false alarms given due to the increased sensitivity. By using a longer moving average you decrease the sensitivity and have fewer, more reliable signals. However, remember with less sensitivity the signals are often given late.
The weighted and exponential moving averages, which are generally much more sensitive than simple moving averages, generate more signals as they are consistently closer to the actual stock price. However, the downside with using a WMA and EMA is they also give an increased number of false signals compared to SMA.
Moving averages are going to lag to some degree regardless of the type or length of moving average you use. However, because of that lag they are extremely helpful in identifying a stock’s current trend. With the trend identified, many types of trading setups arise. Understanding which setup is best to use in each scenario will create trading success. It is important to note that stocks, sectors, and markets spend the majority of there time in trading ranges, which render moving averages ineffective. Only after a trend is developed is a moving average going to be useful.
Remember that a moving average will keep you in, but also give you a late signal to exit. Therefore, do not expect to get in at the bottom and out at the top. Moving averages alone are not enough to permit entry, but when in union with other tools that too confirm and coincide; probability of a successful trade dramatically increases.
Trading Setups
It is common to see a stock draw a lot of attention when the price touches its moving average, especially after the stock has trended in one direction for a substantial period of time. Traders consider this a potential pivot point, in which the stock can make one of three moves.
Through the use of moving averages it becomes much easier to identify support and resistance levels, especially in a stock with an upward or downward trend. In the example below, you can see that the stock bounces off the moving average (which acts as support) and continues higher. This dramatic bounce is caused by traders coming in to purchase the stock near or at its moving average. Traders long the stock as they look for the ascending moving average to act as technical level of support.
After a substantial move in a one direction it is common to see very strong or weak stocks resist reversal attempts even if the moving average is breached. In the example below, the stock price crosses the moving average, but fails to reverse trend and proceeds to hug the moving average. It is common to see consolidation following a poor attempt at a reversal in trend.
When the stock price crosses through a moving average, or two moving averages cross each other, it is referred to as a crossover. This is considered a signal of reversal in trend and an early indication of future momentum in the opposite direction. In the example below, you can see once the stock price trades through the moving average an immediate sell off occurs as shorts enter and longs exit. This downward momentum reverses the stock’s trend from up to down.