What is a Simple Moving Average?
The simple moving average (SMA) is a widely used technical indicator for stock trading. Simple moving average is the average closing price of a security over a specified number of periods. The average is referred to as “moving” because it can be plotted on a chart bar by bar, resulting in a line that alternates or “moves” as the average value changes.
A time period must be selected in order to calculate a simple moving average. Each interval of time is referred to as a “bar.” As one example, a 20-bar SMA would be the average of the closing price of a security over the past 20 bars.
How The Indicator Works
Simple moving averages can be used to determine the direction of a trend. Essentially if the SMA is moving down, the trend direction is anticipated to move downward and if the SMA is moving upwards, the trend direction is anticipated to be upwards.
Simple moving averages can be used to smooth technical indicators and price related data. The longer the time interval of the SMA, the smoother the result will be, but the greater the lag that occurs between the SMA and the source.
Trading signals are often triggered by prices crossing above or below the SMA. When prices cross above the SMA, traders may cover short or go long while when they cross below the SMA they often exit long or go short.
How to Calculate Simple Moving Average
SMA = A1 + A2 + A3 / n
An = the price of a particular asset at period n
n = the total number of periods
For example, here is how a 5-day simple moving average would be calculated based on these closing prices over 10 days:
Week 1 (5 Days) - 18, 22, 24, 20, 23
Week 2 (5 Days) - 24, 26, 22, 20, 24
For a 5-day moving average, the average closing prices for the first 5 days would be taken as the first data point.
Then the first day’s closing price would be dropped and the 6th day’s closing price would be added, then average would be taken and that would result in the second data point and so on.
Types of Moving Averages
The 200-bar SMA is often utilized to determine overall long term market trends and covers approximately 40 weeks of trading if each bar represents one day.
The 50-bar SMA is used to determine intermediate market trends and covers approximately 10 weeks of trading.
Shorter SMAs such as 20-bar, 10-bar or 5-bar can be used to determine short-term trend fluctuations.