63.21 % of retail investors lose their capital when trading CFDs with this provider.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 63.21 % of retail investors lose their capital when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

The most commonly used tool for technical analysis

Published: 24.07.2024

This indicator has been with us for nearly 100 years and in that time the way they are used to identify trends has remained unchanged.

The origin of the mathematical formula for calculating this indicator dates back to the very beginning of the previous century in 1901 - its author was the British statistician R. H. Hooker. However, at that time it was called instantaneous average and was not used for trading on stock or commodity markets.

Later, however, the name we still know by today - moving average - was adopted for this statistical "tool". It is the 1920s and the founder of Dow Theory, Charles H. Dow, who focused on the study of trends in stock markets, began to use moving averages. If the name sounds familiar, it's no wonder, he is one of the spiritual fathers of the Dow Jones index.

So much for a brief history of moving averages, now let's look at what a moving average is, what types of moving averages exist, and how to use a moving average to identify a trend in any type of market.

What is a moving average

Simply put, a moving average is the average of prices over the last X periods. The main purpose of moving averages is to smooth the price of an instrument. You can see what it looks like in Figure 1 below, which shows a line chart of EURUSD (black) and a moving average over a 20-day period (green).
 


Moving average on the EURUSD pair
Moving average on the EURUSD pair

A guide to candlestick formations and price patterns

Download this free guide to help you get to grips with the basic types of candlestick formations and price patterns. Always keep it handy to learn the basics of price action and forecasting potential price movements.

Types of moving averages

The period variable is important for calculating the moving average. The shorter the period included in the calculation, the more the moving average will be choppy. The longer the period used, the smoother the indicator will be.

 

In technical analysis, we use two basic types of moving averages:

  • Arithmetic (simple) moving averages

  • Exponential moving averages


Arithmetic moving averages

Arithmetic moving averages (sometimes also called simple moving averages, abbreviated SMA, which we will use hereafter) are the average of the most recent prices of an instrument over a certain period.

If we want to calculate the SMA for the last 10 days, we add up the prices of the instrument for that period and divide that sum by 10. In addition, all available trading platforms have this indicator on offer and therefore there is no need to manually calculate anything. In the indicator settings, we simply select the period for which we want to calculate the SMA. Moving averages are based on historical prices. Therefore, like other indicators, they will be lagged.

In Figure 2 we see two moving averages. One is with a period of 20 (green) and the other with a period of 50 (purple). The SMA20 reacts faster to a price change than the SMA50. It is true that the longer the period we choose to calculate the average, the slower the average will react to the last price change. We can also see that the SMA20 crosses the SMA50 at certain points. If the SMA20 is below the SMA50, it's a sell signal, if it's the other way around, it's a buy signal - but we'll talk about that in more detail later.
 

Arithmetic moving average of SMA20 and SMA50
Arithmetic moving average of SMA20 and SMA50

At point A, a buy signal was generated because the faster SMA20 was above the slower SMA50. At point B, a sell signal was generated because the faster SMA20 got below the slower SMA50. The signals at points C and D, which indicated that there was a change in the downtrend, were false. The signal at point E is then a sell signal.

So we can see that if we rely on the crossing of simple moving averages, sometimes this will offer interesting trading opportunities, but this is not always the case. We can combine the weighted averages in different ways and change the period settings but this does not solve the problem of false signals.
 

Exponential moving averages

Exponential moving averages, unlike arithmetic averages, give more weight to recent prices. They therefore give more weight to what traders have done in the last few days than what they did a week ago which is significant. In technical analysis, we refer to them by the abbreviation EMA. EMA20, for example, is the exponential average of the last twenty candles. The number of candles, or the length of the period from which we calculate the average, is arbitrary.

In Figure 3 we see a comparison of the arithmetic average and the exponential average, both calculated for a period of 20 days.
 

Arithmetic mean of SMA20 (green) and exponential mean of EMA20 (orange)
Arithmetic mean of SMA20 (green) and exponential mean of EMA20 (orange)


Note that the orange line of the EMA20 is closer to the price than the SMA20. This is due to the fact that the EMA gives more weight to recent prices and is therefore more accurate for shorter periods.
 

Advantages and disadvantages of SMA and EMA

Který průměr tedy využít? Záleží na účelu, pro který chceme tento indikátor využít.
 

 

Exponential moving average (EMA)

Simple moving average (SMA)

Advantages

It shows the latest market reaction more accurately

Suitable for determining the long-term trend

It is more smoothed

Disadvantages

It is less smoothed and gives more false signals

It's slow, so it's giving signals late

 

Try moving averages in a free demo account

Determining the trend using EMA and SMA moving averages

It would be unfair to mention in the article Charles H. Dow as one of the popularizers of moving averages and not to mention his Dow theory. We still use it today and often do not even know to whom we owe it. The Dow Theory states that during an uptrend there is a higher high and a higher low. During a downtrend, on the other hand, a lower low and a lower high. Let's show this in Figure 3, but then we'll abandon this theory because it doesn't use moving averages, which is what this article is about.
 

Downtrend depicted by Dow theory - lower high (LH) and lower low (LL) forming
Downtrend depicted by Dow theory - lower high (LH) and lower low (LL) forming


Price crosses the moving average

The first way to identify a trend using moving averages is to watch when the price crosses the moving average. Usually, if the price is above the average, the price is in an uptrend, if below the average, it is in a downtrend - see Figure 4.
 

Determining the trend using the exponential moving average EMA20
Determining the trend using the exponential moving average EMA20


Figure 4 shows the EURUSD currency pair in the 4H time frame. The orange line is the exponential moving average with a period of 20, i.e. in standard EMA20 notation.

We can see that when the EURUSD price moves below the EMA20, the pair tends to fall further until the price is above the EMA20, etc.

Thus, at point A a sell signal was generated, at point B a buy signal was generated, which lasted until point C, where a sell signal was generated again, etc.

You will notice that the signals are not always completely clean, but sometimes there will be several times when the average is crossed before the signal is confirmed. We also see that the average reacts to large price fluctuations with a large delay and thus does not copy the price. This is unfortunately quite common and is a feature of moving averages that are lagged.
 

Determining the trend using two or more averages

We can help ourselves by adding another exponential average. Figure 5 shows the same situation, plus we have an exponential average with a period of 50, the EMA50.

The situation appears a little clearer. The moment the faster EMA20 crosses the EMA50 from top to bottom, a short signal is generated, i.e. speculation of a decline. This is the situation at points A, C and E. At points B and D, the situation is when the EMA20 crosses the EMA50 from bottom to top, thus creating a buy signal, i.e. a long speculation on an increase in the instrument.
 

EMA20 (orange) and EMA50 (green) on the EURUSD currency pair
EMA20 (orange) and EMA50 (green) on the EURUSD currency pair


We can see that even this method is not perfect. In fact, the crossover occurred at a time when much of the move had already been realized. What if we tried other averages? Let's see what the situation would look like when we add another average in the chart, this time with a period of 10, i.e. in our EMA10 designation.
 

Chart with the EURUSD currency pair after adding the third moving average (EMA10 - blue)
Chart with the EURUSD currency pair after adding the third moving average (EMA10 - blue)


We can see that the EMA10 crosses the EMA20 first, followed by the crossing of the EMA20 and EMA50.

We can experiment with adding more averages. It is convenient to look at the whole situation from a bird's eye view using the top-down approach. That is, we start with the analysis on the weekly chart and progress to the lower time frames.
 

Weekly chart using moving averages
Weekly chart using moving averages

 

On the weekly chart at point A, a signal to decline, i.e. a speculation short, has occurred. This signal lasted from June 2014 to April 2017, when a buy signal was created at point B, which lasted for about a year and was terminated by a sell signal at point C.

Moving to a lower timeframe, for example, daily or 4H, we would then try to find suitable entry points, where after the signal at point A we would look for entries primarily on a short strategy and after the signal at point B we would look for long entries.

The Golden Cross and the Cross of Death

Underneath this mysterious and even spooky name are signals that point to the emergence of long-term trends. The TheGolden Cross points to a long-term rise, i.e. bull market. It is most often a situation where there is an upward crossover of the 50-day average with the 100-day average on the daily chart (or possibly an upward crossover of the 50-day average with the 200-day average).

A death cross, on the other hand, is a situation that indicates the emergence of a long-term bear, i.e., a declining market. This situation is created by crossing the 50-day and 100-day (possibly 200-day) averages downwards.

We can eventually monitor these situations on lower time frames to catch potential trend changes early. Figure 8 shows the situation of the golden cross that occurred at point A and the death cross at point B on the EURUSD currency pair.
 

Golden cross and death cross on the EURUSD currency pair - red EMA100; green EMA50; orange EMA20; blue EMA10
Golden cross and death cross on the EURUSD currency pair - red EMA100; green EMA50; orange EMA20; blue EMA10


Despite the fact that the golden cross or death cross signals are very strong signals, we must not forget that also these signals have not always been reliable in the past.

How to use moving averages in practice?

Moving averages are still one of the most popular indicators for identifying both the market trend and for entering or exiting a position. However, as is often the case in trading and technical analysis, they cannot be relied upon alone. Markets are unpredictable and technical analysis only serves to increase the statistical probability of your success, not guarantee success.

Therefore, it is always advisable to find another signal to your existing signals (in this case, for example, in the form of a golden cross or a death cross) to confirm your hypothesis. For example, price or candlestick formations are a great help.

63.21 % of retail investors lose their capital when trading CFDs with this provider.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 63.21 % of retail investors lose their capital when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.