How to Use a Moving Average to Buy Stocks

The moving average (MA) is a simple technical analysis tool that smooths out price data by creating a constantly updated average price. The average is taken over a specific period of time, like 10 days, 20 minutes, 30 weeks, or any time period the trader chooses. There are advantages to using a moving average in your trading, as well as options on what type of moving average to use.

Moving average strategies are also popular and can be tailored to any time frame, suiting both long-term investors and short-term traders.

Key Takeaways

  • A moving average (MA) is a widely used technical indicator that smooths out price trends by filtering out the noise from random short-term price fluctuations.
  • Moving averages can be constructed in several different ways and employ different numbers of days for the averaging interval.
  • The most common applications of moving averages are to identify trend direction and to determine support and resistance levels.
  • When asset prices cross over their moving averages, it may generate a trading signal for technical traders.
  • While moving averages are useful enough on their own, they also form the basis for other technical indicators such as the moving average convergence divergence (MACD).

Why Use a Moving Average

A moving average helps cut down the amount of noise on a price chart. Look at the direction of the moving average to get a basic idea of which way the price is moving. If it is angled up, the price is moving up (or was recently) overall; angled down, and the price is moving down overall; moving sideways, and the price is likely in a range.

A moving average can also act as support or resistance. In an uptrend, a 50-day, 100-day, or 200-day moving average may act as a support level, as shown in the figure below. This is because the average acts like a floor (support), so the price bounces up off of it. In a downtrend, a moving average may act as resistance; like a ceiling, the price hits the level and then starts to drop again.

Image
Image by Sabrina Jiang © Investopedia 2020

The price won't always respect the moving average in this way. The price may run through it slightly or stop and reverse prior to reaching it. 

As a general guideline, if the price is above a moving average, the trend is up. If the price is below a moving average, the trend is down. However, moving averages can have different lengths (discussed shortly), so one MA may indicate an uptrend while another MA indicates a downtrend.

Types of Moving Averages

A moving average can be calculated in different ways. A five-day simple moving average (SMA) adds up the five most recent daily closing prices and divides the figure by five to create a new average each day. Each average is connected to the next, creating the singular flowing line.

Another popular type of moving average is the exponential moving average (EMA). The calculation is more complex, as it applies more weighting to the most recent prices. If you plot a 50-day SMA and a 50-day EMA on the same chart, you'll notice that the EMA reacts more quickly to price changes than the SMA does, due to the additional weighting on recent price data.

Charting software and trading platforms do the calculations, so no manual math is required to use a moving average.

One type of MA isn't better than another. An EMA may work better in a stock or financial market for a time, and at other times, an SMA may work better. The time frame chosen for a moving average will also play a significant role in how effective it is (regardless of type).

Image
Image by Sabrina Jiang © Investopedia 2020

Moving Average Length

Common moving average lengths are 10, 20, 50, 100, and 200. These lengths can be applied to any chart time frame (one minute, daily, weekly, etc.), depending on the trader's time horizon. The time frame or length you choose for a moving average, also called the "look back period," can play a big role in how effective it is.

An MA with a short time frame will react much quicker to price changes than an MA with a long look-back period. In the figure below, the 20-day moving average more closely tracks the actual price than the 100-day moving average does.

Image
Image by Sabrina Jiang © Investopedia 2020

The 20-day may be of analytical benefit to a shorter-term trader since it follows the price more closely and therefore produces less lag than the longer-term moving average. A 100-day MA may be more beneficial to a longer-term trader.

Lag is the time it takes for a moving average to signal a potential reversal. Recall that, as a general guideline, when the price is above a moving average, the trend is considered up. So when the price drops below that moving average, it signals a potential reversal based on that MA. A 20-day moving average will provide many more reversal signals than a 100-day moving average.

A moving average can be any length: 15, 28, 89, etc. Adjusting the moving average so it provides more accurate signals on historical data may help create better future signals.

Trading Strategies: Crossovers

Crossovers are one of the main moving average strategies. The first type is a price crossover, which is when the price crosses above or below a moving average to signal a potential change in trend.

Image
Image by Sabrina Jiang © Investopedia 2020

Another strategy is to apply two moving averages to a chart: one longer and one shorter. When the shorter-term MA crosses above the longer-term MA, it's a buy signal, as it indicates that the trend is shifting up. This is known as a golden cross. Meanwhile, when the shorter-term MA crosses below the longer-term MA, it's a sell signal, as it indicates that the trend is shifting down. This is known as a dead/death cross.

Image
Image by Sabrina Jiang © Investopedia 2020

MA Disadvantages

Moving averages are calculated based on historical data and nothing about the calculation is predictive in nature. Therefore, results using moving averages can be random. At times, the market seems to respect MA support/resistance and trade signals, and at other times, it shows these indicators no respect.

One major problem is that, if the price action becomes choppy, the price may swing back and forth, generating multiple trend reversals or trade signals. When this occurs, it's best to step aside or utilize another indicator to help clarify the trend. The same thing can occur with MA crossovers when the MAs get "tangled up" for a period of time, triggering multiple losing trades. 

Moving averages work quite well in strong trending conditions but poorly in choppy or ranging conditions. Adjusting the time frame can remedy this problem temporarily, though at some point, these issues are likely to occur regardless of the time frame chosen for the moving average(s).

The Bottom Line

The moving average offers advantages and disadvantages when used by investors. A moving average simplifies price data by smoothing it out and creating one flowing line. This makes seeing the trend easier. Exponential moving averages react quicker to price changes than simple moving averages. In some cases, this may be good, and in others, it may cause false signals. Moving averages with a shorter look-back period (20 days, for example) will also respond quicker to price changes than an average with a longer look-back period (200 days).

Moving average crossovers are a popular strategy for both entries and exits. MAs can also highlight areas of potential support or resistance. While this may appear predictive, moving averages are always based on historical data and simply show the average price over a certain time period.

Investing using moving average, or any technique requires an investment account with a stockbroker. Investopedia's list of the best online brokers is a great place to start your research on the broker that fits your needs the most.

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. Steve Nison. "Japanese Candlestick Charting Techniques, 2nd Edition," Pages 219, 221-223. New York Institute of Finance, 2001.

  2. Steve Nison. "Japanese Candlestick Charting Techniques, 2nd Edition," Pages 217-218. New York Institute of Finance, 2001.

  3. Steve Nison. "Japanese Candlestick Charting Techniques, 2nd Edition," Page 219. New York Institute of Finance, 2001.

  4. DailyFX. "Popular Moving Averages and How to Use Them."

  5. P. J. Kaufman. "Trading Systems and Methods," Page 311, 944–945, 967–969. John Wiley & Sons, 2019, sixth edition.

  6. IG. "​Moving Average Crossover Strategies."

  7. The Wall Street Journal. "Does Chart Analysis Really Work?"

Compare Accounts
×
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.
Provider
Name
Description
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.