What Is a Moving Average?
Key Points
- Moving averages smooth out stock price fluctuations to clarify trends.
 - Simple and exponential are the main types of moving averages.
 - These tools help determine optimal stock buying or selling times.
 
Invest better with The Motley Fool. Get stock recommendations, portfolio guidance, and more from The Motley Fool's premium services.

There are a lot of different types of statistical models that investors use to determine when it's time to buy or sell a stock, but one of the most universal is the moving average. This simple but effective tool can help cut down the noise of the market and make it easier to see how a stock's price is actually behaving. Read on to learn more about moving averages and how to use them.
Technical traders often use the moving average to help them decide if it's a good time to buy or sell a stock. This statistical model can help smooth out daily price movements and cut down on visual volatility to see more clearly what is actually happening with the stock price itself, even in markets that are swinging wildly.
The moving average eliminates the impact of short-term swings by averaging the price of the stock over a set period -- say 14 days -- and then constantly comparing that to the same amount of time for each day in the group that is being examined. So, for example, if you started to look at the moving average on Oct. 1, you'd look back to Sept. 17 to calculate the average for that day. On Oct. 2, you'd look back to Sept. 18, and so forth. Stringing them all together creates the "movement" part of the moving average.
You can start at any date using historical data. For example, you might start looking at the moving average from Sept. 1 to see what trend you're working with by the time your curiosity on Oct. 1 came around.
There are two types of moving averages that most traders consider: the simple moving average and the exponential moving average.
A simple moving average is the basic way that moving averages are calculated. Every set of values across the period that's being used for the average is given the same weight, so if it were a 14-day window prior to the day in question, each of those 14 values would be simply averaged.
This is typically fine for short windows of time, since it's unlikely that any serious changes in movement or sentiment have happened yet, but it can be less accurate for longer windows, during which major events like financial reports may have changed sentiment entirely.
Exponential moving averages are a bit more complex and are designed to make the moving average more responsive to new information. This helps especially when the market is particularly frothy or there has been some kind of recent event that could markedly change investor sentiment. Longer windows of time considered in the averaging period also tend to work a little better with exponential moving averages.
The two types of common moving averages have different formulas. Both will require that you know the set of values, such as the closing price of a particular stock or exchange-traded fund (ETF) for the period you're interested in examining, and how many days are in your period.
The simple moving average (SMA) is a simple average of the values in your set, divided by the total number of values. So, if you have 14 days of closing prices for stock ABC, Inc., you'll have 14 values in your set.
That formula looks like this:
SMA = (V1 + V2 + V3 +...+Vn) / n
Where:
V = the closing value for each individual day
n = the number of values (days)
Repeat this formula for every day in the set you're examining -- a spreadsheet can be really helpful to complete this task, but for small time periods, pen and paper will do.
The exponential moving average (EMA) formula is more complex, and it would be much easier for you to use a tool to do the calculation, since you'll need to do this calculation for each and every day in your set. But for the sake of completeness, this is what the formula looks like:
EMAt = [ Vt x (s / 1+d)] + EMAy x [1 - (s / 1+d)]
Where:
EMAt = today's EMA (often the SMA is used)
Vt = today's value
EMAy = yesterday's EMA
d = number of days
s = smoothing factor, the equation is as follows:
s = [2 / (days in time period + 1)]
(This is why it's a lot easier to use a computer to do EMAs.)
Moving averages can be really helpful to investors who want to know how stock prices are trending, and if they should do anything about it, where the support and resistance points may be to the stock's price, and how strong these trends may be.
This information is useful even for long-term investors, especially those looking for value stocks or other perceived bargains. If, for example, you find that ABC, Inc. is trading for $25 today, but its moving average for the last six months has been hovering around $40, it could be a sign that it's on sale today – or it could be a sign that sentiment has turned.
Moving averages are one of many tools in an investor's arsenal, and they should be used in conjunction with qualitative factors like market sentiment, company competitiveness, and an objective view of the company's long-term prospects.