What is a Moving Average?
A moving average is a technical indicator that market analysts and investors may use to
determine the direction of a trend. It sums up the data points of a financial security over a
specific time period and divides the total by the number of data points to arrive at an average.
It is called a “moving” average because it is continually recalculated based on the latest price
data.
Analysts use the moving average to examine support and resistance by evaluating the
movements of an asset’s price. A moving average reflects the previous price
action/movement of a security. Analysts or investors then use the information to determine
the potential direction of the asset price. It is known as a lagging indicator because it trails the
price action of the underlying asset to produce a signal or show the direction of a given trend.
Types of Moving Averages
The following are the two basic forms of moving averages:
1. Simple Moving Average (SMA)
The simple moving average (SMA) is a straightforward technical indicator that is obtained by
summing the recent data points in a given set and dividing the total by the number of time
periods. Traders use the SMA indicator to generate signals on when to enter or exit a market.
An SMA is backward-looking, as it relies on the past price data for a given period. It can be
computed for different types of prices, i.e., high, low, open, and close.
In financial markets, analysts and investors use the SMA indicator to determine buy and sell
signals for securities. The SMA helps to identify support and resistance prices to obtain
signals on where to enter or exit a trade.
When generating the SMA, traders must first calculate this average by adding prices over a
given period and dividing the total by the total number of periods. The information is then
plotted on a graph.
The formula for Simple Moving Average is written as follows:
SMA = (A1 + A2 + ……….An) / n
Where:
A is the average in period n
n is the number of periods
Example of a Simple Moving Average
John, a stock trader, wants to calculate the simple moving average for Stock ABC by looking
at the closing prices of the stock for the last five days. The closing prices for Stock ABC for
the last five days are as follows: $23, $23.40, $23.20, $24, and $25.50. The SMA is then
calculated as follows:
SMA = ($23 + $23.40 + $23.20 + $24 + $25.50) / 5
SMA = $23.82
2. Exponential Moving Average (EMA)
The other type of moving average is the exponential moving average (EMA), which gives
more weight to the most recent price points to make it more responsive to recent data points.
An exponential moving average tends to be more responsive to recent price changes, as
compared to the simple moving average which applies equal weight to all price changes in
the given period.
When calculating the exponential moving average, the following three steps are used:
1. Calculate the simple moving average for the period
The EMA needs to start somewhere, and the simple moving average is used as the previous
period’s EMA. It is obtained by taking the sum of the security’s closing prices for the period
in question and dividing the total by the number of periods.
2. Calculate the multiplier for weighting the exponential moving average
The formula for calculating the multiplier is as follows:
Multiplier = [2 / (Selected Time Period + 1)]
For example, if the time period in question is 10, the multiplier will be calculated as follows:
Multiplier = [2 / (10+1)] = 0.1818
3. The last step is to calculate the current exponential moving average
The last step calculates the current EMA by taking the period from the initial EMA until the
most recent time period, using the price, multiplier, and the previous period’s EMA value. It
is computed using the following formula:
Current EMA = [Closing Price – EMA (Previous Time Period)] x Multiplier + EMA
(Previous Time Period)
The weighting given to recent price data is higher for a longer-period EMA than a shorterperiod EMA. A multiplier of 18.18% is applied to the recent price points of a 10-period
EMA, whereas a 9.52% multiplier is applied for the recent price points of a 20-period EMA.
Calculating a 5-Year Moving Average Example
Example Problem: Calculate a five-year moving average from the following data set:
Year
Sales ($M)
2003
4
2004
6
2005
5
2006
8
2007
9
2008
5
2009
4
2010
3
2011
7
2012
8
The mean (average) sales for the first five years (2003-2007) is calculated by finding the
mean from the first five years (i.e. adding the five sales totals and dividing by 5). This gives
you the moving average for 2005 (the center year) = 6.4M:
Year
Sales ($M)
2003
4
2004
6
2005
5
2006
8
2007
9
(4M + 6M + 5M + 8M + 9M) / 5 = 6.4M
The average sales for the second subset of five years (2004 – 2008), centered around 2006,
is 6.6M:
(6M + 5M + 8M + 9M + 5M) / 5 = 6.6M
The average sales for the third subset of five years (2005 – 2009), centered around 2007,
is 6.6M:
(5M + 8M + 9M + 5M + 4M) / 5 = 6.2M
Continue calculating each five-year average, until you reach the end of the set (2009-2013).
This gives you a series of points (averages) that you can use to plot a chart of moving
averages. The following Excel table shows you the moving averages calculated for 20032012 along with a scatter plot of the data: