# Moving Average (MA): Purpose, Uses, Formula, and Examples

> **Definition**
>
> Technical traders use the moving average (MA) indicator to more easily track stock price trends by eliminating random price fluctuations.

## What Is a Moving Average (MA)?

In technical analysis, [traders](https://www.investopedia.com/best-online-brokers-4587872) use various indicators to help make buy and sell decisions. One such indicator is the moving average (MA), which smooths out daily price movements by creating a constantly updated [average price](https://www.investopedia.com/terms/a/averageprice.asp).

By calculating the MA, the impacts of random, short-term fluctuations on the price of a stock over a specified time frame are mitigated. Simple moving averages (SMAs) use a simple arithmetic average of prices over some timespan, while exponential moving averages (EMAs) place greater weight on more recent prices than older ones.

### Key Takeaways

*   A moving average (MA) is a stock indicator commonly used in technical analysis.
*   The MA helps to level the price data over a specified period by creating a constantly updated average price.
*   A simple moving average (SMA) is a calculation that takes the arithmetic mean of a given set of prices over a specific number of days in the past.
*   An exponential moving average (EMA) is a weighted average that gives greater importance to the price of a stock in more recent days, making it an indicator that is more responsive to new information.

![Moving Average](https://www.investopedia.com/thmb/nVZ1-BHqHYfeuVpnSeCV6Sy_NYk=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/MOVING-AVERAGE-FINAL-21674874615f49c19444bbd9d2086c51.jpg)

*The MA makes it easier for novice and experienced investors to assess the mood of the stock market. — Investopedia / Yurle Villegas*

## How a Moving Average (MA) Works

Moving averages (MAs) are calculated to identify the [trend direction of a stock](https://www.investopedia.com/terms/d/displacedmovingaverage.asp) or determine its support and resistance levels. It's a trend-following or lagging indicator because it's based on past prices.

The longer the period for the MA, the greater the lag. A 200-day MA will have a much greater degree of lag than a 20-day one because it contains prices for the past 200 days. Fifty-day and 200-day MA figures are widely followed by investors and traders, and they're considered to be important [trading signals](https://www.investopedia.com/terms/t/trade-signal.asp).

Investors may choose different periods of varying lengths to calculate MAs based on their trading objectives. Shorter MAs are typically used for short-term trading, while longer-term MAs are more suited for long-term investors.

While it's impossible to predict the future movement of a specific stock, using technical analysis and research can help make better predictions. A rising MA indicates that the security is in an uptrend, while a declining MA indicates that it's in a downtrend.

Similarly, upward momentum is confirmed with a bullish [crossover](https://www.investopedia.com/terms/c/crossover.asp), which occurs when a short-term MA crosses above a longer-term one. Conversely, downward momentum is confirmed with a bearish crossover, which occurs when a short-term MA crosses below its longer-term counterpart.

## Types of MAs

### Simple Moving Average (SMA)

A [simple moving average (SMA)](https://www.investopedia.com/terms/s/sma.asp) is calculated by taking the arithmetic mean of a given set of values over a specified period. A set of numbers, or prices of stocks, is added together and then divided by the number of prices in the set. The formula for calculating the SMA of a security is as follows:

$\begin{aligned} &SMA = \frac{ A_1 + A_2 + \dotso + A_n }{ n } \\ &\textbf{where:} \\ &A = \text{Average in period } n \\ &n = \text{Number of time periods} \\ \end{aligned}$

Charting stock prices over 50 days using an SMA may look like this:  

![Image](https://www.investopedia.com/thmb/K0UEaCXDh2pArgEt6K5ZCCbnqIE=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/dotdash_INV-final-Simple-Moving-Average-SMA-May-2021-01-98751e52a2d844a795d8d11434852d7c.jpg)

*Charting a 50-day SMA. — Investopedia / Sabrina Jiang*

### Exponential Moving Average (EMA)

The [exponential moving average (EMA)](https://www.investopedia.com/terms/e/ema.asp) gives more weight to recent prices in an attempt to make them more responsive to new information. To [calculate an EMA](https://www.investopedia.com/ask/answers/122314/what-exponential-moving-average-ema-formula-and-how-ema-calculated.asp), the SMA over a particular period is calculated first.

Then calculate the multiplier for weighting the EMA, known as the "smoothing factor," which typically follows the formula:

_\[2 / (Selected time period + 1)\]_ 

For a 20-day MA, the multiplier would be \[2 / (20 + 1)\] = 0.0952. The smoothing factor is combined with the previous EMA to arrive at the current value. The EMA thus gives a higher weighting to recent prices, while the SMA assigns an equal weighting to all values.

$\begin{aligned} &EMA_t = \left [ V_t \times \left ( \frac{ s }{ 1 + d } \right ) \right ] + EMA_y \times \left [ 1 - \left ( \frac { s }{ 1 + d} \right ) \right ] \\ &\textbf{where:}\\ &EMA_t = \text{EMA today} \\ &V_t = \text{Value today} \\ &EMA_y = \text{EMA yesterday} \\ &s = \text{Smoothing} \\ &d = \text{Number of days} \\ \end{aligned}$

> **Fast Fact**
>
> Technical analysis focuses on a stock's price movements, whereas fundamental analysis focuses on a company's financials.

## SMA vs. EMA

The calculation for EMA puts more emphasis on the recent data points. Because of this, EMA is considered a [weighted average](https://www.investopedia.com/terms/w/weightedaverage.asp) calculation. In the figure below, the number of periods used in each average is 15, but the EMA responds more quickly to the changing prices than the SMA.

The EMA has a higher value when the price is rising than the SMA, and it falls faster than the SMA when the price is declining. This responsiveness to price changes is the main reason why some traders prefer to use the EMA over the SMA.

![Image](https://www.investopedia.com/thmb/-OCnjH4IkP7kjf7msNsXxuKVNdg=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/dotdash_Final_Exponential_Moving_Average_EMA_Aug_2020-01-3bacd080c9ac450595fe7daa9148a65b.jpg)

*— Investopedia / Sabrina Jiang*

## Example of an MA

The MA is calculated differently depending on the type: SMA or EMA. Below, we look at an SMA of a security with the following closing prices over 15 days:

*   **Week one**: 20, 22, 24, 25, 23
*   **Week two**: 26, 28, 26, 29, 27
*   **Week three**: 28, 30, 27, 29, 28

A 10-day MA would average out the closing prices for the first 10 days as the first data point. The next data point would drop the earliest price, add the price on day 11, and take the average.

### Example of an MA Indicator

A [Bollinger Band](https://www.investopedia.com/terms/b/bollingerbands.asp) technical indicator has bands generally placed two [standard deviations](https://www.investopedia.com/terms/s/standarddeviation.asp) away from an SMA. In general, a move toward the upper band suggests the asset is becoming overbought, while a move close to the lower band suggests the asset is becoming oversold. Since standard deviation is used as a statistical measure of volatility, this indicator adjusts itself to market conditions.

## How Will I Use This in Real Life?

As a trader, using MAs will help you make buy and sell decisions. MAs smooth out a stock's daily price noise so you can see how it's trending: up, down, or staying flat. For example, if the price is consistently above the 200-day MA, that's considered a signal for long-term strength, indicating you'd want to buy or hold.

You can also use MAs to gauge the general mood of the market. Rather than worry about every dip or jump in stock prices, looking to see where the trend is going will help you make more informed decisions without reacting emotionally. MAs work well for both seasoned and beginner investors, aiding them in seeing the bigger picture in the market.  

## What Does a Moving Average Indicate?

A moving average (MA) is a statistic that captures the average change in a data series over time. In finance, MAs are often used by technical analysts to keep track of price trends for specific securities. An upward trend in an MA might signify an upswing in the price or momentum of a security, while a downward trend would be seen as a sign of decline.

## What Are MAs Used For?

MAs are widely used in technical analysis, a branch of investing that seeks to understand and profit from the price movement patterns of securities and indices. Generally, technical analysts will use MAs to detect whether a change in momentum is occurring for a security, such as if there's a sudden downward move in a security’s price. Other times, they'll use MAs to confirm their suspicions that a change might be underway.

## What Are Some Examples of MAs?

The exponential moving average (EMA) is a type of MA that gives greater weight to more recent trading days. This kind of MA might be more useful for short-term traders for whom longer-term historical data may be less relevant. A simple moving average (SMA) is calculated by averaging a series of prices while giving equal weight to each of the prices involved.

## What Is MACD?

Traders use the [moving average convergence/divergence (MACD)](https://www.investopedia.com/terms/m/macd.asp) to monitor the relationship between two MAs, calculated by subtracting a 26-day EMA from a 12-day one. The MACD also employs a signal line that helps identify crossovers, which is a nine-day SMA of the MACD line plotted on the same graph.

The signal line is used to help identify trend changes in the price of a security and to confirm the trend's strength. When the MACD is positive, the short-term average is located above the long-term one and is an indication of upward momentum. When the short-term average is below its long-term counterpart, it's a sign that the momentum is trending downward.

## What Is a Golden Cross?

The [golden cross](https://www.investopedia.com/terms/g/goldencross.asp) is a bullish breakout pattern formed from a crossover involving a security's short-term MA, such as the 15-day MA, breaking above its long-term counterpart, such as the 50-day MA. As long-term indicators carry more weight, the golden cross indicates a bull market on the horizon and is reinforced by high trading volumes.

## The Bottom Line

A moving average (MA) is a stock indicator commonly utilized in technical analysis, which is used to help smooth out price data by creating a constantly updated average price. A rising MA indicates that the security is in an uptrend, while a declining MA indicates a downtrend.

The exponential moving average (EMA) is generally preferred over a simple moving average (SMA), as it gives more weight to recent prices and shows a clearer response to new information and trends.  

> **Article Sources**
>
> 1.  Perry Kaufman. "Trading Systems and Methods, 6th Edition," Pages 1022–1027. John Wiley & Sons, 2019.