Exponential Moving Average (EMA)
The Exponential Moving Average (EMA) is a trend-following average that weights recent prices more heavily than older ones, so it responds faster than a simple moving average to new information while still smoothing raw price.
What it measures
EMA computes a weighted average of past closes using a smoothing factor α = 2 / (period + 1). Each new candle folds into the running value by α × close + (1 − α) × previous EMA, so no bar is ever dropped — old data just decays.
Parameters
| Name | Default | Range | Note |
|---|---|---|---|
| period | 20 | 5–200 | 9 and 21 are common for short-term structure; 50 and 200 are the classic institutional trend lines. |
| source | close | close, open, hl2, hlc3, ohlc4 | Close is the standard. hl2 (median) and hlc3 (typical price) reduce single-print noise on illiquid instruments. |
How it behaves
EMA lags price but less than an equivalent SMA. A rising EMA with price above it is the textbook uptrend definition; crossovers between a fast and a slow EMA (9/21, 50/200) are the standard trend-change proxy. In consolidation the line flattens and price whipsaws through it repeatedly.
When it misleads
Any moving-average system fails in a range, and EMA is no exception — the faster response that helps in trends becomes a liability when price is going nowhere. It also lies about "where the trend is" during sharp regime changes: an EMA fitted to a two-year uptrend takes weeks to acknowledge that the trend has broken, and the level itself becomes a poor guide to structure during that gap.
Backtest result
Sourced backtest in preparation — we're running the rule on our own historical candles before publishing numbers we can stand behind.
FAQ
- EMA vs SMA — which is better?
- Neither. EMA reacts faster (helpful for entries, worse for false signals); SMA is smoother (fewer whipsaws, later turns). Choose based on whether your rule pays for speed or for stability.
- What are the 9, 21, 50, and 200 EMAs used for?
- 9 and 21 flag short-term momentum; 50 is the medium-term trend proxy widely watched on daily charts; 200 is the long-term regime line — price above 200-EMA is a common "long-only" gate for systematic strategies.
- How is EMA initialised?
- Most implementations seed the first EMA value with the SMA of the first `period` closes, then apply the recursive formula from bar `period + 1` onwards.
Build a strategy with EMA
Drop the block into the Nodlow builder and backtest on real historical data.
Try it in the builder