SMA: rolling averages, lag and the meaning of a period
A simple moving average summarizes the selected price source with equal weights.
Before this lesson
These lessons provide background; you can still read this page now.
What the indicator measures
A simple moving average summarizes the selected price source with equal weights. Its main role is to make recent price history easier to compare with a slower baseline. It describes observations already collected; neither a rising line nor a price crossing establishes the next price movement.
Calculation and units
For N observations, SMA equals their sum divided by N. Once a new candle arrives, the oldest observation leaves the window. The line can move because that old value disappears, even if the newest prices change little. A period means bars: 20 five-minute candles are not 20 trading days.
Worked educational example
For illustration only, closes 100, 102 and 104 produce a three-period SMA of 102. After a close of 106, the active window is 102, 104, 106 and the SMA becomes 104. The earlier 100 is no longer included. This small period simplifies arithmetic; it is not the chart default or a recommended trading setting.
Reading it without overclaiming
A longer window smooths more variation but reacts more slowly. Repeated crossings in a sideways series can reflect noise, with no persistent trend. A line near price is not a guaranteed support level. Confirm a comparison on closed candles rather than treating an unfinished crossing as permanent.
How TradingHub implements it
The built-in SMA defaults to 20 close prices, with period range 2–500. It needs a complete window before showing a value. Indicator Studio’s SMA template also defaults to 20 but allows a different source, including open or HLC3. Built-in values use the visible bar slice; Studio uses the available chart snapshot.
Comparisons that matter
EMA changes the weighting rather than removing lag. Compare SMA and EMA on identical sources and intervals, and do not count agreement between related averages as independent evidence. A useful comparison records the bars and source that produced each line, not just a screenshot of its color.
A reproducible chart review
Open the existing Trading chart and choose the same market, interval and closed observation time as your comparison. Record every calculation parameter before changing one at a time. Match source fields, history length and the bar window. Native indicators calculate from the supplied visible slice; Indicator Studio calculates from its available chart snapshot. A difference after panning may therefore be a window or warmup effect rather than a new market event.
Limits and next lesson
The illustration uses constructed candles, not a dated market observation or a backtest. A live candle can change until it closes. Missing history, volume units and implementation conventions limit comparisons. No indicator guarantees a direction, an execution price or protection from loss. Use the related lessons to separate definitions, observed values and possible explanations; a correct quiz records learning progress, not trading competence.
Knowledge check
What does SMA period 20 mean on a five-minute chart?
- Twenty days regardless of timeframe
- Twenty completed trades
- Twenty five-minute candles
Show explanation
The period counts observations supplied to the indicator, which here are five-minute candles.
Interactive checking needs JavaScript; the lesson and explanation remain readable.
Primary sources and scope
Educational scenarios are not execution guarantees, forecasts or personal recommendations. Check current product rules at their source.
Content revised: . Editorial responsibility: TradingHub. No independent professional certification is claimed.