Tickfloor

Simple moving average (SMA)

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 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

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

Tickfloor's research desk has backtested 678 strategies, net of modelled trading costs. After correcting for the 761 tests run, 0 passed. That does not prove no strategy works. These are historical diagnostics, not validation under Testing Standard v2: the backtest harness predates that standard and has not been re-run to meet it.

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.