TradingCalculated
Calculations run privately in your browser
80 values
Paste a column from a spreadsheet or export.
SMA(20)106.73price is above the average
SMA(50)103.38short above long — bullish alignment
Latest close109.88
Price vs average+2.95%
The SMA gives every one of the last 20 closes the same weight, so it is smooth but slow to react. Crossovers between a short and a long average are a classic trend signal.
Price with SMA
Last 10 bars
BarCloseSMA(20)SMA(50)
#80109.88106.73103.38
#79109.74106.41103.28
#78108.82106.09103.16
#77107.55105.78103.06
#76108.58105.48102.96
#75106.89105.13102.81
#74107.98104.86102.71
#73108.58104.46102.58
#72107.57103.98102.41
#71108.12103.51102.26

Not financial advice. Results are estimates based on the values you enter and simplified assumptions; real trades are affected by fees, slippage, gaps and other factors. Trading involves substantial risk of loss. Read the full disclaimer.

How to calculate a simple moving average

SMA = (P₁ + P₂ + … + Pₙ) ÷ n

Paste prices oldest-first, one value or row per bar — straight from a spreadsheet or CSV export. Use “Sample data” to try it instantly.

Worked example

  1. The last five closes are 10, 11, 12, 13 and 14.
  2. SMA(5) = (10 + 11 + 12 + 13 + 14) ÷ 5 = 12.
  3. On the next bar the oldest value (10) drops out and the new close is added.

How to interpret a simple moving average

Price above a rising SMA suggests an uptrend; below a falling one, a downtrend. A short SMA crossing above a long one (e.g. 50 over 200, the “golden cross”) is a classic trend signal. SMAs lag because every bar has equal weight; the EMA reacts faster.

Limitations and common mistakes

  • Moving averages whipsaw in sideways markets — check trend strength with the ADX.
  • The first n − 1 bars have no value; that's the warm-up period, not missing data.
Technical Indicators

EMA Calculator

Calculate an exponential moving average with the 2 ÷ (n + 1) multiplier, bar by bar.

80 closes · EMA 20 & 50
Technical Indicators

VWMA Calculator

Calculate a volume-weighted moving average and compare it with the simple moving average.

VWMA(20) vs SMA(20)
Technical Indicators

Bollinger Bands Calculator

Calculate upper, middle and lower bands, %B and bandwidth to spot squeezes.

BB(20, 2) → bands, %B, bandwidth

SMA calculator FAQ

Which SMA periods are most popular?

20 (about a month of trading days), 50 and 200 on daily charts.

SMA or EMA?

SMA for smoother, slower signals; EMA for faster ones. Many traders use EMAs for entries and SMAs for the bigger trend.