Moving Average Calculator

Calculate SMA, EMA, WMA, and HMA for any price data. Detect golden cross and death cross between two moving averages. Free, no sign-up.

Single Moving Average
One price per line, most recent last. Default: 50-point EUR/USD sample series.
MA Crossover Detection
Latest MA (20-period SMA)
1.08327
Cross Signal
🔻 Death Cross
Trend Bias
Bearish ▼
MA Separation
0.00%

How Moving Averages Work

A moving average smooths price data by creating a constantly updated average over a fixed period. It filters out noise to reveal the underlying trend. The four main types — SMA, EMA, WMA, and HMA — differ in how they weight recent vs older prices.

SMA = (P₁ + P₂ + ... + Pₙ) / N

Simple Moving Average: all prices weighted equally. Most stable, but slowest to react to trend changes.

EMA = Price × k + EMA_prev × (1 − k), k = 2/(N+1)

Exponential Moving Average: recent prices carry exponentially more weight. More responsive than SMA — preferred for short-term signals like the 9/21 EMA crossover.

WMA = Σ(Pᵢ × wᵢ) / Σ(wᵢ), wᵢ = 1..N

Weighted Moving Average: linear weighting — the most recent price gets weight N, the oldest gets weight 1. Falls between SMA and EMA in responsiveness.

HMA = WMA(2 × WMA(N/2) − WMA(N), ⌊√N⌋)

Hull Moving Average: nearly zero-lag. Uses a double-WMA trick to cancel the lag inherent in other MAs while keeping the line smooth. Best for rapid trend change detection.

Golden Cross & Death Cross

When a faster MA crosses above a slower MA, it signals a potential uptrend — a golden cross. When the fast MA crosses below the slow MA, it signals a potential downtrend — a death cross. The classic setup uses the 50 and 200 SMA on the daily chart, but shorter periods (9/21 EMA) are common on intraday timeframes. Use the ATR calculator to confirm volatility is backing the signal — high-ATR breakouts on a golden cross are more reliable.

Choosing the Right Moving Average

For trend identification, SMA is the default — stable and widely followed. For entry timing, EMA reacts faster to price changes. For scalping on low timeframes, HMA eliminates lag almost entirely. Pair moving averages with volatility analysis to avoid false signals in choppy, low-ATR markets.

Moving Average Type Comparison
TypeLagSmoothnessBest For
SMAHighVery smoothLong-term trend, 50/200 cross
EMAMediumSmoothShort-term signals, 9/21 cross
WMAMediumModerateBalanced approach
HMAVery lowModerateScalping, fast trend changes

Frequently Asked Questions

What is the difference between SMA and EMA?

SMA weights all prices equally across the period. EMA gives more weight to recent prices using multiplier k=2/(N+1), making it more responsive to recent price changes. For short-term trading, EMA reacts faster. For long-term trend analysis, SMA is more stable.

What is a golden cross and death cross?

A golden cross occurs when a faster MA (e.g. 50-period) crosses above a slower MA (e.g. 200-period) — typically a bullish signal. A death cross is the opposite: fast MA crosses below slow MA — typically bearish. The classic setup uses the 50 and 200 SMA on daily charts.

What period should I use for moving averages?

Common periods: 9/21 EMA for short-term trend on 1H/4H charts; 20 SMA for middle Bollinger Band; 50/200 SMA on daily for long-term trend. Day traders often use 9/21 EMA crossovers. Swing traders use 20/50 SMA. Investors watch 50/200 SMA crosses.

What is the Hull Moving Average (HMA)?

HMA (Hull Moving Average) combines weighted moving averages to reduce lag while maintaining smoothness. It uses WMA(2×WMA(N/2) − WMA(N), sqrt(N)). HMA is nearly lag-free compared to SMA/EMA and is popular for identifying rapid trend changes.