Skip to content

EMA

Indicators · Moving Averages

EMA node on the canvas

Exponential Moving Average of a price column.

The EMA smooths a noisy price series into a single flowing line so you can see the trend instead of the chop. Unlike a plain average, it weights recent bars more heavily, so it turns faster when price changes direction. Traders reach for it to define trend bias ("price above the 200 EMA = long-only"), to build crossover signals, and as a dynamic support/resistance level that the market tends to respect.

How it works

Under the hood the EMA is a recursive exponential filter. For each bar it computes EMA_today = α × Price_today + (1 − α) × EMA_yesterday, where the smoothing factor α = 2 / (Period + 1). A larger Period means a smaller α, so the line leans more on its own history and reacts slowly; a smaller Period reacts fast but wobbles more.

By default the Source is each bar's close, but you can smooth open, high, low, or a blend (hl2, hlc3, ohlc4). If you wire another indicator's series into the input instead of bars, the EMA smooths that series and the Source parameter is ignored. The output is one value per bar, drawn as a line whose colour you control with Line color.

When to use it

Reach for an EMA when you want a faster, more responsive trend line than a simple average — it shines in trending markets and for shorter-term systems where lag is the enemy. It's the go-to over an SMA when you care about catching turns early. Be careful in choppy, range-bound markets: the EMA will whipsaw back and forth across price and hand you a stream of false signals. There it's a liability, not an edge.

Example

EMA on the EURUSD H1 chart

EMA on EURUSD · H1

A classic trend filter: wire bars into two EMAs, one with Period 50 and one with Period 200. Feed both into a Crossover block to fire when the fast line crosses the slow one, then route that into an Entry. Add a rule that only takes longs while price sits above the 200 EMA to keep the system on the right side of the bigger trend.

Tips & gotchas

  • Period sensitivity is real. Small period changes (20 vs 21) rarely matter; large ones (20 vs 200) change the strategy entirely. Don't over-optimise the exact number — it's a sign of curve-fitting.
  • No lookahead here. The EMA only uses the current and past bars (adjust=False), so it's safe to backtest, but it still lags — it confirms a move after it's underway.
  • Ranging markets eat EMA crossovers. Pair crossover logic with a trend or volatility filter (ADX, ATR) to sit out the chop.
  • Stack the same source. When comparing two EMAs, keep their Source identical (both close) or the comparison is meaningless.
  • The line reacts to the most recent bars, so a single spike can yank it more than it would an SMA — expect a touch more noise in exchange for less lag.

Inputs

Socket Type What to wire in
Source bars / series Price bars or any indicator series

Outputs

Output Type Plots as Description
EMA series Line Smoothed price series

Parameters

Parameter Type Default What it does
Period number · 2–500 20 Window length for the exponential smoothing
Source choice (close, open, high, low, hl2, hlc3, ohlc4) close Which price to smooth (used when bars are wired)
Line color colour #4fc3f7 Color of the EMA line on the chart

Reference auto-generated from the block catalog · category Indicators.