Disclaimer: This is for informational purposes and is not meant to serve as financial or investing advice.
What Is a Moving Average?
The purpose of a moving average is to smooth out a stock’s price over time. Because of this, the moving average is resistant to short-term stock price fluctuations and gives a clear picture of the trends.
Using moving averages to formulate trades is a fundamental step of technical analysis. Moving averages can help you spot changes in trend direction, anticipate price movements and avoid downtrends. They can also be used to identify important support and resistance levels.
Many traders use moving averages without thinking about how they’re calculated or in what scenarios they can be the most effective. After reading this article, you should better understand the types of moving averages and the strategies that work with them.
What Are the Different Types of Moving Averages?
Simple Moving Average (SMA)
A simple moving average takes a set of prices for a timeframe and divides them by the number of periods in that timeframe, assigning equal weight to all values. For example, a five-day simple moving average is the daily closing prices of stock from the last five days divided by five. SMAs are typically lagging indicators as they are the least reactive to current prices.
Exponential Moving Average (EMA)
An exponential moving average, or EMA, weighs recent data points heavier than a simple moving average. EMA is more sensitive than SMA. This means EMA will more closely follow price and current value than SMA.
EMA can be a powerful tool for gauging changes in sentiment or trends.
Weighted Moving Average (WMA)
Weighted moving average, or WMA, is like an EMA because it is more sensitive to the most recent price data. But it is even more sensitive than EMA.
How Are Moving Averages Calculated?
Moving averages are calculated by taking a set of prices over a predetermined period and dividing it by the number of periods. You can choose days, weeks, or even months as the timeframe for a moving average.
For example, a 20-day moving average considers prices over the last 20 days, and a five-week moving average takes prices from the previous five weeks.
There are different weights you can apply to moving average calculations as well. These weights tweak the indicator to make it smoother, more precise, or more general.
Simple Moving Average Calculation
To calculate the SMA, first pick a time period, like days, weeks, or months. Then pick a timeframe, like 10 days.
To calculate the 10-day SMA, add up the closing price of an asset over the last 10 trading days.
Finally, divide that sum by the timeframe. In this case, the timeframe is 10, so you would divide by 10.
Exponential Moving Average Calculation
First, you need the exponential percentage. The exponential percentage is the weight the EMA will hold for its most current data bars.
To calculate the exponential percentage, you need to choose your timeframe. For this example, let's choose 50 days.
Here is the exponential percentage formula:
Exponential percentage = 2/(time frame + 1)
For this example, the exponential percentage is .039. This means the most recent trading day will be weighted 3.9% of the total EMA value.
The shorter the EMA, the more impactful the exponential percentage will be. Consider the 10-day EMA. It will have an 18.18% weight applied to its most recent data, whereas the 20-day EMA has an exponential percentage of 9.52%.
What Is Moving Indicator Lag?
Longer-term moving averages experience more lag because they deal with longer periods. The period is simply the number of data sets included in the moving average calculation.
For example, a 100-day moving average would have more lag than a 20-day moving average. This means the 100-day moving average won’t reflect recent sharp price movements, and the 20-day moving average would.
Of course, lag isn’t necessarily a bad thing. Moving averages with long periods are great for evaluating long-term trends and identifying support/resistance zones.
How Can You Use Moving Averages?
You can use moving averages as trading indicators. The most straightforward strategy would be to pick a moving average, buy when the price goes above it, and sell when it goes below. When the price is above, the stock outperforms its average price and vice versa.
Of course, trading averages are unsophisticated tools meaning you won’t have the edge over the market relying on them alone. Moving averages are a powerful tool for evaluating market sentiment when combined with other indicators.
What’s a Crossover?
Crossovers are when a moving average crosses over another indicator on the chart. The indicator could be anything but usually refers to other moving averages.
A popular short-time frame strategy is to look for crossover points of moving averages with different timeframes.
For example, the 10-day EMA crossing over the 20-day EMA could be a trading signal for a bullish trend for a stock. You can even mix up different moving averages using this strategy. For example, if the SMA crosses over the EMA, that could indicate that a stock is oversold.
A famous example of an SMA crossover is called a Golden Cross. A golden cross is when a short-term moving average crosses above a long-term moving average.
What Are the Best Moving Average Trading Strategies?
1. Trend Trading
As mentioned in the crossover section, you can use moving averages with different periods to spot changes in price trends.
Let’s say the 20-day WMA crosses above the 20-day SMA. This could signal a price breakout. But remember, WMAs are more sensitive to price changes than SMAs. So while this crossover could indicate an entry for a long trade, it could be a fakeout.
You could also look for confirmation of the trend by looking for the 20-day EMA to cross the SMA.
Short-term and price-sensitive moving averages are most effective at spotting trends, and long-term moving averages are best for confirming the trends.
2. Mean Reversion
Mean reversion is the theory that prices always revert to the long-term trend. With moving averages, this means selling when the price is above long-term moving averages and buying when the price is below it.
3. Breakout Trading
A price breakout is when the price breaks above a resistance level or below a support level. You can identify support and resistance levels with trendlines. For example, if a stock repeatedly surges to a price but never breaks through, that indicates a resistance level.
A less technical strategy for identifying these levels is to consider psychological resistance levels, so a round number like $100 could be strong support. Historic levels like an all-time high price might also mark resistance levels.
To breakout trade with moving averages, you must first define breakout and support and then wait for the moving average to move above or below that price.
4. Moving Average Convergence and Divergence (MACD)
The MACD is a momentum oscillator used for trend-based trading, or “momentum trading.” The MACD is comprised of two lines: the MACD line and the signal line. The MACD is typically calculated by subtracting the 12-day EMA from the 26-day EMA. The signal line is the 9-day EMA of the MACD line but is represented as a flat line at zero on the oscillator.
When MACD goes above zero, it indicates a bullish trade; when it goes below, it’s bearish.
Traders use the MACD to gauge how quickly a trend change is occurring. A MACD that spikes high above zero is considered extremely bullish.
Divergences occur when an asset’s price decreases, but MACD is still high. This could indicate a reversal opportunity or mean reversion.
Using most trading software, you can customize oscillators like MACD to compare moving averages.
What Are Some Common Mistakes With Moving Averages?
1. Over Relying on Moving Averages
“Past performance is not indicative of future performance.” You hear this disclaimer often regarding financial products, but it’s also true of individual trading strategies. Remember that moving averages are valuable but unsophisticated trading indicators.
This means every high-frequency trader and hedge fund has crunched the numbers on every permutation of moving average crossovers. You likely won’t be able to find an edge with just two indicators.
So you need to find an edge on top of your moving average strategy. Your advantage could be trading under the radar small cap stocks, paying attention to news events, or combining other indicators.
As with any trading strategy, sometimes walking away is the best trade. No moving average method has a 100% hit rate, so you must be aware of market conditions and other factors affecting your trades.
The Bottom Line
Moving average (MA) is a popular technical indicator that traders use to evaluate a stock’s strength relative to its performance over time. It is calculated by taking prices from several periods over a set timeframe and averaging the sum by the number of periods.
There are different types of moving averages, like simple moving averages (SMAs), weighted moving averages (WMAs), and exponential moving averages (EMAs).
Traders use moving averages to spot trend changes. These changes are called “crossovers,” and are when a price crosses a moving average or a moving average crosses another indicator.
Besides crossovers, you can use moving averages for breakout trades, trend trading, and mean reversion. Mean reversion is a prevalent strategy with moving averages because they show where price trends over time.
The final piece of the moving average puzzle is choosing the proper timeframe. For example, 10-day moving averages only account for recent price action, which is usually unsuitable for multi-year trades.
Moving average indicators are a powerful tool for analyzing financial markets. But, like all technical analysis tools, they aren’t a silver bullet. Testing many moving averages across different assets is vital for fully taking advantage of them.
Check out our blog for more information about trading.