The Exponential Moving Average gives more weight to recent bars and exponentially decays older ones. It reacts faster to price moves than SMA of the same period.
Formula
alpha = 2 / (period + 1)
EMA[t] = alpha * close[t] + (1 - alpha) * EMA[t-1]The recursive form means every past bar contributes - older bars just contribute less. There is no "drop-off effect" the way there is with SMA.
Params
period- controls how reactive the EMA is. Required.
Output
Single column named after your indicator (e.g. 50-bar EMA).
Common periods
| Period | Typical use |
|---|---|
| 9 / 12 | Fast scalp signal |
| 20 / 21 | Intraday swing reference |
| 50 | Medium-term trend |
| 200 | Daily / weekly regime divider |
Usage
EMA crossovers are the most common trend signal (crossover of
fast EMA above slow EMA = bullish). Strategies often stack three
EMAs (fast / slow / trend filter) to reduce whipsaws.
EMA vs SMA
EMA reacts ~2x faster than SMA of the same period for moderate price moves. The trade-off: more whipsaws in chop, earlier signals in trends. Pick based on the regime your strategy targets.
