Indicators

Simple Moving Average (SMA)

Plain arithmetic mean of the last N closes. The baseline trend reference.

1 min readUpdated Jun 19, 2026

The Simple Moving Average is the unweighted mean of the last period closes. It's the slowest of the moving averages because every bar inside the window has equal weight.

Formula

SMA[t] = (close[t-N+1] + close[t-N+2] + ... + close[t]) / N

Params

  • period - number of closed bars to average. Required.

Output

Single column named after your indicator (e.g. 200-bar SMA).

Common periods

PeriodTypical use
20Short-term trend, often paired w/ price action
50Medium swing trend
100Daily-bias on higher timeframes
200Long-term regime divider - above/below = bull/bear

Usage

Most strategies use SMA as a regime filter: "only go long when close

SMA(200)". Crossovers between two SMAs are slower than EMA crossovers and produce fewer false signals at the cost of lag.

Pitfalls

  • Lag scales with period. SMA(200) is unresponsive to recent moves. If you want a long-term reference that adapts faster, use EMA.
  • Old data leaves the window discontinuously. The bar dropping out of the window can move the SMA more than the new bar entering. This is sometimes called the "drop-off effect."
Simple Moving Average (SMA) | Help Center | LucraX · LucraX