Skip to content

SMA

Indicators · Moving Averages

SMA node on the canvas

Simple Moving Average of a price column.

The SMA is the plainest trend line there is: the average of the last N closes, plotted as one smooth line. It strips the noise out of price so you can see the underlying direction, and it's the reference every other moving average is measured against. Traders use it to define bias ("price above the 200 SMA = bull market"), to build crossover systems, and as a slow, stubborn support/resistance level that big funds genuinely watch.

How it works

For each bar the SMA adds up the last Period values of the Source and divides by Period — every bar in the window counts exactly the same. That equal weighting is the whole personality of the SMA: it's smooth and steady, but it lags, because a price move has to work its way across the entire window before the line fully reflects it.

By default the Source is each bar's close, but you can average open, high, low, or a blend (hl2, hlc3, ohlc4). Wire another indicator's series into the input and the SMA smooths that series instead — a quick way to clean up a jumpy oscillator. The single output is one value per bar, drawn as a line whose colour you set with Line color.

When to use it

Reach for the SMA when you want a stable, slow-moving definition of trend that won't twitch at every spike — it's the classic choice for long-term bias filters (50/100/200) and for systems where you'd rather be late than wrong. Compared with an EMA, it reacts slower but whipsaws less, so it's the calmer option in noisy markets. The trade-off is lag: in a fast reversal the SMA is the last to turn.

Example

SMA on the EURUSD H1 chart

SMA on EURUSD · H1

The textbook trend filter: wire bars into two SMAs, one Period 50 and one Period 200, and feed both into a Crosses Above block — the "golden cross" fires long when the fast average climbs through the slow one. Route that into a Buy Signal, and only allow longs while price sits above the 200 SMA so you're always trading with the bigger tide. Send it all to the Tester to see it on real costs.

Tips & gotchas

  • Round numbers aren't magic, but crowds make them real. The 50/100/200 SMAs get watched by enough traders that price genuinely reacts to them — that self-fulfilling attention is part of the edge.
  • No lookahead. The SMA only uses the current and past bars, so it's safe to backtest — but it still lags by design.
  • Match the source. When comparing two SMAs, keep their Source identical (both close), or the crossover is meaningless.
  • It's a filter, not a trigger. A long, slow SMA is great for bias but a poor entry — pair it with a faster signal so you don't buy the exact top of an extended move.
  • Ranging markets eat crossovers. Gate SMA-cross logic with a trend-strength filter like ADX / DMI to sit out the chop.

Inputs

Socket Type What to wire in
Source bars / series Price bars or any indicator series

Outputs

Output Type Plots as Description
SMA series Line Smoothed price series

Parameters

Parameter Type Default What it does
Period number · 2–500 50
Source choice (close, open, high, low, hl2, hlc3, ohlc4) close
Line color colour #ffb74d

Reference auto-generated from the block catalog · category Indicators.