Esta página destina-se apenas a fins informativos. Certos serviços e funcionalidades podem não estar disponíveis na sua jurisdição.

What is a moving average?

A moving average (MA) is a line that connects average prices calculated one after another, and it is often referred to simply as "the MA." Charting software uses it to smooth out short-term price swings so that price changes over a period are easier to see.

A moving average is usually overlaid on the price chart and is a type of technical indicator. It is not another trade price, nor is it a future quote: every point comes from price data that has already been recorded. The "moving" in the name means that each time a new period's price is added, the average is recalculated and the line on the chart extends forward.

There are two common methods: a simple moving average treats the prices of the most recent periods equally, while an exponential moving average gives newer prices a larger share. Below, we first look at how each one is calculated and then compare how they differ.

Simple moving average: every recent period has the same weight

A simple moving average (SMA) adds up the prices of the most recent periods and divides the total by the number of periods. Each period's price takes up the same share of the average; this share is also called its weight. Each time a new period's price is added, the software brings in the latest period and drops the oldest one, so the calculation range moves forward by one step.

The example below uses closing prices, meaning the last trade price at the end of each period. Suppose an asset's closing prices for its first five periods are $8, $10, $12, $16, and $10. Using a three-period SMA gives the following results:

Point of calculation Closing prices included ($) Three-period SMA ($)
End of period 3 8, 10, 12 (8 + 10 + 12) ÷ 3 = 10
End of period 4 10, 12, 16 (10 + 12 + 16) ÷ 3 ≈ 12.67
End of period 5 12, 16, 10 (12 + 16 + 10) ÷ 3 ≈ 12.67

In period 5 the price falls from $16 to $10, yet the moving average does not decline, because the $10 that is added is the same as the $10 that is dropped. How a moving average changes depends on the whole set of inputs, not just on whether the latest price rose or fell compared with the previous period.

Only when the averages from each period are connected does the line on the chart take shape. The three periods used here only illustrate the calculation; they are not a recommended setting.

Exponential moving average: newer prices carry more weight

An exponential moving average (EMA) does not recalculate an equally weighted average over a fixed window each time. Instead, it combines the latest price with the previous period's EMA in fixed proportions to arrive at the new value step by step. A common way to calculate it is:

Current EMA = latest price × smoothing factor + previous EMA × (1 − smoothing factor)

The smoothing factor is the share of the current calculation assigned to the latest price, and it is commonly set as 2 ÷ (number of periods + 1). The calculation needs a starting value at the outset; a common approach is to use the SMA of the first few periods.

Using the same hypothetical prices, the smoothing factor for a three-period EMA is 2 ÷ (3 + 1) = 0.5. Taking the period 3 SMA of $10 as the starting value:

  • Period 4 EMA = 16 × 0.5 + 10 × 0.5 = $13;
  • Period 5 EMA = 10 × 0.5 + 13 × 0.5 = $11.5.

How SMA and EMA differ

Both methods can be calculated from the same set of prices. The difference lies in how weight is assigned to newer and older prices, and how older prices drop out of the calculation.

Comparison Simple moving average (SMA) Exponential moving average (EMA)
Weight of newer and older prices The same for every period in the window The latest price takes the smoothing-factor share; the older a price, the smaller its share
How older prices drop out They stop counting as soon as they leave the window Their influence fades period by period rather than disappearing abruptly
How it is calculated The average of the most recent periods is recalculated each time It is built step by step from the previous period's EMA
Affected by the starting value? No Yes, by the starting value and by how much historical data is included

In the example above, the price falls from $16 to $10 in period 5: the three-period SMA stays at about $12.67, unchanged, while the three-period EMA falls from $13 to $11.5. The EMA responds more visibly to the latest price, but that does not mean it predicts the next period more accurately.

A "three-period EMA" also does not mean that only the three most recent prices are used: the influence of older prices has already been carried into the previous period's EMA and fades period by period, rather than disappearing as soon as a price falls outside the latest three periods. If charting software uses a different starting value or a different length of historical data, its EMA values may also differ.

"20 periods" does not necessarily mean 20 days

One "period" of a moving average usually corresponds to one candlestick on the chart, a shape that records trade prices over a span of time; that span can be a day, an hour, or another length. The number of periods is a setting of the moving average calculation, while the chart time frame determines how long each period is. On a daily chart, a 20-period SMA averages the prices of the latest 20 daily candlesticks; on a one-hour chart, it averages the prices of the latest 20 one-hour candlesticks. The two cover different time spans.

With the same method and price input, a smaller number of periods usually makes a moving average more sensitive and leaves in more short-term swings; a larger number of periods usually makes it smoother but slower to respond to price changes. For an EMA, increasing the number of periods also lowers the smoothing factor, giving the latest price a smaller share of the current calculation.

When comparing two moving averages, you also need to confirm whether each is an SMA or an EMA, what the price input is, and which market the price data comes from. Trade prices differ somewhat between trading markets, so moving averages calculated from each market's prices may also differ. Closing prices are a common input, but a moving average can also be calculated from other data, such as opening prices. The number "20" by itself is not enough to explain why two lines are the same or different.

Lag, crossovers, and price position

A moving average describes how the selected data changes after smoothing, not where the price must go next. It lags because older prices are still part of the calculation: when the price has already turned, the moving average may still be heading in its original direction, and the longer the period, the more noticeable this delayed response usually is.

Analysts also watch for crossovers between the price and a moving average, or between moving averages of different periods. A crossover means that their previous positions above and below each other have switched. Such crossovers are also a kind of technical indicator "signal", and they are not a buy or sell conclusion in themselves. When the price moves back and forth within a range, crossovers may occur repeatedly without forming a sustained new direction.

Likewise, a price above the moving average only means it is higher than the average calculated from this set of data; it does not prove the asset has become "expensive." A price below the moving average does not prove the asset has become "cheap" either. A moving average does not verify a project's use, security, or asset value. Its role in technical analysis is to organize historical prices, and it cannot replace judgment on other questions.

Learn more about the Relative Strength Index, technical indicators, technical analysis, and candlestick charts, or return to the cryptocurrency glossary.

References

Aviso legal
Este conteúdo é fornecido apenas para fins informativos e pode abranger produtos que não estão disponíveis na tua região. Não se destina a fornecer (i) aconselhamento ou recomendações de investimento; (ii) uma oferta ou solicitação para comprar, vender ou deter ativos de cripto/digitais, ou (iii) aconselhamento financeiro, contabilístico, jurídico ou fiscal. As detenções de ativos de cripto/digitais, incluindo criptomoedas estáveis, envolvem um nível de risco elevado e podem sofrer grandes flutuações. Deves ponderar cuidadosamente se o trading ou a detenção de ativos de cripto/digitais são adequados para ti, tendo em conta a tua condição financeira. Consulta o teu profissional jurídico/fiscal/de investimentos para tirar dúvidas sobre as tuas circunstâncias específicas. As informações (incluindo dados de mercado e informações estatísticas, se existirem) apresentadas nesta publicação destinam-se apenas a fins de informação geral. Embora tenham sido tomadas todas as precauções razoáveis na preparação destes dados e gráficos, a OKX não assume qualquer responsabilidade por erros ou omissões aqui expressos.

Ativos digitais sujeitos a volatilidade e não segurados. Não constitui aconselhamento financeiro ou de investimento. Nem todos os produtos são oferecidos em todas as regiões. Aplicam-se exclusões e Termos e Condições.

© 2026 OKX. Este artigo pode ser reproduzido ou distribuído na sua totalidade, ou podem ser utilizados excertos de 100 palavras ou menos deste artigo, desde que essa utilização não seja comercial. Qualquer reprodução ou distribuição de todo o artigo também deve indicar de forma notável: “Este artigo é © 2026 OKX e é utilizado com permissão.” Os excertos permitidos devem citar o nome do artigo e incluir a atribuição, por exemplo, "Nome do Artigo, [nome do autor, se aplicável], © 2026 OKX." Alguns conteúdos podem ser gerados ou ajudados por ferramentas de inteligência artificial (IA). Não são permitidas obras derivadas ou outras utilizações deste artigo.

Artigos relacionados

Ver mais
trading-foundations-20-thumbnails-jpg-2026-11-25/quote-currency

What is total supply?

**Total supply is the total number of units of a crypto asset that have been created so far and still exist after the burned units are subtracted.** It includes units that are still locked, not yet re
27/11/2026
trading-foundations-20-thumbnails-jpg-2026-11-25/order-book

What is a technical indicator?

**A technical indicator is a set of values or a curve calculated from market data such as price and trading volume according to a defined formula.** It organizes trading records into results that are
27/11/2026
trading-foundations-20-thumbnails-jpg-2026-11-25/market-depth

What is technical analysis?

**Technical analysis (TA) is a family of analytical methods that study historical prices, trading volume, and other market trading data to identify trends and patterns.** A pattern here is a shape for
27/11/2026
trading-foundations-20-thumbnails-jpg-2026-11-25/bid-price

What is a support level?

**A support level is a price zone marked in technical analysis where the price, when falling, has previously slowed, paused, or rebounded, so analysts watch whether a similar reaction will occur again
27/11/2026
trading-foundations-20-thumbnails-jpg-2026-11-25/ask-price

What is a resistance level?

**A resistance level is a price area marked in technical analysis where price rises have previously slowed, paused or turned lower, so analysts watch whether a similar reaction appears again.** It des
27/11/2026
trading-foundations-20-thumbnails-jpg-2026-11-25/price-impact

What is the Relative Strength Index?

**The Relative Strength Index (RSI) is a technical indicator that compares the amounts by which an asset's price has risen and fallen and expresses the result as a reading from 0 to 100.** It describe
27/11/2026
Ver mais