Srading.com

Menu
  • Home
  • Markets
    • Forex
    • Stock
  • Fundamental Analysis
    • Economics
    • Money & Banking
  • Technical Analysis
    • Drawing Tools
    • Chart Patterns
  • Tools
    • Online Charts
    • Economic Calendar
    • Interest Rate Today (Live Widget)
    • Forex Market Hours
    • Currency Indexes Chart
    • National Holiday Calendar
    • CoT Chart
    • Quotes
Home
Technical Analysis
Drawing Tools
All Moving Averages (SMA, EMA, SMMA, and LWMA)
Drawing Tools

All Moving Averages (SMA, EMA, SMMA, and LWMA)

June 13, 2022 Zafari

Moving averages are indicators that move alongside price movements. They are lagging (trend) indicators because they help you define if the market trend is upward or downward.

Numerous traders define a trend by Moving Averages. For example, in an uptrend, if a moving average crosses from the bottom of the price line to above, the trend has changed from an uptrend to a downtrend, and vice versa.

In this article, I explain Moving Averages completely from their formula to the types of moving averages.

Read more: Technical Indicators: Types and How to Use Them?

You Will Continue Reading

Toggle
  • The Period in Calculation of Moving Averages
  • Price Application on Moving Averages
  • Methods Used for Calculation of Moving Averages
    • Simple Moving Average (SMA)
      • Example of Simple Moving Average (SMA) Calculation
    • Exponential Moving Average (EMA)
      • Example of Exponential Moving Average Calculation (EMA)
    • Smoothed Moving Averages (SMMA)
      • Example of SMMA Calculation
    • Linear Weighted Moving Averages
      • Example of Linear Weighted Moving Average (LWMA) Calculation
    • All Graphs of MAs in One Image
  • Shifting MAs
  • How to Use Moving Averages?
  • Adding MAs in MT4 and MT4
    • Properties of MAs in MT4 and MT5

The Period in Calculation of Moving Averages

In a moving average indicator, the period indicates the number of sessions or number of candlesticks used in its calculation.

In the moving averages, you are free to select the number of candlesticks to be used in the indicator construction. However, the most famous periods (number of candlesticks) are the 14, 24, 36, and 200.

A small number moving average is more sensitive to price action moving closer to the current price. On the other hand, a large number is less sensitive and moves with distance from price movements.

If you apply a shorter period in a moving average indicator, it will cross the chart line more frequently and provides too many signals but is less accurate. Specifically, during consolidation, it will generate too many false signals.

On the other hand, higher moving averages are less sensitive. It means that if you use more periods (candlesticks), you are given fewer signals and more accurate but later.

Short vs Long periods in Moving Average (MA)
The red line represents 200 MA and Dark Green one 100 MA | MAs applied in MT4 by MetaQuotes Software

In the above chart, I applied two Simple Moving Averages (SMA) 100 and 200 respectively. The Dark Green line is 100 SMA, and the red line is 200 SMA. You can see that 100 MA (a shorter MA) moves closer to the price and 200 MA (the longer one) move with more distance from the price. Additionally, you can see that a shorter SMA crosses the price line more frequently than the longer one.

Price Application on Moving Averages

In the calculation of Moving averages, traders commonly use the closing price of sessions. You also can use open, close, high, low, medium price, typical price, and weighted closing price. I will explain the above terms in simple words in the following. 

  • Close: It is the exact price when the session (time-frame) ends
  • Open: It is the opening price of a period (candlestick)
  • High: The highest price of a session (candlestick)
  • Low: Lowest price of a session (candlestick)
  • Medium Price (HL/2): Medium price of a range (Highest price + Lowest price divided by two)
  • Typical Price (HLC/3): Adding the three highest, lowest, and closing prices of a session and dividing by three.
  • Weighted Close (HLCC/4): It is calculated by adding the highest, and lowest, multiplying the closing price by two, and finally dividing by four. 

Applying different prices on moving averages has different meanings and implications. Any of the above prices that you choose produce a slightly different moving average line (graph) on your chart. You have to experience all of them separately to find out what suits your strategy the best. 

The closing price is considered more important because, at end of a session, a financial asset is priced fairer than at the beginning and middle of a session. It is believed that investors and traders during the day find the fair price of an asset by discussion, reading reports, and following news, for example. That is why the closing price is used more than any of them.

Methods Used for Calculation of Moving Averages

Moving averages are different based on price emphasis on candlesticks. Various methods weigh earlier, middle, and last candlesticks distinctively. Each method displays the graph differently.

Traders use different methods because it is subjective. Some traders prefer to put weight on last candlesticks, while others do not distinguish. You have to find what suits you the best for your personality and trading strategy.

Typically, there are three ways to calculate moving averages, and they are:

Simple Moving Average (SMA)

A simple moving average takes average without weighing differently first, middle, or last candle (I use a candlestick instead of a bar or other charts because every trader uses it). For example, if you are using 14-period moving averages, the last 14 candlesticks are considered in the calculation. When a new session opens, it drops one candlestick from the beginning and adds the new candle into the measurement.

Example of Simple Moving Average (SMA) Calculation

Suppose that a stock price ends with the following prices: 4,7,6,4,8,5,7,7,8,5. Calculate the Simple Moving Average of these values applied to closing prices. 

Solution: 

  1. The first value of SMA: (4+7+6+4+8)/5=5.8
  2. The second value of SMA: (7+6+4+8+5)/5=6
  3. The third value of SMA: (6+4+8+5+7)/5=6
  4. Fourth value of SMA: (4+8+5+7+7)/5=6.2
  5. Fifth value of SMA: (8+5+7+7+8)/5=7
  6. Sixth value of SMA: (5+7+7+8+5)/5=6.4

Putting the result of these solutions, give the SMA graph.

Simple Moving Average (SMA)

In the above chart, you see the graph of SMA for six days. You may ask, why six days MA while we had 10 days closing prices? The answer is that we calculated 5-day (5-candlesticks, sessions) MA, so we need to have at least 5 sessions to start the calculation.

Exponential Moving Average (EMA)

An Exponential Moving Averages emphasizes the value of the last session or sessions. Some traders prefer this type of moving average because they believe that the last sessions are more important.
Exponential moving averages are more sensitive than Simple Moving Averages and Lagging Moving Averages.

Example of Exponential Moving Average Calculation (EMA)

To solve an example of EMA, we consider the above closing prices. 

The formula of Exponential Moving Average: 

EMA = EMAy + WM(Current Closing Price – EMAy)

In the above formula:

  • EMA: Exponential Moving Average Current Candlestick
  • EMAy: Exponential Moving Average of yesterday
  • Current price: the latest price of a candle
  • WM: Weighted Multiplier = 2/(N+1) where N represents the number of candlesticks in the calculation.

Now let us calculate the EMA of the closing price of a stock that ended with the following prices: 4,7,6,4,8,5,7,7,8,5.

Note: to start the calculation of EMA for the first time, we consider the last SMA as the previous EMA because we do not have the previous EMA. 

We need Weighted Multiplier (WM) for every time of calculation so let us first calculate it. 

WM = 2/(5+1) = 0.33

  1. The first EMA equals to SMA = (4+7+6+4+8)/5=5.8
  2. The second EMA = 5.8 + 0.33(5 – 5.8) = 5.53
  3. The third EMA = 5.53 + 0.33(7 – 5.53) = 6.01
  4. Fourth EMA = 6.01 + 0.33(7 – 6.21) = 6.27
  5. Fifth EMA = 6.27 + 0.33(8 – 6.27) = 6.84
  6. Sixt EMA = 6.84 + 0.33(5 – 6.84) = 6.23

To draw the EMA line the only thing that we need to do is to connect the results of these calculations.

Exponential Moving Average (EMA)

Smoothed Moving Averages (SMMA)

A Smoothed Moving Averages makes the moving average graph/line calm/smooth to calm down short-term volatilities. That is why the word “Smoothed” is used to name it.

SMMA does not remove old prices from calculation but its impact gets less and less as time passes. And, it is not as popular as Simple Moving Average.

The first value in a Smoothed Moving Average (at the beginning), is a Simple Moving Average. And, we smooth the next values by the following formula:

SMMA = (PSS – PSMMA + Closing Price)/n

Where:

  • SMMA – Smoothed Moving Average of current candlestick
  • PSS – Previous time-frames/bar/candle Smoothed Sum for N periods
  • PSMMA – Previous Smoothed Moving Average
  • Closing Price – Closing Price of current time frame (bar or candle)
  • n – Number of bar/time-frame/candle

Example of SMMA Calculation

The first value in SMMA is an SMA. The following values are calculated based on the SMMA formula. 

For the calculation of SMMA, we use the above data we solved for the two above examples. 

Let us start 

Once again, the SMMA formula is:  SMMA = (PSS – PSMMA + Closing Price)/n

The closing value set is: 4,7,6,4,8,5,7,7,8,5.

  1. The first SMMA = {(4+7+6+4+8)/5} = 5.8
  2. The second SMMA = (29 – 5.8 + 5)/5 = 5.64
  3. The third SMMA = (30 – 5.64 + 7)/5 = 5.87
  4. Fourth SMMA = (30 – 5.87 + 7)/5 = 6.22
  5. Fifth SMMA = (31 – 6.22 + 8)/5 = 6.55
  6. Sixt SMMA = (32 – 6.55 + 5)/5 = 6.09

 By connecting the results of the above example, we get an SMMA line. 

Smoothed Moving Average (SMMA)

Read more: What are Fibonacci Numbers, Golden Ratios, and Tools

Linear Weighted Moving Averages

In a Linear Weighted Moving Average, more weight is given to the recent candles and gradually lowers the weight from the current to the earlier candlesticks.

For example, in a 5-day LWMA, we multiply the value of the recent (fifth) candle by five, the fourth by four, and so on. Finally, we divide by the sum of the weights (5+4+3+2+1=15).

LWMA formula: LWMA = {(PnW1) + (Pn-1W2) + (Pn-2W3) + (Pn-3W4)….}/Sum of Ws

Among moving averages, the linear moving average is more reactive (sensitive) than SMA, EMA, and SMMA. It is more sensitive because of the more weight that it puts on the recent candles.

Example of Linear Weighted Moving Average (LWMA) Calculation

To create a graph line example of LWMA, we continue the calculation of values using the above closing prices. 

Once more, the closing prices of our hypothetical stock are 4,7,6,4,8,5,7,7,8,5.

We calculate 5-day (5 candlesticks) to understand LWMA. 

Once more, the LWMA formula is: 

LWMA = {(Pn*W1) + (Pn-1*W2) + (Pn-2*W3) + (Pn-3*W4)….}/Sum of Ws

  1. The first value in LWMA = {(8*5) + (4*4) + (6*3) + (7*2) + (4*1)}/(5+4+3+2+1) = 6.13
  2. {(5*5) + (8*4) + (4*3) + (6*2) + (7*1)}/(5+4+3+2+1) = 5.86
  3. {(7*5) + (5*4) + (8*3) + (4*2) + (6*1)}/(5+4+3+2+1) = 6.2
  4. {(7*5) + (7*4) + (5*3) + (8*2) + (4*1)}/(5+4+3+2+1) = 6.53
  5. {(8*5) + (7*4) + (7*3) + (5*2) + (8*1)}/(5+4+3+2+1) = 7.1
  6. {(5*5) + (8*4) + (7*3) + (7*2) + (5*1)}/(5+4+3+2+1) = 6.7

 By connecting the above results, we get a Linear Weighted Moving Average (LWMA).

Linear Weighted Moving Average (LWMA)

Read more: Three Main Economic Indicators

All Graphs of MAs in One Image

To compare various types of moving averages, I have put all of them in one image.

All Moving Averages Together

In the above image, you see that shapes vary. And, they even cross each other in some places.

If you want a smoother MA, then SMMA and SMA are better. On the other hand, if you want to weigh recent candlesticks, then EMA and LWMA are better choices.

It is always good to practice, and find the best one that suits your strategy.

Shifting MAs

In some software like MT5, you can shift the moving average line to the left or right of the current price.

Some traders believe, that shifting a moving average backward at the middle of the period is the correct way to place it. For example, if you are using 14 candlesticks moving average, they put the moving average of seven candlesticks back, which is the center of 14 candlesticks.

Shifting to the right side doesn’t work at all. You can try it to see if something is happening.

In my own experience shifting the line of moving average forward or backward makes analysis more difficult. Placing the moving average backward or forward provides too early or late trend change signals. Moving averages determine the trend so, it will not be helpful if it gives you too early or too late trend change signals.

Shifting MAs
Shifting Moving Average in MT4 by MetaqQuots

In the above chart, I shifted 200 Moving Average to the right by 20 candlesticks.

How to Use Moving Averages?

As you read, there are various types of moving averages.

All of them say the same story but differently. They define the price of a financial instrument as if it is upward or downward.

What type of moving average should you use? There are no strict rules. It is up to you and your strategy. You may need to experience and practice to find the one that suits you perfectly.

I prefer to use moving averages just for their simplicity. Additionally, I define a trend by chart pattern and an oscillator such as MACD and RSI.

I think should not rely on a single tool to decide a trend’s direction. It is always better to combine your analysis with indicators, patterns, fundamental analysis, etc.

Adding MAs in MT4 and MT4

For inserting moving averages in MT4 and MT5, you have two options.

First, go to Insert>Indicators>Trend and click on Moving Average.

The second way to insert a moving average is by going to Chart Toolbar.

Read more: Equidistant Channel in MT4: Complete Introduction

Properties of MAs in MT4 and MT5

To open the window of properties, right-click on the Moving Average line and lift click on MA properties.

The window of properties has three tabs, parameters, levels, and visualization.

  • Parameters tab contains Period, Shift, MA Method, Apply to, and style. We discussed it earlier, so we do not repeat it here.
  • In the levels tab, you can add more lines that move at a specific distance from the main MA line. 
  • The visualization tab shows time-frames that you want your MAs to appear.
Share
Tweet
Linkedin
Pinterest
Reddit
Email
Prev Article
Next Article
Tags:Forex Stocks Technical Analysis

Related Articles

Support and Resistance Lines: How to Trade and Examples

Support and Resistance Lines: How to Trade and Examples

What Are Fibonacci Arcs and Do They Work?

What Are Fibonacci Arcs and Do They Work?

Momentum Indicator: Calculation and How to Trade

Momentum Indicator: Calculation and How to Trade

Vertical and Horizontal Lines in the Forex

Vertical and Horizontal Lines in the Forex

Relative Strength Index (RSI): Calculation & How to Trade It?

Relative Strength Index (RSI): Calculation & How to Trade It?

What is A Fibonacci Expansion & How to Use It?

What is A Fibonacci Expansion & How to Use It?

About The Author

Zafari

Zafari is a professional trader and has been in the financial market since 2014. He has a bachelor of public economics and an MBA. For some reason, he does not show his face. And he loves you all!

Leave a Reply Cancel Reply

Recent Posts

  • Capitalism: The Definitive Guide
    What Is Capitalism? Capitalism is an economic and political system …
  • Trading Checklist: What It Is, Info-graphic, and …
    What Is a Trading Checklist? A trading checklist is a …
  • Private Equity (PE): What It Is, How …
    Private equity is an investment in a private company. The …
  • Government Spending: The Definitive Guide
    Government spending refers to the government’s total expense and the …
  • Three Basic Economic Questions Explained in Simple …
    Three basic economic questions are: Who answers these questions? The …

Popular Posts

    Srading.com

    QUICK LINKS

    • About
    • Cookies Policy
    • Terms & Conditions
    • Disclaimer
    • Privacy Policy
    • Contact Us

    LATEST POSTS

    • Capitalism: The Definitive Guide
    • Trading Checklist: What It Is, Info-graphic, and PDF
    • Private Equity (PE): What It Is, How It Works, & How to Get In
    • Government Spending: The Definitive Guide
    • Three Basic Economic Questions Explained in Simple Words

    FOLLOW US ON SOCIAL MEDIA

    • Facebook
    • Twitter
    • LinkedIn
    • Instagram
    • Pinterest
    • Telegram
    • Reddit
    • YouTube

    Trading financial assets are risky. Everything you read on this website is just for educational purposes or personal opinions only. Read our DISCLAIMER!

    Copyright © 2025 Srading.com
    Call on WhatsApp

    Ad Blocker Detected

    Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

    Refresh
    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By continuing this website or clicking “Accept”, you consent to the use of ALL the cookies.
    Do not sell my personal information.
    Cookie SettingsAccept
    Cookies Policy
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT