# The Exponential Moving Average Indicator

July 27, 2021 13:30 UTC

The moving average indicator is one of the most useful and versatile technical indicators available to online traders. But it comes in several different forms.

In this article we will examine the Exponential Moving Average (EMA). We will explain what this indicator is, how to calculate the exponential moving average, how to use it to construct a trading strategy and much more!

## What Is the Exponential Moving Average?

The moving average indicator is an essential tool for identifying trends. We use moving averages to smooth out variations in data, in order to better discern the underlying trend.

They do this by looking back at a number of historical data points and then calculating some form of average of the values. There is more than one way to calculate the average and there are several types of moving average.

The most straightforward method is the Simple Moving Average (SMA), which considers all price values equally and takes the mean as the average. Other common types of moving average assign a weighting to different price values, favouring recent prices more heavily than older prices.

This is the way in which the exponential moving average works, with the most recent price data assigned greater weighting, which decreases exponentially as we move backwards in time.

It is difficult to provide a fully satisfactory exponential moving average definition without getting into the specifics of the calculations involved.

A basic EMA definition is: a smoothing technique arrived at by adding a portion of the current price, to a portion of the value of the previous moving average. To properly get a handle on what is going on though, we need to roll up our sleeves and take a look at the maths behind the exponential moving average calculation.

## How to Calculate the Exponential Moving Average

We calculate an EMA at time – t – using the exponential moving average formula as follows:

• EMAt = α x current price + (1- α) x EMAt-1

Where 'α' is a smoothing constant with a value between 0 and 1 and EMAt-1 is the EMA value for the previous period.

The smoothing constant is governed by the number of periods (n) in the EMA and is calculated thus:

• α = 2 / (n + 1)

You can see from the initial formula that calculating the EMA for a given point in time requires us to know the EMAs for previous periods. For a daily EMA, we derive the current value from the prior day's EMA, which in turn we derive from the day before that, and so on.

In other words, there are some other steps involved. The first of these is to obtain a starting exponential moving average value for the first period in our window. We also need to determine our smoothing constant. Probably the best way to illustrate the process of how to calculate the exponential moving average is to look at an example.

### The Exponential Moving Average Calculation

To keep the example simple, we are only going to use a few data values. Let's look at how to calculate an 8-day EMA from some sample values. The table below shows the values involved in calculating the 8-day exponential moving average.

 Day Sample Price 8-Day SMA α 8-Day EMA 1 168 2 170 3 171 4 175 5 170 6 172 7 176 8 179 9 178 172.625 0.222222 172.625 10 186 173.875 0.222222 175.5972 11 192 175.875 0.222222 179.2423 12 183 178.5 0.222222 180.0773 13 177 179.5 0.222222 179.3935 14 172 180.375 0.222222 177.7505 15 167 180.375 0.222222 175.3615 16 177 179.25 0.222222 175.7256 17 180 179 0.222222 176.6755

We need a moving average value for Day 1 to begin. For this, we'll use a simple moving average as our initial value. This is the sum of the previous 'n' values, divided by n.

On the ninth day, we have our starting value, which is the SMA of the previous 8 day's prices. Though the SMA is only required for the purpose of providing us with our starting value for our EMA calculations, we have included a column of SMA values in order to draw a comparison of the exponential moving average vs the simple moving average.

We also need to use a smoothing factor, which as we saw in the previous section, equates to:

• 2 / n + 1
• or 2 / 9

Another way of describing the calculation method is to say that the EMA is looking back at past values and discounting their weights by a factor of (1-α) per period.

By doing this, professional traders use EMAs in order to smooth the previous price data in the hopes of identifying and exploiting an ongoing trend.

In our calculations above, we only went back to include a small number of previous data points. However, an exponential moving average will be more accurate the further you go back and, ideally, you want to be including a larger amount of previous EMA values.

As you can imagine, performing the exponential moving average calculation for a large data set would be fairly time consuming. Fortunately, most trading platforms will be able to do these calculations for you almost instantaneously.

In the next section, we will show you how to use the exponential moving average indicator in both MetaTrader 4 and MetaTrader 5.

The exponential moving average indicator comes by default with both MetaTrader 4 (MT4) and MetaTrader 5 (MT5).

In the image below you can see that the Moving Average indicator is listed as one of the Trend indicators in the Navigator window in both MT4 and MT5.

The MA method field defines the type of moving average that you'll add to the chart. In the image above, we've naturally selected Exponential. Apart from cosmetic choices, the two EMA settings are 'Period' and 'Shift'.

Of these, the more important setting to choose is the exponential moving average period. The larger the period, the smoother the chart. The smaller the period, the more responsive the EMA line will be in responding to the price.

Some typical exponential moving average settings are 10 and 25 periods for faster, more responsive curves; 100 and 200 periods for very smooth, slow-moving curves; and 50 periods for an intermediate curve.

The shift setting works by offsetting the EMA curve along the time axis by the number you specify. The default value of 0 for the shift setting is the best place to start for beginners.

The image below shows a 16-period Forex EMA indicator added to a daily GBP/USD chart:

Depicted: Admirals MetaTrader 5 – GBPUSD Daily Chart. Date Range: 3 June 2020 – 27 July 2021. Date Captured: 27 July 2021. Past performance is not a reliable indicator of future results.

Can you see how the EMA indicator line is much smoother than the movements of the underlying price? It still traces the general movement of the market, but it effectively filters out price noise, showing us a clearer indication of the overriding trend.

The slop of the EMA indicator guides us to the trend. Notice how we get a sustained uptrend after the price breaks above the EMA indicator? The is often true when the price breaks below the exponential moving average. This is one of the key aspects of how to trade with the EMA Indicator – price crossing the EMA can provide a trading signal.

## Exponential Moving Average Trading Strategy

An even more effective way of producing trading signals is by using a double exponential moving average combination, one short-term and one-long term. This exponential moving average crossover strategy creates a trading signal when the shorter EMA indicator crosses the longer one.

For example, a long-term trend trader might use a 25-day EMA as the shorter average and a 100-day EMA as the long-term trend line. With this exponential moving average strategy, the trader would buy when the 25-day EMA crosses above the 100-day EMA, and sell when the 25-day EMA crosses below the 100-day EMA.

Depicted: Admirals MetaTrader 5 – GBPUSD Daily Chart. Date Range: 3 June 2020 – 7 May 2021. Date Captured: 27 July 2021. Past performance is not a reliable indicator of future results.

In the chart above, the black dotted line represents the 25-day exponential moving average, whilst the solid blue line is the longer 100-day EMA.

We can see that in July 2020, the 25-day EMA crossed above the 100-day EMA, which was our signal to buy. This exponential moving average crossover was followed by a sustained upwards trend, until the 25-day EMA crossed back below the 100-day EMA a year later in July 2021. This second crossover would have been our signal to exit the initial trade and enter a short position in the currency pair.

## Combining the Exponential Moving Average With Other Indicators

Moving averages have more than one use. In fact, they are often paired up with other indicators in order to make trading systems.

For example, a typical use for an exponential moving average is as a trend filter for a breakout strategy. One such example is a trend-following strategy, utilising Bollinger Bands together with an exponential moving average indicator - here, we would use the Bollinger Bands to provide our trading signals.

The Bollinger Bands plot a volatility envelope above and below the price on a chart. If the price breaks beyond the envelope, we would take it as a signal to trade in that direction – but only if our trend filter, which is represented by a short-term EMA and a long-term EMA line, agreed with the direction.

So for a breakout above the upper Bollinger Band, we would also need the short-term EMA to be above the long-term EMA for us to follow the buy signal.

Conversely, for a breakout below the lower Bollinger Band, we would sell, but only if the short-term EMA was below the long-term EMA.

Depicted: Admirals MetaTrader 5 – GBPUSD Daily Chart. Date Range: 3 June 2020 – 7 May 2021. Date Captured: 27 July 2021. Past performance is not a reliable indicator of future results.

There are many combinations that have been and can still be dreamt up. The wider the selection of tools at your disposal, the greater the scope for invention.

## Conclusion

We have seen how we can smooth price data using an exponential moving average indicator in both MT4 and MT5.

Not only does this indicator help confirm the trend, but it can also be used to provide trading signals, as we saw with the exponential moving average crossover strategy.

As with all moving averages, you need to be aware that the exponential moving average is a lagging indicator. Because it utilises past data, the price will always be on the move before the EMA reacts. Generally speaking, an exponential moving average will respond quicker to newer data compared with an SMA, as it assigns more weight to more recent prices. The exact curve characteristics are governed by the period you choose, of course.

A great way to determine what the best exponential moving average settings for your own trading style is by testing the different options in a free demo trading account.

Because demo trading allows you to practice trading using virtual currency, it gives you the freedom to trial the settings until you find the perfect choice for you!

Get all of this and much more by clicking the banner below and starting your FREE download!