Moving Average, Weighted Moving Average, and Exponential Moving Average

Active traders use moving averages to measure momentum. These are technical indicators that calculate the average price of a security over a specific period. Since they take the average, they can help smooth out noisy price fluctuations, making it easier to spot trends. The primary difference between a simple, weighted, and exponential moving average is the formula used to create it.

Key Takeaways

  • Moving averages are technical indicators traders use to see the average price movement over a certain period.
  • The main difference between simple, weighted, and exponential moving averages is their sensitivity to changes in the data used.
  • The simple moving average (SMA) calculates the average price over a specific period, while the weighted moving average (WMA) gives more weight to present data.
  • The exponential moving average (EMA) is also weighted toward the most recent prices, but the rate of decrease between one price and its preceding price is not consistent but exponential.

Simple Moving Average

The SMA was more prevalent before the emergence of computers because it is easy to calculate. Today, many platforms provide other types of moving averages and technical indicators without the need for a hand calculator. A moving average calculates the average closing price for a specific period. It typically uses daily closing prices, but other time frames can be used.

Other price data, such as the opening price or the median price, can also be used. As a new price rolls in, it's added to the data, while the oldest price in the series is removed.

For a simple moving average, the formula is the sum of the data points over a given period divided by the number of the data points. For example, the closing prices of Apple Inc (AAPL) from March 18 to 22, 2024, was as follows:

  Date   Closing Price of AAPL
  March 22   $172.28
  March 21   $171.37
  March 20   $178.67
  March 19   $176.08
  March 18   $173.72

A five-period moving average, based on the prices above, would use the following formula:

MA = P 1 + P 2 + P 3 + P 4 + P 5 5 where: P n = Price for time period \begin{aligned} &\text{MA} = \frac{ P_1 + P_2 + P_3 + P_4 + P_5 }{ 5 } \\ &\textbf{where:} \\ &P_n = \text{Price for time period} \\ \end{aligned} MA=5P1+P2+P3+P4+P5where:Pn=Price for time period

or: (172.28 +171.37 + 178.67 + 176.08 +173.72)/5 = 174.22

This result shows that the average price was $174.22. Using moving averages is an effective method for eliminating strong price fluctuations. The main limitation is that data points from older data are not weighted any differently than data points near the beginning of the data set. This is where weighted moving averages come into play.

Weighted Moving Average

WMAs assign a heavier weighting to more current data points since they are more relevant than data points from the more remote past. The sum of the weighting should add up to one (or 100%). For a simple moving average, the weightings are equally distributed, which is why they are not shown in the table above.

For example, using the same closing prices above, we can calculate the weighted moving average with these prices and the formula below them.

  Date   Closing Price of AAPL   Weighting
March 22   $172.38   5/15
March 21   $171.37   4/15
March 20   $178.67   3/15
March 19   $176.08   2/15
March 18   $172.72   1/15

WMA = Price 1 × n + Price 2 × ( n 1 ) +  Price n n × ( n + 1 ) 2 where: n = Time period \begin{aligned} &\text{WMA} = \frac{ \text{Price}_1 \times n + \text{Price}_2 \times ( n - 1 ) + \cdots \text{ Price}_n }{ \frac{ n \times ( n + 1 ) }{ 2} } \\ &\textbf{where:} \\ &n = \text{Time period} \\ \end{aligned} WMA=2n×(n+1)Price1×n+Price2×(n1)+ Pricenwhere:n=Time period

The denominator of the WMA is the sum of the number of price periods as a triangular number. From the data above, the weighted five-day moving average would be $173.85:

( 172.38 × 5 / 15 ) + ( 171.37 × 4 / 15 ) + 178.67 × 3 / 15 ) + ( 176.08 × 2 / 15 ) + ( 172.72 × 1 / 15 ) = 173.85 (172.38 × 5/15) + (171.37 × 4/15) + 178.67 × 3/15) + (176.08 × 2/15) + (172.72 × 1/15) = 173.85 (172.38×5/15)+(171.37×4/15)+178.67×3/15)+(176.08×2/15)+(172.72×1/15)=173.85

In this example, the recent data point was given the highest weighting out of an arbitrary 15 points. You can weigh the values out of any value you see fit. The lower value from the weighted average above relative to the simple average suggests that recent selling pressure could be more significant than some traders anticipate. The most popular choice of traders when using weighted moving averages is to use a higher weighting for recent values.

Exponential Moving Averages

EMAs are also weighted toward the most recent prices, but the rate of decrease between one price and its preceding price is not the same rate of change but exponential. Rather than every preceding weight being 1.0 smaller than the weight in front of it, there might be a difference between the first two period weights of 1.0, a difference of 1.2 for the two periods after those periods, and so on. The formula for EMA is as follows:

EMA = Price t × k + SMA y × ( 1 k ) where: t = Today k = 2 Number of days in period + 1 SMA = Simple Moving Average of closing price for the number of days in the period y = Yesterday \begin{aligned} &\text{EMA} = \text{Price}_t \times k + \text{SMA}_y \times ( 1 - k ) \\ &\textbf{where:} \\ &t = \text{Today} \\ &k = \frac { 2 }{ \text{Number of days in period} + 1 } \\ &\text{SMA} = \text{Simple Moving Average of closing price} \\ &\text{for the number of days in the period} \\ &y = \text{Yesterday} \\ \end{aligned} EMA=Pricet×k+SMAy×(1k)where:t=Todayk=Number of days in period+12SMA=Simple Moving Average of closing pricefor the number of days in the periody=Yesterday

Calculating an EMA involves three steps. The first is to determine the SMA for the period. Then, a multiplier is calculated by dividing two by the number of periods and adding one. The final step is to take the closing price and subtract the previous day's EMA and times that by the multiplier plus the previous day's EMA.

The table below shows the previous data again with a five-day EMA.

 Date  Closing Price of AAPL  5 Day EMA
 March 22  $172.28  $173.51
 March 21  $171.37  $174.13
 March 20  $178.67  $175.51
 March 19  $176.08  $173.93
 March 18  $172.72  $172.86

The EMA responds most to price changes and is the most complex calculation among the three moving averages. Ultimately, which one you choose depends on your trading strategy.

Which Moving Average Is Best?

Because an exponential moving average (EMA) uses an exponentially weighted multiplier to give more weight to recent prices, some believe it is a better indicator of a trend than a WMA or SMA. Many analysts think that the EMA responds better to changes in trends. By contrast, the more basic smoothing provided by the SMA could mean it's better for finding simple support and resistance areas on a chart and moving averages help with smoothing price data that can otherwise be visually noisy.

The EMA and WMA are used for similar purposes since they rely more on the most recent prices. Traders will use EMAs or WMAs over the SMA when concerned that lags in the data might lower the responsiveness of the moving average indicator.

All moving averages have a significant drawback in that they are lagging indicators. Since moving averages are based on prior data, they suffer a time lag before they reflect a change in trend. Therefore, a stock price may move sharply before a moving average can show a trend change. A shorter moving average suffers from less lag than a longer moving average.

Still, lags are helpful for specific technical indicators, such as moving average crossovers. For example, the technical indicator known as the death cross occurs when the 50-day SMA moves below the 200-day SMA, which is considered a bearish signal. An indicator going the opposite direction, the golden cross, occurs when the 50-day SMA crosses above the 200-day SMA and is regarded as a bullish signal.

What Is the Difference Between a Moving Average and a Rolling Average?

The terms moving average and rolling average are often used interchangeably, but they can be distinguished by how they are applied. Both involve averaging data points to smooth out short-term fluctuations and highlight longer-term trends. Moving averages are a subset of rolling averages, with specific types (e.g., SMA, WMA, and EMA) tailored for analyzing financial time series data.


What is a Triangular Moving Average?

A triangular moving average (TMA) is designed to provide a smoother average of a time series. It's called "triangular" because the weights given to the prices form a triangle, which emphasizes the middle portfolio of the time series. Essentially, a TMA is a double-smoothed SMA, which means it applies the smoothing process twice.

What Is a Double Exponential Moving Average?

The double exponential moving average (DEMA) is a technical indicator that aims to reduce the lag of traditional moving averages and improve responsiveness to recent price changes. Developed by Patrick Mulloy and introduced in 1994, the DEMA is not simply a double application of an EMA but a unique composite of a single EMA and a double EMA that provides a faster reaction to price moves.

The Bottom Line

Moving averages, including the SMA, WMA, and EMA, are tools in technical analysis, each designed to smooth out price data to identify trends over time. While the SMA offers a straightforward average of prices over a specific period, the WMA assigns more weight to recent prices, aiming to make it more responsive to new information. The EMA goes a step further by applying an exponentially weighted multiplier to give even greater emphasis to the most recent prices, enhancing its sensitivity to price changes and reducing lag more effectively than the SMA and WMA. These variations are for different strategies and preferences, enabling analysts and investors to choose the moving average that best aligns with their needs.

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. P. J. Kaufman. "Trading Systems and Methods," Page 250. John Wiley & Sons, 2019, sixth edition.

  2. TradingView. "Apple Inc."

  3. P. J. Kaufman. "Trading Systems and Methods," Pages 251-252. John Wiley & Sons, 2019, sixth edition.

  4. P. J. Kaufman. "Trading Systems and Methods," Page 257-264. John Wiley & Sons, 2019, sixth edition.

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

  6. P. J. Kaufman. "Trading Systems and Methods," Pages 252–253. John Wiley & Sons, 2019, sixth edition.

  7. P. J. Kaufman. "Trading Systems and Methods," Page 365-369. John Wiley & Sons, 2019, sixth edition.

  8. TradingView. "DEMA."

Compare Mortgage Lenders
×
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.