Exponential Moving Average (EMA)

The EMA averages recent prices while giving newer candles more weight, and is used to spot the trend and dynamic support and resistance.

What it is

Unlike a simple average, the exponential moving average doesn't weight all candles equally. Recent candles count more and older ones fade out exponentially, so the EMA reacts to price changes faster than the SMA.

How it's calculated

  1. Smoothing factor α = 2 ÷ (length + 1)
  2. Today's EMA = α × close + (1 − α) × previous EMA

How traders read it

  • Price above a rising EMA points to an uptrend, and the reverse.
  • The 20, 50 and 200 EMAs are among the most used; many traders treat the 200-day as the line between long-term bull and bear.
  • Crossovers of a short and a long EMA (such as 50 and 200) are used to spot trend changes.
  • In trends, price often pulls back to the EMA and reacts there.

Settings

Choose the length by your trading style: 9 to 21 for short term, 50 for medium term and 200 for the long-term trend.

Where it misleads

  • In a trendless market price keeps crossing the EMA both ways and crossovers give false signals.
  • A moving average summarises the past; it doesn't predict the future.

Its Pine Script on Vlevel

This is the script the chart runs. In the chart's indicators window you can open it, change it and save your own copy.

Moving Average Exponential · Pine Script v6
//@version=6
indicator("Moving Average Exponential", shorttitle = "EMA", overlay = true)
len    = input.int(9, "Length", minval = 1)
src    = input.source(close, "Source")
offset = input.int(0, "Offset", minval = -500, maxval = 500)
plot(ta.ema(src, len), "EMA", color = #1fb8ff, offset = offset)

Indicators describe past prices; none predicts the future. For education, not investment advice.