How to Use a Moving Average to Buy Stocks

Part of the Series
Guide to Technical Analysis

One of the primary objectives of any market analyst is to determine what exactly the market is doing. Is it rising or falling, trending or consolidating? And how do you know? For most, that analysis begins with moving averages. In fact, a commonly accepted definition of a bull market is one that is trading above its 200-day moving average—and the inverse is true for a bear market.

Moving averages are a staple of technical analysis because they help traders determine what is happening in the market by smoothing out price data and filtering out short-term volatility. Traders use them to determine if a market is trending and, if it is trending, as dynamic support and resistance levels.

Many traders also use moving averages as the basis of a trend-following trading system, with a shorter-term moving average crossing over a longer-term average taken as an entry signal.

Key Takeaways

  • Moving averages smooth out price data to help identify trends.
  • Types of moving averages include the simple moving average (SMA) and the exponential moving average (EMA).
  • Moving averages can indicate support and resistance levels, especially in trending markets.
  • Strategies include price crossovers and dual moving average crossovers.
  • Combining moving averages with other indicators can enhance trading signals.

Understanding Moving Averages

Definition and Purpose

A moving average smooths out price fluctuations by averaging prices over a set period, reducing noise and helping traders determine whether a market is trending or not. They are "moving" because they're constantly being recalculated with the latest price data. They also frequently serve as support and resistance in trending markets. Additionally, traders watch for crossovers as signals of a shift in trend.

Types of Moving Averages

The most common moving averages are:

  • Simple moving average (SMA)
  • Exponential moving average (EMA)
  • Weighted moving average (WMA)
  • Smoothed moving average (SMMA)

Simple Moving Average (SMA)

The SMA represents the average closing prices of the previous n periods. It appears as a smoothed line that shows the average price movement over time. Old data is dropped as new data is added, creating a moving average. Most moving averages are based on closing prices, so only one data point is needed per day. For example, for a 10-day SMA, you would take the closing price of each of the e last 10 days and divide by 10. The calculation is repeated each day, with the oldest date dropping off as a new day is added, creating an average that "moves."

With the SMA, all the data points within the period are equally weighted. The SMA is a lagging indicator that reacts relatively slowly to price changes.

Exponential Moving Average (EMA)

The EMA is a weighted moving average that prioritizes recent price data. This means it reacts more quickly to price changes than the SMA, thereby helping to reduce the lag.

There are three steps to calculating the EMA:

First, calculate the SMA average. This is used for the initial EMA value.

Second, determine and calculate the weighting multiplier.

Third, calculate the EMA for each day.

Calculation:

Initial SMA: 10 period

Multiplier: (2/ (Time periods + 1) ) = (2/(10+1) ) = 0.1818 or 18.18%

EMA: (Close - EMA (of the previous day) x multiplier + EMA (of the previous day).

The EMA helps traders respond more quickly to price changes as it captures momentum shifts sooner than the SMA. However, that means it also generates more false signals in choppy markets.

Weighted Moving Average (WMA)

As with the EMA, the WMA assigns greater importance to recent price data. However, unlike the EMA, the weights of the values are adjusted linearly rather than exponentially.

The characteristics of the WMA are very similar to those of the EMA. But the difference occurs in their calculations. WMAs smooth out price data linearly and are not as dynamic as EMAs.

Smoothed Moving Average

This Smoothed Moving Average is a variation of the SMA and the EMA with a greater smoothing effect. By incorporating more past data into its calculation, it reduces price fluctuations and market noise more effectively than the SMA and EMA.

The Smoothed Moving Average includes more data than the WMA, EMA, and SMA and filters out a lot of noise. However, this also makes it much slower to react to price movements.

Moving Averages
Moving Averages.

Tradingview

How Moving Averages Work in Stock Trading

Trend Identification

Moving averages are ideal for identifying market trends. For this reason, they are used by virtually every market analyst and are generally the first indicator to go on any price chart.

A rising moving average indicates an uptrend, with momentum favoring buyers as long as price remains above that moving average. A falling moving average indicates a downtrend. If a moving average is flat, the market is likely consolidating, meaning trend-following strategies will be ineffective.

Support and Resistance Levels

MAs can also act as dynamic support and resistance levels when markets are trending. In an uptrend they can serve as support, with price frequently bouncing off the major moving averages, creating opportunities for traders. Similarly, in a downtrend, MAs can be used as resistance levels, preventing breakouts and signaling selling pressure.

At least part of the reason moving averages consistently provide support and resistance is because traders expect them to, creating a self-fulfilling prophecy. In other words, if everyone thinks price will reverse at a certain level, it probably will because traders will look to enter (or exit) at that level.

Also, depending on the strength of the trend and the time frame of the moving average (20-, 50- or 200-period), price will often behave differently around different moving averages. At the 20-day, for example, it might find support or resistance and reverse quickly, resuming its previous trend. But at the 50-day or 200-day, it's more likely to consolidate for some time before continuing with the longer-term trend.

Strategies for Using Moving Averages

When it comes to executing a trading system, as opposed to just getting a read on a market, moving averages are most useful with trend-following or as support or resistance in counter-trend pullbacks.

Price Crossovers

Price crossing over a moving average could provide a signal in itself, one of a trend reversal or continuation. A bullish crossover occurs when the price moves above a moving average, signaling potential upside momentum. A bearish crossover happens when the price drops below a moving average, indicating a possible downtrend.

For example, following a pullback in a trending market, an asset again rises above its 20-day EMA. That can be considered a bullish signal, indicating potential upside momentum to follow. A stop-loss order just below the 20-day will help manage risk.

Traders also often use price crossovers as a filter. For example, from a technical standpoint, it would be unwise to short an asset that is rising above a steadily rising 20-day SMA and vice versa.

MA Price Crossover
MA Price Crossover.

Tradingview

Moving Average Crossovers

The dual moving average strategy involves a short-term MA crossing a longer-term MA. For some traders, this alone can serve as a buy or sell signal, indicating the start or end of a trend.

When the short-term average moves above the long-term average—say, the 50-SMA crosses above the 200-SMA—it's called a golden cross and signals the start of a possible uptrend. Conversely, a death cross happens when the 50-SMA crosses below the 200-SMA, indicating a downtrend.

Traders use dual crossovers across virtually every asset class, adjusting the moving averages' periods to fit their strategy and market. This method is effective for trend following but can also frequently produce false signals and whipsaws. The key to profitability is position sizing and making sure the winners are far bigger than the losers. Generally, traders risk 1% to 2% of capital per trade and set minimum risk-reward ratios.

SMA Dual Crossover
SMA Dual Crossover.

Tradingview

Pros and Cons of Using Moving Averages

Pros
  • Trend Identification

  • Dynamic Support and Resistance Levels

  • Helps Reduce Market Noise

  • Trade Signal Generation

  • Works Across Different Timeframes and Markets

  • Can be Used with Other Indicators

Cons
  • Lagging Indicator

  • Ineffective in Sideways or Choppy Markets

  • False Signals and Whipsaws

  • Lacks Predictability

Enhancing Moving Average Strategies

Combining with Other Indicators

Combining MAs with other indicators enhances accuracy by filtering out false signals. It also helps with trend confirmation. Moreover, volume analysis strengthens MA crossovers as high volume supports bullish or bearish moves, while low volume may indicate a false breakout.

The Moving Average Convergence Divergence (MACD) helps confirm momentum shifts, while the Relative Strength Index (RSI) ensures MAs are signaling trades when there is negative or positive divergence. Bollinger Bands validate breakouts, helping traders avoid weak signals in sideways markets. Average True Range (ATR) adjusts MA sensitivity based on volatility, ensuring traders use shorter MAs in quiet markets and longer MAs in volatile conditions.

The Bottom Line

Moving averages are quite useful in recognizing the state of the market. However, their effectiveness as trading signals depends on market conditions and risk management. Traders adjust the types of moving averages they use and the number of periods based on their trading strategy and frequently combine them with other indicators such as the MACD, RSI, and Bollinger Bands.

Finally, as MAs tend to lag in choppy markets, combining them with risk management tools like stop-losses and position sizing helps ensure better decision-making.

Article Sources
Investopedia requires writers to use primary sources to support their work. These include white papers, government data, original reporting, and interviews with industry experts. We also reference original research from other reputable publishers where appropriate. You can learn more about the standards we follow in producing accurate, unbiased content in our editorial policy.
  1. FXOpen, "Simple, Weighted, and Exponential Moving Averages: The Differences"

  2. OANDA, Trade Tap Blog, "Understanding moving averages: types, benefits & trading strategies"

  3. CME Group, "Support and Resistance"

  4. Charles Schwab, "Understanding Simple Moving Average Crossovers"

  5. Trade Nation, "Risk management in trading"

  6. CMC Markets, "Death cross and golden cross strategies"

  7. Tradeciety, "How to Combine the Best Indicators and Avoid Wrong Signals"

Take the Next Step to Invest
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.
Part of the Series
Guide to Technical Analysis
Take the Next Step to Invest
×
The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace.

Related Articles