XM does not provide services to residents of the United States of America.

The moving average is one of the most popular indicators used in chart analysis and its main purpose is to identify the direction of a trend and also define potential support and resistance levels.

In the chart below we can see the moving average shows price direction is down and acts as resistance to prices in this downtrend.

The moving average is considered to be a lagging indicator. It does not predict price direction, but rather defines the current trend with a lag.

The moving average indicator filters out noise by smoothing out price and volume fluctuations that can confuse interpretation and it therefore makes it easier to view the underlying trend. It appears as a line on a chart close to price action and it shows the average value of a security’s price over a set period of time. For example, to calculate a 21-day moving average, the closing prices of the last 21 days are added up and the total is divided by 21.

We perform the same calculation with each new trading day forward. Each time, only the prices of the last 21 days are used in the calculation. This is why it is called a moving average.

The example we have just explained refers to the simple moving average (SMA). There are other types of moving average as well, such as the exponential and the weighted moving averages.

How to Calculate?

The problem with the simple moving average is that only the period covered by the average is considered and each day is given equal weight. So in a 21 day moving average, the 1st day carries equal weight to the 21st day. This is the main criticism of the simple moving average and some believe that more weight should be given to the more recent price action. To overcome this issue, the weighted moving average (WMA) can be used. The weighted moving average assigns more weight to recent prices and less weight to older prices.

For example, to calculate a 5 day WMA, we should take the closing price of the 5th day and multiply this by 5, the 4th day by 4, the 3rd day by 3, the 2nd day by 2 and the 1st day by 1. Once the total has been determined, we then divide the number by the addition of the multipliers. If you add the multipliers of the 5 day WMA example, the number is 15.

However, the weighted moving average takes into account the prices covered by the period of the moving average and not all the data in the life of the security. In order to solve this problem, the exponential moving average (EMA) can be used.

This moving average assigns more weight on the recent prices and also includes all the price action in the history of the security. The advantage of this is that the exponential moving average is more sensitive and moves closer to the price action while at the same time takes into account its calculation of all the data in life of the security.

Looking at the diagram, we can see how the EMA reacts quicker to a change in the trend compared to the slower SMA.

Length of the Moving Average

What is the correct length of a moving average? The critical element in a moving average is the number of time periods used in calculating the average. The length of a moving average should fit the market cycle you wish to follow.

Trend Moving Average Length
Short Term 5-14 periods
Medium Term 20-30
Long Term 50-100
Very Long Term 200

Do not use in a range! Moving averages work better when the market is trending. In a range this indicator is not of much use and buy or sell signals will not work effectively.

How to Trade with the Moving Average?

The moving average is usually plotted on the same chart as price action. Therefore, a change in the direction of the trend can be indicated by the penetration of the moving average.

For example, a buy signal is generated when a price breaks above the moving average and a sell signal is generated by a price break below the moving average. It is added confirmation when the moving average line turns in the direction of the price trend.

We can use moving averages to identify buy and sell opportunities. There are various techniques used. One is a simple technique using just one moving average. Other techniques use more than one moving average. The double crossover method, uses two moving averages, while the triple crossover method uses three moving averages. The advantage of using more than one moving average is that fewer whipsaws are produced.

Simple Technique

In the chart below you can see that prices are in a downtrend. The best trading opportunity would be when prices are also below the moving average since this would confirm a strong downtrend. We would sell when price bounces off or crosses from above to close below the moving average.

Note that the longer the period you use for the SMA, the slower it is to react to the price movement. This would create fewer whipsaws and false signals. To make a moving average smoother, you would average closing prices over a longer time period. A shorter period moving average hugs prices more closely and is more sensitive to price action.

The longer term averages work better as long as the trend remains in force. Therefore it can be more advantageous to use more than one moving average.

Displaying two or three moving averages on a single chart provides important signals based on the moving average trends and crossovers.

Buy and Sell Signals are Given

  • when the price crosses the moving average
  • when the moving average itself changes direction
  • when the moving averages cross each other

The Double Crossover Technique

In the double crossover method, we use two moving averages, one short and one longer period than the other, for example, SMA-50 and SMA-200. A buy signal occurs when the SMA-50 crosses the SMA-200 from below to move higher. A sell signal occurs when the SMA-50 crosses below the SMA-200.

The Triple Crossover Method

The best performance is achieved when a shorter term average is rising above a medium-term average and both are rising above a long-term moving average. This is called the triple crossover technique.

For example the 10-25-50 day moving averages can be used. Also another commonly used triple crossover system used is the 4-9-18 day moving average system. The alignment of the moving averages in an uptrend is as follows: the shorter term MA (e.g. 10 day) follows prices closely, while the 25 day follows below it, and then the 50 day is below these two.

In a downtrend, the order is reversed, so that the 10 day MA is the lowest, then the 25 day above it, followed by the 50 day on the top. When prices are in a downtrend and subsequently reverses to the upside, a buy alert occurs when the shorter-term moving average, the 10 day crosses above the 25 day and the 50 day.

The buy signal is confirmed only after the 25 day crosses above the 50 day. Therefore, the order of the moving averages is reversed. When the uptrend is reversing to the downside, a sell alert is given when the 10 day dips below the 25 day and then the 50 day. A sell signal is confirmed when the 25 day crosses below the 50 day.

Risk Warning: Your capital is at risk. Leveraged products may not be suitable for everyone. Please consider our Risk Disclosure.