Concept
SMA
SMA is a Trend concept. The Library holds 20 implementations, each one a working definition you can pull into Quant.
Top SMA indicators
20 total
What is an SMA?
A simple moving average (SMA) is the arithmetic mean of the last N values of a series, usually closing prices, recomputed on every bar. Each of the N bars carries identical weight, one part in N, so the line smooths bar-to-bar noise into a single trend estimate. The cost of that smoothing is lag: on a steadily trending series the SMA runs roughly half its window length behind price.
Equal weighting gives the SMA one quirk worth knowing: the drop-off effect. The oldest bar exits the window on every new bar, so a single extreme value from N bars ago can move today's average even while current price sits still. Equal weighting is also what the rest of the moving-average lineage exists to change: the EMA shifts weight toward recent bars, and faster designs such as the HMA push further, each trading noise suppression against lag differently.
The SMA matters because it is the reference smoother of technical analysis. The 200-day SMA is among the most watched trend benchmarks in any market, the golden cross and death cross are defined on SMA pairs, and Bollinger Bands build on a 20-period SMA basis. Because so many participants watch the same lines, widely used SMAs can behave like self-reinforcing reference levels, though nothing obliges price to respect them.
How to calculate an SMA
The calculation is a rolling arithmetic mean. Every charting platform automates it, but the mechanics matter for reading the line correctly.
- 1Choose a source and a length. Close is the standard source; common lengths are 20 for short-term work, 50 for intermediate, and 200 for long-term context.
- 2Sum the last N source values and divide by N. That quotient is the SMA value plotted on the current bar.
- 3Advance one bar: the newest value enters the window, the oldest drops out, and the mean is recomputed. The plotted line connects these rolling means.
- 4Read it through slope and position: price holding above a rising SMA is trend-following evidence for longs, price below a falling SMA is the mirror case, and a flat SMA with price whipping across it marks a range where the average carries little information.
How traders use it
- As a trend filter: price above or below a long SMA (the 200-day is the classic) gates which direction a system is allowed to trade, the same role a higher-timeframe trend filter plays across timeframes.
- As a crossover engine: a fast SMA crossing a slow one defines moving average crossovers, including the 50/200 golden and death crosses used as slow regime signals.
- As dynamic support and resistance: widely watched SMAs often see reactions on a first touch (dynamic S/R via MA), though a touched average holds only as often as the trend behind it does.
- As a building block: the 20-period SMA is the default basis of Bollinger Bands, and SMAs at stepped lengths form MA ribbons and envelopes that read trend alignment at a glance.
SMA vs neighboring averages
EMA: Both smooth price, but the EMA applies exponentially decaying weights, so it hugs recent price and turns earlier. The SMA weights all bars equally, which makes it smoother, slower, and subject to old bars dropping out of the window.
WMA: The WMA weights bars linearly, newest heaviest and oldest lightest, so recent action dominates and the line turns sooner than an equal-length SMA. The SMA is the flat-weight special case and the slowest of the family to reflect the newest bar.
VWMA: The VWMA weights each bar by its volume rather than its recency, so heavy-volume bars pull the average toward their price. The SMA treats a quiet bar and a climactic bar identically.
LSMA: The LSMA fits a linear regression through the window and plots its endpoint, an estimate of where the trend says price should be now. The SMA plots the window's mean, which sits near the middle of a trending window rather than its leading edge.
More SMA implementations
- Three Anchored Moving Averages (VWAP / SMA / EMA)
- VWMA/SMA Delta Volatility (Statistical Anomaly Detector)
- Donchian MA Bands
- Simple Moving Averages
- Moving Average Channel
- VCP-Minervini v2
- Step Generalized Moving Average
- Pivot Point Moving Averages
- Moving Average with Pivot Range
- CM RSI-2 Strategy - Upper Indicators.
- CM RSI-2 Strategy Lower Indicator
- Ehlers Undersampled Double Moving Average Indicator
- Point and Figure (PnF) Moving Averages
- TRIX With Moving Average - Didi's Needles setup
- Moving Average 50/200 Golden Cross or Dead Cross
- HUK ElasticVolume/50 MOVING AVERAGE e 50/200/20 Coral Trend
Related concepts · Moving-average lineage
Concept family
Trend
100 concepts mapped · 88 in the Library
SMA FAQ
What is the best SMA length?
There is no single best length. Convention uses 20 for short-term, 50 for intermediate, and 200 for long-term context, and those defaults matter mainly because many traders watch them. Longer windows give smoother, slower lines with fewer but later signals; shorter windows track price closely and whipsaw more. Match the length to your holding period rather than searching for a magic number.
Why is the 200-day SMA so widely watched?
It condenses roughly ten months of daily sessions into one line of long-term trend context, and decades of use have made it an institutional convention. Because so many participants track it, reactions near it can be partly self-fulfilling. That attention makes it a useful reference, not a barrier: price crosses the 200-day routinely in choppy markets.
Is an SMA or EMA better?
Neither is better universally. The EMA reacts faster, which helps in fast markets but produces more false turns; the SMA filters more noise but signals later. Which one wins flips depending on the market and period tested. Applying one type consistently, and knowing its lag, matters more than the choice itself.
Does the SMA lag price?
Yes, by construction. Averaging the last N bars anchors the line to the past, and on a steady trend it trails price by about half the window length. Lag is the price paid for smoothing, not a defect, but it means SMA signals confirm moves already underway rather than anticipate them.
Do moving averages act as support and resistance?
Sometimes, mostly the widely watched ones (50, 100, 200) in trending markets. The average itself has no mechanical power; reactions happen because trend participants buy pullbacks near it and because many traders place orders around the same reference. Treat a touch as a location to evaluate, not a level guaranteed to hold.
Build SMA your way.
Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.
.png&w=3840&q=75)

