We use cookies to give you the best possible experience on our website. By continuing to browse this site, you give consent for cookies to be used. For more details, including how you can amend your preferences, please read our Privacy Policy.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage.

expand_more

# Filtering Out Price Noise Using The Exponential Moving Average

March 19, 2020 11:23 UTC

This article will discuss a specific type of moving average known as the 'Exponential Moving Average' (EMA). We'll also look at an easy-to-use trading tool called the 'Exponential Moving Average Indicator' that uses this method to assess trends within the Forex market.

## So What is An Exponential Moving Average?

An essential type of tool for assessing trends is the moving average. We use moving averages to smooth out variations in data, to better discern the underlying trend. They do this by looking back at a recent number of data points, and then calculating some form of average of the values. There is more than one way to calculate an average though, 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 model works, with the amount of weighting assigned to a price decreasing exponentially as we go backwards in time.

What is a Exponential Moving Average?

It is fairly difficult to provide a satisfactory exponential moving average definition without getting into the specifics of the calculations involved. A broad 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 get our hands dirty and look at the maths. So let's go ahead and roll up our sleeves.

## How to Calculate an 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, EMAt-1 is the EMA for the previous period. You can see from this that calculating the EMA for a given point in time requires us to have performed prior calculations, 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 EMA 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 find an exponential moving average is to look at a specific example.

## Exponential Moving Average Example

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 EMA.

 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.

That way, you can see the comparative values of the exponential average vs the simple moving average. We also need to use a smoothing factor. This is governed by the number of periods in the EMA. Specifically, the equation for the smoothing value is as follows:

• α = 2/ (n + 1)

Another way of describing what the calculation method is doing is to say that the EMA is by looking back at past values, and then discounting their weights by a factor of (1-α) per period. We can see from this that another, fuller name for the method is an 'exponential-weighted moving average model'. Exponential moving average forecasting is a widely-used method of time series modelling in business because it works well under a large range of conditions, while also being fairly simple to calculate.

It's common for management to make decisions based on projections of future business metrics. Such projections are often derived from EMA data models. A moving average forecasting example might include looking at previous sales data, exponentially-smoothed in order to make projections for future sales. In a similar way, professional traders use EMAs to smooth previous price data in the hopes of tapping into an ongoing trend.

In our calculations above, we only went back to include a small number of previous data points. An EMA will be more accurate the further you go back; however, and ideally, you want to be including much larger amounts of previous EMA values. Any platform worth its salt will run the exponential moving average algorithm for you, so that you don't need to worry about the complexity of the calculations. Let's now look at how to use the MetaTrader 4 EMA indicator.

## EMA Indicator in MetaTrader 4

The Exponential Moving Average Indicator comes with the MT4 download, as one of the core tools bundled with the platform. As you can see from the image below, the Moving Average indicator is listed as one of the Trend indicators within MT4:

Source: MetaTrader 4 - How to select the EMA in MT4

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 EMA 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.

Obviously, just how long those trends are will be dictated by the time frame of your chart. The shift setting works by offsetting the EMA curve along the x-axis by the number you specify. The default value of 0 for the shift setting is a good place to start. The image below shows a 16-period Forex EMA indicator added to an hourly EUR/USD chart:

Depicted: MetaTrader 4 - price data from Admiral Markets - hourly EUR/USD chart - Disclaimer: Charts for financial instruments in this article are for illustrative purposes and does not constitute trading advice or a solicitation to buy or sell any financial instrument provided by Admiral Markets (CFDs, ETFs, Shares). Past performance is not necessarily an indication of future performance.

The EMA chart indicator appears as a dotted green line with the settings we have chosen. 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.

It is the slope of the MT4 EMA indicator that guides us to the trend. Notice how we get a sustained uptrend after the price breaks above the EMA line? This is one of the key aspects of how to trade with the EMA Indicator – price crossing above the EMA can provide a trading signal.

## Exponential Moving Average Trading Strategy

An even more effective way of reading an exponential moving average cross 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 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 then 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.

## Using an EMA 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 can be as a trend filter for a breakout strategy. Consider a trend-following Bollinger Bands/exponential moving average breakout system – 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 a short-term EMA and a long-term EMA line, agreed with the direction. So for a breakout above the upper Bollinger Band, it would be a buy signal, and we would need the short-term EMA to be above the long-term EMA for us to follow the 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. There's a lot of combinations that have been and can still be dreamt up – and the wider the selection of tools at your disposal, the greater the scope for invention. MetaTrader Supreme Edition is an plugin for MetaTrader 4 and MetaTrader 5 that offers a huge expansion in the range of indicators and trading tools at your disposal. It's free to download, so why not try this cutting-edge upgrade?

## Conclusion

We have seen how we can smooth price data using an exponential moving average. Not only does this indicator help confirm the trend, but it can also help to inform you when to trade, as we saw with the MT4 EMA crossover indicator strategy. As with all moving averages, you need to be aware that an EMA responds with a lag.

Because it utilises past data, the price will always be on the move before the EMA starts to move. Generally speaking, an EMA 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 are is to go ahead and test them in a demo trading account. Because demo trading is risk-free, it allows you the freedom to tinker with the settings until you can find the perfect mix for you. We hope that you enjoyed this discussion of trading with exponential moving averages.

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