Simple moving average (SMA)
Last updated
A simple moving average (SMA) is the plain average of the last n closing prices, recalculated on every new bar. It smooths price into one line.
How a simple moving average is calculated
SMA = (close now + close one bar ago + ... + close n-1 bars ago) / n. A 20-bar SMA adds the last 20 closes and divides by 20. When a new bar arrives, the oldest close drops out and the newest is added. The line sits about (n-1)/2 bars behind price on average.
How it is read
Traders compare price with the line (above or below), compare a short SMA with a long one, or look at the slope. Common lengths are 20, 50 and 200 bars.
Common mistakes
- Treating the line as support or resistance that price must respect. It is an average, not a level anyone defends.
- Picking the length after looking at the chart. Every length fits some past stretch.
- Forgetting it lags. By the time price is far from the line, the average has barely moved.
Test it yourself
Pick SMA as an indicator, set a length, and compare it with the close (for example, close crosses above SMA 50). The Lab charges trading costs on every trade, fills on the next day's open, and shows how many attempts you have made.
What Tickfloor tested
How we counted
Tickfloor's research desk has backtested 1,346 strategies, net of modelled trading costs. After correcting for the 1,778 tests run, 0 passed. That does not prove no strategy works. These are results from our older test setup, which was built before our current testing rules. They have not been redone under those rules.
Claim tests on SMA
- Moving Average Crossover (claim test)
- The 200-day rule on SPY (claim test)
- Bull Market Support Band (claim test)
- Mayer Multiple (claim test)
Lessons that cover it
Related concepts
General information only. It doesn't consider your objectives, finances or needs. Tickfloor holds no financial services licence and never places trades.