CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 75% of retail investor accounts lose money 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.

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 75% of retail investor accounts lose money 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.

Moving Averages - What Is a Moving Average?

Related subjects:
Reading time: 3 minute(s)
The two basic and most commonly used moving averages include the Simple Moving Average (SMA) and the Exponential Moving Average (EMA). The first is the simple average of a security over a defined number of time periods, while the second gives a greater weight to more recent prices.
  • A moving average is a trend-following indicator based on past prices.
  • A moving average is calculated by choosing certain periods and then dividing this number by the number of chosen periods.
  • Moving averages can help in smoothing out of price action.
  • Moving averages are used not only to identify the direction of the trend, but also for trade entry.

The two basic and most commonly used moving averages include the Simple Moving Average (SMA) and the Exponential Moving Average (EMA). The first is the simple average of a security over a defined number of time periods, while the second gives a greater weight to more recent prices.

The image below shows the SMA, which is formed by calculating the average price of a financial market over a chosen period of time.

SMA1.png

Source: xStation

The EMA, as demonstrated in the image below, applies more weight and significance to most recent prices, and less weight to older prices in the chosen period.

EMA1.png

Source: xStation

The image below shows a comparison between the SMA (blue line) and the EMA (orange line).

EMASMA.png

Source: xStation

Why use moving averages in trading

Moving averages are popular in technical market analysis, as they are able to smooth price data, form trend lines, and create an easily interpreted visual aid. They are especially well-suited for price charts and other indicators. Some of the advantages of using moving averages include:

  • Moving average is used for forecasting goods or commodities with constant demand, where there is a slight trend or seasonality.
  • Moving average is useful for separating out random variations.
  • Moving average can help you identify areas of support and resistance.
  • Simplicity of application and interpretation makes it possible to plot several different moving average lines at the same time.
  • Moving average gives constant forecasts.

Disadvantages of moving averages

No method is perfect, and moving average comes with its own set of disadvantages. Moving average:

  • Requires maintaining history of different time periods for each forecasted period.
  • Often overlooks complex relationships mentioned in the data.
  • Does not respond to the fluctuation that take place for a reason, for example cycles and seasonal impacts.

How to trade using moving averages

There are various methods of using moving averages in trading. Below we focus primarily on:

  • Using one moving average
  • Using two moving averages

1. Using One Moving Average

When one moving average is applied to the chart, then a buy signal is provided when the chart breaks the moving average from the bottom with the body of a candlestick. On the other hand, a sell signal is provided when the chart breaks the moving average from the top with the body of a candlestick.

SMA2.png

Source: xStation

In the example above, a 50 period SMA was applied to Gold. As you can see, the market first provided a buy signal, after which the market gained in value. Later the market broke the SMA from the top providing a sell signal, after which the market lost in value.

2. Using Two Moving Averages

When two moving averages are used with two different periods, a buy signal is provided when the shorter term moving average breaks the longer term moving average from the bottom. On the other hand, a sell signal is provided when the shorter moving average breaks the longer term moving average from the top.

twosma.png

Source: xStation

In the example above, a 50-period SMA (blue line) and a 100-period SMA (white line) were applied on the DE30 chart. A buy signal was provided when the 50-period SMA broke the 100-period SMA from the bottom, after which the market gained in value.

Keep in mind, however, that all indicators and oscillators often provide false signals and should thus be used with other technical analysis tools. When all the tools you’ve used indicate the same direction for the market, this increases the probability of the success of the trade.

This content has been created by XTB S.A. This service is provided by XTB S.A., with its registered office in Warsaw, at Prosta 67, 00-838 Warsaw, Poland, entered in the register of entrepreneurs of the National Court Register (Krajowy Rejestr Sądowy) conducted by District Court for the Capital City of Warsaw, XII Commercial Division of the National Court Register under KRS number 0000217580, REGON number 015803782 and Tax Identification Number (NIP) 527-24-43-955, with the fully paid up share capital in the amount of PLN 5.869.181,75. XTB S.A. conducts brokerage activities on the basis of the license granted by Polish Securities and Exchange Commission on 8th November 2005 No. DDM-M-4021-57-1/2005 and is supervised by Polish Supervision Authority.

Xtb logo

Join over 1 Million investors from around the world

We use cookies

By clicking “Accept All”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.

This group contains cookies that are necessary for our websites to work. They take part in functionalities like language preferences, traffic distribution or keeping user session. They cannot be disabled.

Cookie name
Description
SERVERID
userBranchSymbol cc 17 October 2024
adobe_unique_id cc 16 October 2025
test_cookie cc 1 March 2024
SESSID cc 9 September 2022
__hssc cc 16 October 2024
__cf_bm cc 16 October 2024
intercom-id-iojaybix cc 13 July 2025
intercom-session-iojaybix cc 23 October 2024
xtbCookiesSettings cc 16 October 2025
xtbLanguageSettings cc 16 October 2025
TS5b68a4e1027
countryIsoCode
userPreviousBranchSymbol cc 16 October 2025
TS5b68a4e1027
_cfuvid
intercom-device-id-iojaybix cc 13 July 2025
__cfruid
__cf_bm cc 16 October 2024
__cf_bm cc 16 October 2024
_cfuvid
adobe_unique_id cc 16 October 2025
TS5b68a4e1027
_cfuvid
xtbCookiesSettings cc 16 October 2025
SERVERID
TS5b68a4e1027
__hssc cc 16 October 2024
test_cookie cc 1 March 2024
intercom-id-iojaybix cc 13 July 2025
intercom-session-iojaybix cc 23 October 2024
intercom-device-id-iojaybix cc 13 July 2025
UserMatchHistory cc 31 March 2024
__cf_bm cc 16 October 2024
__cf_bm cc 16 October 2024
__cf_bm cc 16 October 2024

We use tools that let us analyze the usage of our page. Such data lets us improve the user experience of our web service.

Cookie name
Description
_gid cc 9 September 2022
_gat_UA-22576382-1 cc 8 September 2022
_gat_UA-121192761-1 cc 8 September 2022
_ga_CBPL72L2EC cc 16 October 2026
_ga cc 16 October 2026
AnalyticsSyncHistory cc 8 October 2022
af_id cc 31 March 2025
afUserId cc 1 March 2026
af_id cc 1 March 2026
AF_SYNC cc 8 March 2024
__hstc cc 14 April 2025
__hssrc
_vwo_uuid_v2 cc 17 October 2025
_ga_TC79BEJ20L cc 16 October 2026
_vwo_uuid cc 16 October 2025
_vwo_ds cc 15 November 2024
_vwo_sn cc 16 October 2024
_vis_opt_s cc 24 January 2025
_vis_opt_test_cookie
_ga cc 16 October 2026
_ga_CBPL72L2EC cc 16 October 2026
__hstc cc 14 April 2025
__hssrc
_ga_TC79BEJ20L cc 16 October 2026
af_id cc 31 March 2025
afUserId cc 1 March 2026
af_id cc 1 March 2026
AF_SYNC cc 8 March 2024
_gcl_au cc 14 January 2025
AnalyticsSyncHistory cc 31 March 2024
_gcl_au cc 14 January 2025

This group of cookies is used to show you ads of topics that you are interested in. It also lets us monitor our marketing activities, it helps to measure the performance of our ads.

Cookie name
Description
MUID cc 10 November 2025
_omappvp cc 28 September 2035
_omappvs cc 16 October 2024
_uetsid cc 17 October 2024
_uetvid cc 10 November 2025
_fbp cc 14 January 2025
fr cc 7 December 2022
muc_ads cc 16 October 2026
lang
_ttp cc 10 November 2025
_tt_enable_cookie cc 10 November 2025
_ttp cc 10 November 2025
hubspotutk cc 14 April 2025
YSC
VISITOR_INFO1_LIVE cc 14 April 2025
hubspotutk cc 14 April 2025
_uetsid cc 17 October 2024
_uetvid cc 10 November 2025
_ttp cc 10 November 2025
MUID cc 10 November 2025
_fbp cc 14 January 2025
_tt_enable_cookie cc 10 November 2025
_ttp cc 10 November 2025
li_sugr cc 30 May 2024
guest_id_marketing cc 16 October 2026
guest_id_ads cc 16 October 2026
guest_id cc 16 October 2026
MSPTC cc 10 November 2025
IDE cc 10 November 2025
VISITOR_PRIVACY_METADATA cc 14 April 2025
guest_id_marketing cc 16 October 2026
guest_id_ads cc 16 October 2026
guest_id cc 16 October 2026
muc_ads cc 16 October 2026
MSPTC cc 10 November 2025
IDE cc 10 November 2025

Cookies from this group store your preferences you gave while using the site, so that they will already be here when you visit the page after some time.

Cookie name
Description
personalization_id cc 16 October 2026
UserMatchHistory cc 8 October 2022
bcookie cc 16 October 2025
lidc cc 17 October 2024
lang
bscookie cc 8 September 2023
li_gc cc 14 April 2025
bcookie cc 16 October 2025
lidc cc 17 October 2024
bscookie cc 1 March 2025
li_gc cc 14 April 2025
personalization_id cc 16 October 2026

This page uses cookies. Cookies are files stored in your browser and are used by most websites to help personalise your web experience. For more information see our Privacy Policy You can manage cookies by clicking "Settings". If you agree to our use of cookies, click "Accept all".

Change region and language
Country of residence
Language