What Is Moving Average?

One indicator that you will be seeing time and time again as you learn Forex trading is a moving average (MA). Moving averages are lagging indicators — this means they do not predict price direction but are rather calculated from the past prices. There are four popularly used types of moving averages: Simple, Exponential, Weighted, and Smoothed. You will rarely see Weighted moving averages used in Forex, but we will cover them anyway. Most traders prefer to stick with Simple and Exponential moving averages. The default is to calculate moving averages using closing prices, but you can also choose to calculate using High, Low, Open, Median, Typical, and Weighted prices. You will be able to choose how to calculate your moving averages in your charting platform unless you wish to calculate them manually.

Let's start with simple moving averages (SMA). A simple moving average is calculated by adding up the most recent N number of prices and then dividing that sum by N. What is N? It is called the period of a moving average and you can set it via your charting software. It can take any positive integer value from 1 to infinity. It indicates how many days (or hours, or weeks, or any other chosen periods of time) you will be averaging. The general formula for calculating a simple moving average for a given moment of time is:

SMA = (P0 + P1 + ... + PN-1) / N

For example, you chose 5 as the number of days (period), and the Close prices for those are (from oldest to most recent): 1.3345, 1.3348, 1.3350, 1.3374, and 1.3325. Then the simple moving average can be calculated as:

SMA = (1.3325 + 1.3374 + 1.3350 + 1.3348 + 1.3345) / 5 = 1.33484

With an exponential moving average (EMA), the calculation is more or less the same, but the difference is that exponentially less weight is given to the older data. This is done to reduce the lag. Here is a general formula to calculate an EMA:

EMA = EMAprev + alpha * (price - EMAprev)

It means that the EMA for today is calculated based on the EMA value yesterday, today's price and the special multiplier α, which can be anything from 0 to 1 (the higher it is, the sharper is the exponential decline of the weight of the older data). In Forex, α for an exponential moving average is usually calculated as 2 / (N + 1), where N is the period of the MA.

For example, we have the same data and period as in the above example for SMA. Let's calculate α:

α = 2 / (5 + 1) = ~0.33

The EMA of the first day is considered equal to the price of that day:

EMA1 = 1.3345

EMA2 = 1.3345 + 0.33 × (1.3348 − 1.3345) = 1.3346

EMA3 = 1.3346 + 0.33 × (1.3350 − 1.3346) = 1.33473

EMA4 = 1.33473 + 0.33 × (1.3374 − 1.33473) = 1.33561

EMA5 = 1.33561 + 0.33 × (1.3325 − 1.33561) = 1.33458

As you see, it is quite different from the result obtained using the simple moving average calculation.

weighted moving average (WMA) is similar, except that in case of an EMA, the weight given to each older point of data decreases exponentially. In case of a weighted moving average, the weight decreases incrementally. In general case, the WMA is calculated as follows:

WMA = (n * P0 - (n - 1) * P1 + ... + PN-1) / (n + (n - 1) + ... + 1)

If, for example, we choose the same data and period as in the examples above, we will get the following result for the weighted moving average:

WMA = (5 × 1.3325 + 4 × 1.3374 + 3 × 1.3350 + 2 × 1.3348 + 1 × 1.3345) / (5 + 4 + 3 + 2 + 1) = 1.33475

Once again, the result is somewhat different from both SMA and EMA.

smoothed moving average (SMMA) is like a mix of a simple moving average and an exponential moving average. In general, it is calculated the same way as the EMA except that the multiplier α = 1 / N:

SMMA = SMMAprev + alpha * (price - SMMAprev)

Consider the same example with the same 5 pieces of data. Let's calculate the multiplier:

α = 1 / 5 = 0.2

The SMMA of the first day is taken as the price of that day:

SMMA1 = 1.3345

SMMA2 = 1.3345 + 0.2 × (1.3348 − 1.3345) = 1.33456

SMMA3 = 1.33456 + 0.2 × (1.3350 − 1.33456) = 1.33465

SMMA4 = 1.33465 + 0.2 × (1.3374 − 1.33465) = 1.3352

SMMA5 = 1.3352 + 0.2 × (1.3325 − 1.3352) = 1.33466

Although it differs from all of the three previous variants of an MA, as you see, it is closer to the result obtained with the EMA calculation.

The nice thing about charting software is that you do not have to learn all these formulas; your charting platform will do the calculation for you. All you have to do is choose the period you want to calculate the moving average across and let the software plot it. Here is a MetaTrader chart of the daily GBP/USD showing all four types of moving averages applied to the closing price with a period of 14. The SMA is red, the EMA is blue, the WMA is green, and the SMMA is orange:

4 Moving Averages: Simple, Exponential, Weighted, Smoothed

As you can see on the chart, the exponential and weighted moving averages are faster than the simple moving average, and the smoothed moving average is the slowest of all. The longer the period of any moving average, the greater will be the lag.

What can you do with moving averages? Most people who trade moving averages use them either to provide context for other systems or as the main indicators in MA crossover systems. Moving averages tend to act as support and resistance levels: a lot of people like to place a slower moving average and a faster moving average on their chart, and then wait for the faster moving average to cross under or over the slower one. This can indicate an opportunity to sell or buy respectively. But one should also remember that moving average is not some magical trading tool and it will often fail.