GlossaryExponential Moving Average (EMA)

Exponential Moving Average (EMA)

The Exponential Moving Average is a moving average of closing prices that gives recent candles more weight. It reacts faster to new prices than an SMA of the same length and shows the trend direction, optionally on a different timeframe from the chart's.

Calculation

EMAt=α Ct+(1−α) EMAt−1,α=2n+1\mathrm{EMA}_t = \alpha\,C_t + (1-\alpha)\,\mathrm{EMA}_{t-1}, \qquad \alpha = \frac{2}{n+1}

CtC_t is the close of candle tt, nn the Length. The first value is the SMA of the first nn closes; before that the line stays empty. After that, each new candle enters with the share α\alpha, and with every candle older ones lose weight by the factor 1−α1-\alpha. At n=20n = 20, α≈0.095\alpha \approx 0.095: the newest candle weighs about 9.5%, in the SMA 20 only 5%.

With Same as chart, the EMA is calculated on the chart's candles. The current candle then counts at its current price.

Other timeframes

With Timeframe, the EMA is calculated on the candles of another interval, such as 1D, and the result is carried over to the chart:

  • Chart finer than the timeframe (EMA on 1D, chart 1H): Each daily value sits where its daily candle closes, and a straight line connects the two values in between. This way the line runs smoothly instead of in steps. The last stretch leads to the value of the current daily candle, with the current price as a provisional close.
  • Chart coarser than the timeframe (EMA on 4H, chart 1D): Each chart candle carries the value of the last 4H candle that closed within it.
  • Same timeframe: the regular EMA on the chart candles.

Include current candle adds the timeframe's still-open candle to the average, using the close of the chart candle in question:

EMAt=α Ct+(1−α) EMAk−1F\mathrm{EMA}_t = \alpha\,C_t + (1-\alpha)\,\mathrm{EMA}^{F}_{k-1}

EMAk−1F\mathrm{EMA}^{F}_{k-1} is the EMA of the timeframe's last completed candle. The newest stretch of the line thus follows the price, and the history shows what the line would have shown at the time. If the chart is coarser than the timeframe, the switch changes nothing.

Additional lines and crossovers

  • In the Daily & Weekly tab, you can add the EMA 20, 50, 100 and 200 on 1D and on 1W, each with its own color.
  • The Custom tab has four free lines with their own timeframe and length (by default 21 on 1D, 9 on 1D, 21 on 1W and 200 on 4H).
  • Golden & Death Cross places a ring on the 50-day EMA where it crosses the 200-day EMA: turquoise upward (golden cross), red downward (death cross). The rings also appear when the two lines themselves are off.

How to read it

  • Price above a rising EMA: uptrend over this length. Price below it and the line falling: downtrend.
  • Crossovers of a fast and a slow EMA (such as 9 and 21 or 50 and 200) are seen as trend change signals. They come earlier than with SMAs of the same length, but are also wrong more often in sideways phases.
  • The MACD is the difference between two EMAs (12 and 26).

Settings

SettingDefaultEffect
Length20Length nn, 1–500
TimeframeSame as chartInterval it is calculated on: 15m–1M
Show main lineonOff: only the lines from “Daily & Weekly” and “Custom”
Include current candleoffThe timeframe's open candle counts
Golden & Death CrossoffRings at the crossovers of 50D and 200D

Good to know

The EMA depends on the entire price series, not just the last nn candles. The starting value only fades after several multiples of nn. Right at the start of the series, a long EMA can therefore differ slightly from the value a longer series would give.

Related indicators