Moving Averages¶
Difficulty beginner
Overview¶
Moving averages smooth price data to reveal the underlying trend. They are the most widely used technical indicators and form the basis of many trading systems.
price │ ╱╲ │ ╱ ╲ ●←──── golden cross │ ╱ ╲ │ (MA50 > MA200) │ ╱ ╲ │ │ raw price ────────── ╱╲╱ fast MA(50) ╲ ╳ ╱────── │ ╱╲ ╱╲ ╱ ╳ ╱ │ ╱ ╲ ╱ ╲ ╱ ╲ ╳ slow MA(200) │ ╱ ╲╱ ╲ ╱ ╳ │ ╱╲ ╲ ╱ ╲ │ ╱ ╲ ╲ ╱ death cross ● │ ╱ ╲ ╲╱ (MA50 < MA200) └──────────────────────────────────────────────────────→ time ▲ MA50 crosses ABOVE MA200 → bullish "golden cross" → trend up ▼ MA50 crosses BELOW MA200 → bearish "death cross" → trend down
Types¶
Simple Moving Average (SMA)¶
where:
P₁ ... Pₙthenmost recent closes (oldest to newest) ·nwindow length in periods ·SMAarithmetic mean of those closes. does: smooths price into a single slow trend line by averaging the lastncloses with equal weight. Traders use the slope as the trend filter (rising SMA = long-only bias), the line itself as dynamic support/resistance for pullback entries in trending markets, and crosses between a fast and slow SMA (classically 50/200 — the "golden/death cross") as long-horizon regime signals. The flat-line behavior in ranges makes it a poor mean-reversion trigger.
Exponential Moving Average (EMA)¶
EMA_t = P_t × k + EMA_{t-1} × (1 - k)
where k = 2 / (period + 1)
More weight to recent prices, faster response
where:
P_tcurrent close ·EMA_{t-1}prior EMA value ·ksmoothing constant — largerkmeans more weight on recent prices ·periodlookback length controlling how aggressively old data decays. does: weights the latest close more than older closes via exponential decay, so the line turns faster than an SMA of the same length. Trend traders prefer EMA crossovers (e.g., 12/26 or 9/21) for earlier entries, use the line as dynamic support in uptrends, and accept the cost — more whipsaw in choppy markets. Common stack: trade in the direction of the slope of a longer EMA, time entries off a shorter EMA pullback.
Weighted Moving Average (WMA)¶
where:
P₁most recent close (highest weight) ·Pₙoldest close in the window (weight 1) ·nwindow length ·n(n+1)/2normalizing sum of the integer weights. does: applies a strictly linear weighting that emphasizes recent prices more than an SMA but less aggressively than an EMA. Traders use WMA when they want faster turn-on-trend than SMA without the long memory tail of an EMA — common in short-horizon entry triggers and as a building block inside the Hull Moving Average.
Hull Moving Average (HMA)¶
where:
WMA(n)weighted moving average overnperiods ·WMA(n/2)weighted moving average over the half window ·2 × WMA(n/2) − WMA(n)lag-reducing differential that projects the recent slope forward ·√nsquare-root smoothing window applied to that differential ·HMAHull Moving Average. does: cancels most of the lag inherent in moving averages by combining a fast and a slow WMA, then re-smooths the result over√nso the line stays clean. Traders use HMA slope as a low-lag trend filter and HMA color-change (slope flip) as an early reversal trigger — typically paired with a slower SMA/EMA so the HMA times entries while the slower line confirms direction.
Volume-Weighted Moving Average (VWMA)¶
where:
Pᵢclose of bariin the window ·Vᵢvolume of that bar ·Σsum across the lookback window ·VWMAvolume-weighted moving average. does: weights each price by the volume traded on that bar so high-volume prices dominate the average. Traders compare VWMA to a plain SMA of the same length — VWMA above SMA signals buying happened on the up bars (real demand), VWMA below SMA signals the rally is unconfirmed. Acts as dynamic support/resistance with stronger confluence at high-volume nodes than a plain SMA.
Adaptive Moving Average (KAMA)¶
ER = |Change| / Σ|Individual Changes| (Efficiency Ratio)
SC = [ER × (2/(n+1) - 2/3) + 2/3]²
KAMA = Prior KAMA + SC × (Price - Prior KAMA)
Adapts speed based on market noise
where:
Changenet price change overnperiods ·Σ|Individual Changes|sum of absolute per-bar changes across the same window — the path length ·ERefficiency ratio in [0, 1], 1 = pure trend, 0 = pure noise ·SCsmoothing constant interpolated between fast (n=2) and slow (n=30) EMA constants ·KAMAKaufman Adaptive Moving Average. does: speeds up when price moves in a straight line (high ER) and slows down when price chops sideways (low ER), so the same indicator behaves like a fast EMA in trends and an SMA in ranges. Traders use it as a regime-aware trend-follower — entries on KAMA slope flips, exits when the line goes flat — and avoid the whipsaw that fixed-period MAs suffer in low-volatility ranges.
Common Periods¶
| MA | Periods | Use |
|---|---|---|
| Short-term | 9, 10, 20 | Entry/exit timing |
| Medium-term | 50, 55 | Trend identification |
| Long-term | 100, 200 | Major trend, institutional focus |
Trading Signals¶
Pullback to MA¶
In a trending market, price often pulls back to the MA before continuing. The mechanic is simple: latecomers who missed the initial breakout wait for a "better price" and use the MA as their reference, so demand re-enters at the line. Trade it by going with the trend on the bounce — entry on a reversal candle at the MA, stop just beyond the line plus an ATR buffer, target the prior swing extreme or trail the MA itself.
MA as Dynamic S/R¶
- In uptrend: MA acts as support
- In downtrend: MA acts as resistance
ma envelopes¶
where:
MAchosen moving average (typically SMA or EMA) ·k%envelope width as a percentage of the MA ·Upper / Lowersymmetric bands above and below the MA. does: wraps a moving average in fixed-percentage rails so deviation from trend is easy to read. Unlike Bollinger Bands the width does not adapt to volatility, so traders pickk%per asset and timeframe — touches of the upper rail mark stretched conditions and short opportunities (in ranges) or pullback targets (in trends), with the lower rail flipped. Fast mean-reversion systems fade rail touches back to the MA.
Price touching upper band → overbought Price touching lower band → oversold
Choosing the Right MA¶
| Market Condition | Best MA Type |
|---|---|
| Trending | EMA (faster response) |
| Ranging | SMA (less whipsaw) |
| Noisy | HMA or KAMA (adaptive) |
| Volume-driven | VWMA |
| Long-term analysis | SMA 200 |
Practical Guidelines¶
- Lag is Inherent — MAs always lag; they confirm, not predict
- Multiple Timeframes — Use longer MA for trend, shorter for timing
- Whipsaw Risk — MAs perform poorly in ranging markets
- Confluence — Combine with other indicators for better signals
- Self-Fulfilling — 200-day SMA is watched by institutions
- Optimize Period — Test different periods for your market/timeframe
- Don't Use in Isolation — Always consider context
Next Steps¶
- RSI — Momentum oscillator
- MACD — Trend and momentum
- Bollinger Bands — Volatility-based bands