Pullback bounce
A trend-continuation long that buys clean pullbacks to a rising medium-term EMA.
Exponential Moving Average
A weighted moving average that gives more influence to recent prices, making it more responsive to new information than a simple moving average.
EMA is a weighted moving average that gives recent prices more influence than older ones, making it more responsive than a simple moving average. Common lengths are 9 and 21 for short-term, 50 for medium-term, and 200 for long-term trend. Used as dynamic support/resistance and as a trend-bias filter.
The EMA applies an exponentially decaying weighting to past prices — the most recent bars influence the average most, older bars fade out. This makes the EMA react faster to price changes than an SMA of the same length, at the cost of being slightly noisier.
Common lengths: 9/21 for short-term, 50 for medium-term, 200 for long-term trend. EMAs are used in three main ways: as dynamic support/resistance, as trend filters (price vs EMA), and as crossover signals between two EMAs of different lengths.
Entry ideas
A trend-continuation long that buys clean pullbacks to a rising medium-term EMA.
The classic regime-change long that catches major long-term bias flips.
A transition-phase long that catches the shift from distribution to markup.
Exit ideas
A simple, reactive exit that closes when the short-term trend structure cracks.
A smoother exit that waits for the trend itself to turn, filtering out brief dips.
The definitive long-term exit that closes everything when the major regime flips bearish.
Utilities
A filter that keeps any long strategy out of extended downtrends, boosting win rate.
A multi-EMA stack that reads trend acceleration, deceleration, and regime at a glance.
| Parameter | Default | When to adjust |
|---|---|---|
| Short-term length | 9 or 21 | 9 EMA for very short-term timing on intraday charts; 21 EMA for daily-chart short-term trend. |
| Medium-term length | 50 | Industry-standard medium-term trend filter. Pullbacks to the 50 EMA in uptrends are common buy zones. |
| Long-term length | 200 | The classic long-term trend filter. Price above 200 EMA = bullish regime; below = bearish. |
| Source | Close | Most common. HLC3 or HL2 reduces wick noise on volatile assets. |
//@version=5
indicator("EMA Example", overlay=true)
fastLen = input.int(21, title="Fast Length", minval=2)
slowLen = input.int(50, title="Slow Length", minval=2)
src = input.source(close, title="Source")
emaFast = ta.ema(src, fastLen)
emaSlow = ta.ema(src, slowLen)
plot(emaFast, title="EMA Fast", color=color.blue, linewidth=2)
plot(emaSlow, title="EMA Slow", color=color.orange, linewidth=2)Pine's ta.ema() handles the recursive calculation for you, so you don't need to track previous EMA values manually. Plotting two EMAs (a fast and slow length) overlaid on price gives you both trend direction and crossover signals in one indicator. Use overlay=true so the EMAs draw on the same pane as price.
EMA is computed recursively, with each bar's contribution decaying exponentially over time. The smoothing factor α determines how heavily recent bars are weighted versus older ones.
EMAs are lagging by design — they smooth past data, so they cannot predict turns. They fail in three regimes.
Sharp regime changes — sudden trend reversals or news-driven gaps — leave EMAs trailing the new direction. The EMA's lag becomes a liability when speed matters more than smoothness.
Choppy ranges produce constant fake-out crossovers as price oscillates around the line. Two-EMA systems whipsaw repeatedly, racking up small losses without a meaningful directional move.
Strong, persistent trends paradoxically reduce the EMA's value as a buy-pullback indicator — pullbacks become shallow or skip the EMA entirely, leaving traders waiting for entries that never come.
Pair EMAs with a regime filter (ADX, range detection, or volatility expansion check) to know when the chart is in a regime where EMA signals are actionable.
| Indicator | When to prefer |
|---|---|
| MACD | MACD packages two EMAs plus a signal line into a single momentum oscillator with clear timing triggers — better than raw EMAs when you need a defined entry signal. |
| Bollinger Bands | Bollinger Bands wrap a moving average with volatility-adjusted bands — better when you need to know how stretched a move is, not just direction. |
| Supertrend | Supertrend gives a binary trend regime with built-in volatility-aware stops — better for systematic trend-following without interpretation overhead. |
An SMA averages all bars in the lookback equally. An EMA weights recent bars exponentially more, so it reacts faster to new price action. The trade-off: EMA is more responsive to real moves but also noisier. SMA is smoother but lags more on regime changes. Most modern indicators (MACD, EMA crossovers) use EMAs for that responsiveness.
There is no universal best — length depends on timeframe and intent. For trend-bias filtering, 200 EMA on the daily is industry standard. For medium-term swing trading, 50 EMA. For short-term timing, 9 or 21 EMA. Stick with these standards; custom lengths usually overfit a single backtest window.
It works in trending markets and fails in choppy ones — the same as any crossover system. Pairing with a higher-timeframe trend filter (e.g., daily 200 EMA direction) and a momentum check (MACD histogram positive on longs) significantly raises the win rate. Standalone, expect plenty of whipsaws.
EMAs are recursive, so the starting value affects all subsequent values. TradingView seeds the EMA from an SMA of the first N bars. Pine's ta.ema() handles this automatically. If you compute EMAs manually with a different seed (e.g., from the first close), you'll see small differences for the first ~3N bars before they converge.
Continue exploring
Moving Average Convergence Divergence
A trend-momentum indicator built from the difference between two EMAs, plus a signal line and histogram that visualise momentum shifts.
View MACDMomentumRelative Strength Index
A momentum oscillator that measures the speed and magnitude of recent price changes on a bounded 0–100 scale.
View RSIVolatilityBollinger Bands
A volatility envelope built from a moving average and ±2 standard deviations, expanding and contracting as volatility changes.
View BBAbout these ideas
Each entry, exit, and utility rule in the Playbook is hand-picked from established trading literature, validated against historical backtests, and reviewed by the PineWiz team. We add new ideas as we encounter them and refresh existing ones when market behavior or default settings shift. Last review: .
Educational content. Not financial advice.