Home

How to Calculate Simple Moving Average in Trading

|
|  Updated:  
2017-02-02 15:05:35
|   From The Book:  
No items found.
AI Investing For Dummies
Explore Book
Buy On Amazon

A simple moving average (SMA) is a simple trading indicator to calculate and use. To calculate it, you add a number of prices together and then divide by the number of prices you added. An example makes the SMA clearer.

A nine-day moving average of Intel’s (INTC) closing price is calculated throughout May 2008 and then is plotted on a price chart. To start the SMA calculation, use the closing prices. Add the first nine closing prices together, from May 1 through May 13, and divide by 9. The resulting value is placed alongside the ninth trading day, May 13. Continue for each subsequent day in the month.

DateCloseSMA
5/1/2008 22.81
5/2/2008 23.09
5/5/2008 22.91
5/6/2008 23.23
5/7/2008 22.83
5/8/2008 23.05
5/9/2008 23.02
5/12/2008 23.29
5/13/2008 23.41 23.07
5/14/2008 23.49 23.15
5/15/2008 24.60 23.31
5/16/2008 24.63 23.51
5/19/2008 24.51 23.65
5/20/2008 23.73 23.75
5/21/2008 23.31 23.78
5/22/2008 23.53 23.83
5/23/2008 23.06 23.81
5/27/2008 23.25 23.79
5/28/2008 23.12 23.75
5/29/2008 22.80 23.55
5/30/2008 22.84 23.35

The SMA data is superimposed on the bar chart’s price data. Notice that you need nine prices before you can plot the first SMA point. In other words, the first SMA point appears on the ninth price bar, and the first eight price bars do not display an SMA value.

Trading chart shows a stock's daily closing prices as well as the simple moving average (SMA).
Credit: Chart courtesy of StockCharts.com

To calculate the second SMA point, add the prices from May 2 through May 14 together, divide by 9, and place the result as the SMA data point next to May 14.

Another way to think of calculating SMAs is that you drop the oldest price in the calculation and add the closing price from the next price bar. Continue this series by dropping the oldest price, adding the newest price, and dividing by 9 for the remainder of the month.

If you’re mathematically inclined, here’s what the series looks like as an equation:

SMA = (P[1] + P[2] + P[3] + . . . P[N]) ÷N

Where:

N is the number of periods in the SMA
P[N] is the price being averaged (usually the closing price)

Traders used to calculate SMAs by hand, but fortunately, computers now relieve traders from this rather mundane chore.

Luckily, you don’t have to do this calculation yourself. You can let StockCharts.com automatically calculate it for you. You’ll find the simple moving average as one of the overlays in the Chart Attributes section. You select the type of overlay you want, such as Moving Avg (simple), and then put in the number of periods. The simple moving average lines will be automatically generated on your chart.

About This Article

This article is from the book: 

No items found.

About the book author:

Michael Griffis became an active trader in the mid 1980s. He first traded commodities and precious metals after taking a commodities trading class as part of his MBA program at Rollins College. He became a stockbroker in 1992, where he helped businesses and individuals manage investments in stocks, bonds, mutual funds, retirement plans, 401(k) employee-savings plans, and asset management programs. Michael is an author and business owner and has written about stock trading for online audiences.

Lita Epstein, who earned her MBA from Emory University's Goizueta Business School, enjoys helping people develop good financial, investing, and tax planning skills. She designs and teaches online courses and has written more than 20 books, including Bookkeeping For Dummies and Reading Financial Reports For Dummies, both published by Wiley.