A weighted moving average that gives more importance to recent price data, reacting faster to price changes than a simple moving average.

The Exponential Moving Average weights recent prices more heavily than older ones. Each new bar has more influence on the EMA than the bars before it, which makes the line respond faster to price changes compared to an SMA of the same length. The trade-off is sensitivity — a faster-reacting average also picks up more short-term noise.
The common EMA settings used in strategy building are 9 and 21 for short-term direction, 50 for intermediate trend, and 200 for the long-term regime. The 200 EMA is one of the most widely watched levels in all of trading — it acts as the dividing line between a broadly bullish and broadly bearish environment.
### Direction and bias The simplest use of an EMA is as a direction filter: price above the EMA is a bullish environment, price below is bearish. This is not an entry signal — it is context that shapes which trades you take.
### Dynamic support and resistance In trending markets, price frequently pulls back to a rising EMA before continuing higher. The 20 or 21 EMA acts as a natural pullback level in strong uptrends. When price breaks decisively below it and the EMA turns flat or down, that is often a sign the trend is weakening.
### Crossover entries A fast EMA crossing above a slow EMA (e.g. 9 crossing 21) is one of the most common trend-following entry triggers. The EMA Crossover Strategy is a full implementation of this approach.
### 200 EMA as a regime filter Restricting long entries to bars where price is above the 200 EMA — and shorts to bars where price is below — is one of the simplest and most effective structural improvements to any strategy. It does not improve the entry signal; it improves which market environment that signal is allowed to fire in.
//@version=6
indicator("EMA Demo", overlay=true)
fast = ta.ema(close, 9)
slow = ta.ema(close, 21)
ema200 = ta.ema(close, 200)
// Crossover signals
bullCross = ta.crossover(fast, slow)
bearCross = ta.crossunder(fast, slow)
// Regime: price above/below 200 EMA
inUptrend = close > ema200
plot(fast, color=color.green, linewidth=1, title="EMA 9")
plot(slow, color=color.red, linewidth=1, title="EMA 21")
plot(ema200, color=color.gray, linewidth=2, title="EMA 200")
plotshape(bullCross, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
plotshape(bearCross, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Subtle background to show regime
bgcolor(inUptrend ? color.new(color.green, 96) : color.new(color.red, 96))
Key takeaway: EMA is not just an entry tool — it is the most common regime filter in systematic trading. The 200 EMA divides a chart into bull and bear territory. Restricting long entries to bars above it is one of the simplest and most impactful structural improvements available to any strategy. See also: Trend Filter and Crossover.