How to calculate a simple moving average
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
- The last five closes are 10, 11, 12, 13 and 14.
- SMA(5) = (10 + 11 + 12 + 13 + 14) ÷ 5 = 12.
- 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.