SMA (Simple Moving Average)
A simple moving average is the arithmetic mean of the last N closing prices. It treats every bar in the window equally, which makes it slower to react than an EMA but produces a smoother line.
When SMA wins
SMAs cut whipsaws. The 50/200 SMA "golden cross" / "death cross" on daily charts of major indices is the most-cited long-term trend signal in finance — and it actually works on indices precisely because the lag filters noise.
Formula
SMA(N) = (close[0] + close[1] + ... + close[N-1]) / N
SMA in Pine Script
fast = ta.sma(close, 50)
slow = ta.sma(close, 200)See SMA Crossover for the canonical golden-cross strategy.
Strategies that use SMA (Simple Moving Average)
Related Terms
EMA (Exponential Moving Average)
The exponential moving average weights recent price data more heavily than older bars, making it faster to react than a simple moving average.
Crossover
A crossover happens when one series crosses above another — used as the entry signal in moving-average and oscillator-based strategies.
Stop Reading. Start Trading.
PineForge backtests every concept on this site against real market data.
Try It Free