Trend
Simple Moving Average (SMA)
The simple moving average explained: formula, how to read it, crossovers, support levels and ready-made SMA alerts for crypto and stocks.
5 min readUpdated
The simple moving average is the average closing price of the last N bars. It is the oldest and plainest trend tool there is: it irons out the noise of single candles and shows where the price has been on average, which tells you which way it is heading.
What it measures
Every bar has a close. The SMA adds up the last N closes and divides by N. When a new bar arrives, the oldest falls out of the window: the average "moves" along the chart.
where is the close of the current bar. Each of the N closes weighs exactly the same: a candle from 19 minutes ago matters as much as the one from a minute ago. That makes the SMA steady, and slow.
Try it
Drag the period slider: a short SMA hugs the price, a long one cuts through the swings. The second line is the slower SMA; where the two lines cross, the short-term trend overtook the long-term one.
How Subtrigger computes it
| Crypto | US stocks and ETFs | |
|---|---|---|
| Periods | 20 and 50 bars | 20 and 50 bars |
| Bar | 1 minute | 5 minutes |
| Covers | 20 and 50 minutes | 100 minutes and about 4 hours |
| First value | right away on Binance, after N bars elsewhere | after N bars |
| Stream | ind:sma_20_1m@binance.miniticker:BTCUSDT:value | ind:sma_20_5m@nasdaq.stocks:AAPL:value |
The bar that is still forming counts as the last close, so the SMA moves with every tick.
How to read it
Direction. The slope of the SMA is the trend. A rising line means the average price keeps going up.
Position. The price above the SMA means buyers have been paying more than the recent average: bullish. Below it: bearish. The further away, the more stretched the move.
Support and resistance. In a steady trend the price often pulls back to the SMA and bounces. Many traders watch the 20 and the 50 for exactly that.
Crossovers. When a short SMA crosses above a long one, recent prices are higher than older ones: a classic "golden cross" in miniature. The opposite is a "death cross".
| Signal | What it suggests |
|---|---|
| Price crosses above SMA | Momentum turned up |
| Price crosses below SMA | Momentum turned down |
| SMA 20 crosses above SMA 50 | Short-term trend now up |
| SMA 20 crosses below SMA 50 | Short-term trend now down |
| Price far from SMA | Stretched move, pullbacks likely |
Alert ideas
The price coming back above its 50-bar average after a dip:
Alert idea
BTCUSDT Price · Binance > BTCUSDT SMA 50 · 1m · Binance
A short-term trend change on a stock, with the fast average crossing the slow one:
Alert idea
AAPL SMA 20 · 5m > AAPL SMA 50 · 5m
Choosing the period
- 20 follows the short-term swing. On 1-minute bars it is a 20-minute average: good for scalping and quick dips.
- 50 is the "trend filter": slower, fewer false crosses.
- Two of them together (20 and 50) give the crossover signal.
The longer the period, the later and the more reliable the signal. There is no best period: it is a trade between speed and noise.
Common mistakes
- Trading every cross. Combine the cross with a trend filter: "price above SMA 20 and SMA 20 above SMA 50".
- Expecting it to predict. The SMA describes the past; it confirms a trend, it does not call the top.
- Comparing averages of different markets. An SMA is in price units: compare it with the price of the same market only.
For pros
- Distance as a signal. The gap between price and SMA, in percent or in units of ATR, measures how stretched a move is. Mean-reversion traders fade large gaps; trend traders want the gap to stay positive.
- Slope over price. For trend filters, the sign of the SMA's change is often more robust than the price/SMA cross.
- Bands. Add standard deviations around the SMA and you get Bollinger Bands; measure the distance in standard deviations and you get the z-score.
Related
- EMA: the faster moving average.
- MACD: the distance between two moving averages as an oscillator.
- Bollinger Bands: the SMA with a volatility envelope.
FAQ
What is the difference between SMA and EMA?
The SMA weighs every bar in its window equally. The EMA weighs recent bars more, so it turns sooner after a change of direction.
Is SMA 50 on 1-minute bars the same as the daily 50-day average?
No. SMA 50 · 1m covers the last 50 minutes. The famous 50-day average covers 50 trading days. Same formula, very different horizon.
Why does the SMA move inside a minute?
The forming bar counts as the last close, so every new tick updates the average, exactly as on a trading chart.
Keep reading
- TrendEMAThe exponential moving average explained: why it reacts faster than the SMA, how to pick a period and which EMA alerts work.
- VolatilityBollinger BandsBollinger Bands and %B explained: the bands, squeezes, band walks, mean reversion and Bollinger alerts on crypto and stocks.
- TrendMACDMACD line, signal line and histogram explained: crossovers, zero line, divergences and MACD alerts on crypto and stocks.