What Is a Moving Average? Types, Formula, and Examples

By Forex & Brokers DeskUpdated Nov 10, 2026

Moving Average
Illustration · Fintrev

Definition

A moving average is the average of an asset's price over a fixed number of past periods, updated as each new period closes, giving a lagging line that shows trend direction.

Key takeaways

  • A moving average counts periods, so a 20-period MA covers 20 days on a daily chart but 20 hours on an hourly one.
  • The EMA smoothing factor is k = 2 / (n + 1), so a 20-period EMA gives today's price about 9.5% of the weight.
  • A golden cross occurs when the 50-day MA crosses above the 200-day MA, and the reverse is called a death cross.
  • In sideways markets price crosses the MA repeatedly, and these whipsaws are the main source of losses for crossover systems.

A moving average (MA) is the average of an asset’s price over a fixed number of past periods, recalculated each time a new period closes. Each update adds the newest price and drops the oldest, so the average “moves” along the chart as a line. Traders use it to filter out short-term noise and see the direction of the underlying trend. Because every value is built from prices that have already happened, a moving average is a lagging, trend-following indicator. It describes the trend; it does not forecast it.

What Is a Moving Average?

In technical analysis, a moving average is a running mean of price, abbreviated “MA”. On its own, “MA” can mean any type, and a platform’s indicator labeled “MA” may be set to either an SMA or an EMA, which can plot at noticeably different levels at the same length. Specify the type (simple, exponential, weighted) and the period length. A “50 MA” is the average of the last 50 bars of whatever timeframe the chart shows.

That last point matters in forex and other markets traded around the clock. A moving average counts periods, not calendar days. A 20-period MA on a daily chart covers 20 trading days; on a one-hour chart it covers 20 hours; on a five-minute chart it covers 100 minutes. A “200-day MA” therefore assumes daily bars.

Most moving averages are calculated from closing prices, though charting software usually lets the user switch the input to the open, high, low or a blend such as (high + low + close) / 3.

How a Moving Average Works

Raw price moves up and down from bar to bar for reasons that may have nothing to do with the broader trend. Averaging several bars together cancels out much of that random movement, leaving a line that changes direction only when prices shift persistently.

The cost of that smoothing is lag. A 200-day MA contains 200 days of prices, so a sharp move today changes it only slightly. A 20-day MA contains a tenth as much history and turns much sooner. Choosing a period is a trade-off between responsiveness and noise filtering, and no setting avoids both problems.

The 50-day and 200-day moving averages are widely followed by investors and traders, which is partly why price reactions around them attract attention. Shorter averages (for example 9, 10 or 20 periods) are typically used for short-term trading, while longer ones suit position traders and long-term investors who care about the broader direction.

Calculating Moving Average

Simple moving average formula

SMA = (P₁ + P₂ + … + Pₙ) / n

where P is the closing price of each period and n is the number of periods in the window.

Exponential moving average formula

EMA today = (Price today × k) + (EMA yesterday × (1 − k))

where the smoothing factor k = 2 / (n + 1).

For a 20-period EMA, k = 2 / 21 = 0.0952, so today’s price contributes about 9.5% of the new value and the previous EMA contributes the remaining 90.5%. For a 10-period EMA, k = 2 / 11 = 0.1818. Because each EMA value carries forward the previous one, every past price still has some influence, but that influence shrinks geometrically the older it gets. The first EMA value needs a starting point, which is usually the SMA of the first n periods.

The “2” in the smoothing factor is the standard convention. Raising it puts even more weight on recent prices; lowering it makes the EMA smoother.

Interpreting a Moving Average

A moving average is read in a few ways:

  1. Slope. A rising MA indicates an uptrend; a declining MA indicates a downtrend. A flat MA suggests a sideways, range-bound market.
  2. Price position. Price trading above the MA is generally treated as a sign of strength; price moving below the MA is treated as a sign of weakness. A chart moving below a widely watched average, such as the 200-day, is often read as a deterioration in the trend.
  3. Dynamic support and resistance. In a trend, price sometimes pulls back toward the MA and turns away from it again. The line then acts as a moving support level (in an uptrend) or resistance level (in a downtrend).
  4. Crossovers. A bullish crossover occurs when a short-term MA crosses above a longer-term one; a bearish crossover occurs when the short-term MA crosses below. When the 50-day crosses above the 200-day, the event is called a golden cross; the reverse is a death cross. Some traders also treat price itself crossing an MA as a signal.

Types of Moving Averages

Simple Moving Average (SMA)

The SMA is the plain arithmetic mean described above. Every price in the window counts equally, so a price from 49 days ago matters as much to a 50-day SMA as yesterday’s close. That makes the SMA steady and easy to interpret, but it also produces a quirk: the line can jump when an unusually high or low price leaves the window, even if nothing new happened in the market.

Exponential Moving Average (EMA)

The EMA weights recent prices more heavily, so it turns sooner after a change in direction. When price is rising, an EMA typically sits closer to price than an SMA of the same length, and it falls faster when price declines. That responsiveness is the main reason short-term traders often prefer the exponential moving average, at the cost of more whipsaws in choppy markets.

Weighted Moving Average (WMA)

A linearly weighted moving average assigns the newest price a weight of n, the one before it n − 1, and so on down to 1, then divides by the sum of the weights, n(n + 1) / 2. Unlike the EMA, it ignores everything outside the window.

Smoothed Moving Average (SMMA)

The smoothed moving average, also known as Wilder’s moving average or RMA, uses:

SMMA today = (SMMA yesterday × (n − 1) + Price today) / n

This is equivalent to an EMA with a smoothing factor of 1/n instead of 2/(n + 1), which makes it slower than a standard EMA of the same length. J. Welles Wilder used this method inside the Relative Strength Index (RSI) and the Average True Range (ATR).

Example of a Moving Average

Hypothetical example. A security has the following closing prices over 15 days:

  • Days 1 to 5: 20, 22, 24, 25, 23
  • Days 6 to 10: 26, 28, 26, 29, 27
  • Days 11 to 15: 28, 30, 27, 29, 28

10-day SMA. The first value can be calculated on day 10. The first ten closes add up to 250, so the SMA is 250 / 10 = 25.0. On day 11, the day 1 price (20) drops out and the day 11 price (28) comes in: 258 / 10 = 25.8. Continuing the same way:

Day Close 10-day SMA 10-day EMA
10 27 25.0 25.00 (seed)
11 28 25.8 25.55
12 30 26.6 26.36
13 27 26.9 26.47
14 29 27.3 26.93
15 28 27.8 27.13

10-day EMA. Using k = 2 / 11 = 0.1818 and the day 10 SMA of 25.0 as the seed, day 11 is (28 × 0.1818) + (25.0 × 0.8182) = 25.55. Each later value uses the previous EMA in the same way.

In this short sample the SMA rises faster than the EMA, partly because the low early prices (20, 22, 24) are dropping out of its window while the EMA still carries weight from its 25.0 seed. Over longer runs, once the seed’s influence fades, the EMA’s heavier weighting of recent bars makes it the more responsive of the two. A different starting point or amount of history is also why two charting platforms can show slightly different EMA values for the same market.

3-period comparison. A 3-period moving average uses only the three most recent closes. On day 15 those are 27, 29 and 28. The 3-period SMA is 84 / 3 = 28.0. The 3-period WMA is (28 × 3 + 29 × 2 + 27 × 1) / 6 = 169 / 6 = 28.17, slightly higher because the newer prices (28 and 29) carry more weight than the oldest (27).

Why Is a Moving Average Important?

Moving averages give a rule-based, objective reading of trend that is the same for every trader using the same settings. That makes them useful in several roles:

  • Trend filter. Some traders only take long trades when price is above a chosen MA and short trades when it is below.
  • Trade timing. Pullbacks toward a rising MA can be used as entry areas, and a close beyond the MA can be used as an exit rule.
  • Trailing stops. A stop placed beyond a moving average rises (or falls) automatically as the trend progresses.
  • Market context. Instead of reacting to every dip or rally, a trader can check whether the broader average is still pointing the same way.

Indicators Built From Moving Averages

Many popular indicators are moving averages combined or transformed:

  • MACD subtracts the 26-period EMA from the 12-period EMA. A 9-period EMA of that difference forms the signal line, and crossovers between the two flag shifts in momentum. A positive MACD means the short-term average is above the long-term one.
  • Bollinger Bands plot bands, by default two standard deviations above and below a 20-period SMA, so they widen when the market becomes volatile and narrow when it calms down. A move toward the upper band is often read as overbought, and toward the lower band as oversold.

Limitations of a Moving Average

  • Lag. Signals arrive after the move has started. A crossover on long averages can come well after the turn, and part of the move is gone by the time it appears.
  • Whipsaws in ranges. When the market moves sideways, price crosses back and forth over the MA and crossovers fire repeatedly without a trend developing. This is the main source of losses for simple crossover systems.
  • No predictive power on its own. An MA summarizes past prices. Price sitting above the 200-day average does not mean it will stay there.
  • Parameter sensitivity. A rule that worked with a 20-period average may fail with 25. Picking the setting that looked best on past data (curve fitting) tends to overstate how well it will work going forward.

Because of these limits, moving averages are usually paired with other evidence, such as volume, momentum oscillators or price structure, and with risk controls like predefined stop distances.

Moving Average vs. Similar Concepts

Moving average vs. VWAP. A moving average weights prices by time (equally or by recency). VWAP weights each price by the volume traded at it and is typically anchored to the start of a session rather than rolling over a fixed window.

Moving average vs. trend line. A trend line is drawn by hand through swing highs or lows and stays straight. A moving average is calculated and bends with price.

Technical vs. statistical meaning. In time-series statistics, a “moving average” can also mean an MA(q) model, which describes a value as a combination of past random error terms. That is a different concept from the price line on a trading chart. A centered moving average places the average in the middle of its window and so needs future data, which a trading chart cannot use in real time.

FAQs

What does the 200 MA mean?

It is the average of the last 200 closing prices on the chart's timeframe. On a daily chart, that covers roughly the past trading year for stocks.

The Bottom Line

Moving averages suit traders and investors who want a consistent, rule-based reading of trend, whether for filtering trades, timing entries or setting trailing stops. Shorter periods react faster but pick up more noise, and longer ones are smoother but slower. Since an MA only summarizes past prices, it works best alongside volume, momentum or price structure and predefined stop distances.

About this page

Written by Forex & Brokers Desk

The Forex & Brokers Desk covers forex and CFD broker reviews, regulation checks, trading guides and the forex glossary.

Published
Last updated

Spotted an error? Tell the editors. This page is general information, not financial advice.