Technical Analysis

Moving Averages Explained

How simple and exponential moving averages are calculated, with a worked example, how period length changes the line, and why every average lags behind price.

On this page
  1. The idea
  2. Simple moving average
  3. Exponential moving average
  4. How length changes the line
  5. The lag problem
  6. Other variants
  7. How averages are used, and their limits

The idea

A moving average replaces a noisy series of prices with a smoother line. For every point on the chart it takes the most recent N prices, combines them into one number, and plots that number. As each new period arrives, the oldest price drops out of the window and the newest is added, so the average “moves” along with the chart.

Moving averages are the building block of many other indicators. They show up inside MACD and Bollinger Bands, and they underlie most simple trend rules. Understanding the arithmetic takes only a few minutes, and it removes much of the mystery.

Simple moving average

The simple moving average (SMA) is the plain mean of the last N closing prices. Add them up and divide by N.

Take five closing prices, in made-up units: 10, 12, 11, 13, 14.

  • Sum: 10 + 12 + 11 + 13 + 14 = 60.
  • 5-period SMA: 60 / 5 = 12.

Suppose the next close is 15. The window slides: 10 drops out and 15 comes in, leaving 12, 11, 13, 14, 15.

  • Sum: 12 + 11 + 13 + 14 + 15 = 65.
  • New SMA: 65 / 5 = 13.

Notice that the price jumped from 14 to 15 but the average moved from 12 to 13. A way to check the result: the change in the sum is the new price minus the departing price, 15 - 10 = 5, and 5 divided by 5 is 1, which matches.

Every price in the window carries equal weight. That is both a strength, since it is easy to understand, and a weakness: a price from the far edge of the window counts as much as yesterday’s, and when it drops out the average can jump for reasons unrelated to what the market just did.

Exponential moving average

The exponential moving average (EMA) gives more weight to recent prices, so it reacts faster. It is calculated recursively, using the previous EMA value.

First compute a multiplier: 2 / (N + 1). For N = 5 that is 2 / 6, or one third. Then:

new EMA = previous EMA + multiplier x (new price - previous EMA)

Using the same example, suppose the previous EMA was 12 and the new close is 15.

  • Difference: 15 - 12 = 3.
  • Multiplier times difference: 3 x (1/3) = 1.
  • New EMA: 12 + 1 = 13.

In this case it matches the SMA by coincidence; in general the two differ. For N = 10 the multiplier would be 2/11, about 0.18, so each new price moves the line by roughly 18 percent of the gap. For N = 20 it is 2/21, about 0.095.

Two practical notes. First, the EMA needs a starting value; many tools use an SMA for the first point, and that is why the first few values can differ between platforms. Second, despite the name, old prices never fully vanish from an EMA; their influence just shrinks steadily.

How length changes the line

The length N controls the trade-off.

  • A short average, such as 9 or 10 periods, hugs price closely and turns quickly. It also gets shaken by minor moves.
  • A long average, such as 100 or 200 periods, is smooth and slow. It ignores small fluctuations but turns long after the market has.

No length is correct. Popular numbers like 20, 50 and 200 are conventions that persist partly because many people watch them. The same N means different spans of time on different chart timeframes: a 50-period average covers 50 days on a daily chart but 50 hours on an hourly chart.

The lag problem

Because it is built from past prices, a moving average always trails the market. In a steady rise, the line sits below price; in a steady fall, above. When the market reverses, the average keeps heading the old way for a while.

A quick sense of scale: an N-period SMA is on average centred about (N - 1) / 2 periods behind the latest price. A 21-period SMA therefore trails by roughly 10 periods. An EMA has less lag than an SMA of the same N, but still some.

Smoothness and speed pull against each other. Making a line smoother makes it later; making it faster makes it noisier.

Other variants

You may see weighted moving averages, which assign linearly decreasing weights, and other smoothing methods with different names. They are variations on the same theme: balance responsiveness against noise. None is known to beat the others consistently.

How averages are used, and their limits

Typical uses include judging whether price is above or below a long-term average, watching two averages cross, and using an average as a rough moving support or resistance level. These uses are discussed in the context of trend indicators. As a description, an average is clear and objective. As a prediction, it is weak. Crossovers in choppy markets often produce repeated false signals, and any apparent success in past data may reflect that particular period.

When looking at moving averages, remember that cryptocurrency prices are volatile, past performance does not predict future results, and people can lose all they invest. This explanation is educational and is not financial advice.

The complete guide to technical analysis

Decoding Cryptocurrency Market Trends with Technical Analysis
Read the guide

Keep exploring

Guides from other topics

All topics →