Simple Moving Average (SMA)

SMA
Indicator

TrendOn the price chartFree on ChartLabs

The SMA is the plain average of the last N closes, redrawn every bar. It smooths out noise so the underlying trend is easier to see.

One of the oldest tools in technical analysis. Reviewed by the ChartLabs team, updated Nov 2026.

Example market1hIndicatorsAtlas AISMAchartlabs.co/charts
Atlas reads it

Price is under a falling SMA 9. Short-term trend points down.

SMA 9 66,317.8 · Close 65,242.2

Atlas reads it

Price is under a falling SMA 9. Short-term trend points down.

SMA 9 66,317.8 · Close 65,242.2

Illustration on simulated data.

Simple Moving Average (SMA)What is the SMA indicator?

The SMA draws one blue line on the price chart. By default each point is the average of the last 9 closes, every one counted equally.

Each new bar adds the newest close to the window and drops the oldest. Because every close has the same weight, the line is smooth and steady, but a sharp move takes the full length of the window to work through.

Price above a rising SMA points to an uptrend. Price below a falling SMA points to a downtrend. When the line flattens and price crosses it often, the market is ranging.

The 50 and the 200

On daily charts the 50 and 200 SMA are the most watched averages. The 50 crossing above the 200 is often called a golden cross, and the reverse a death cross.

The drop-off effect

When a big bar leaves the window, the SMA can move even if today's price is calm. The EMA avoids this because old bars fade out slowly.

SMA signalsFive patterns to know.

1Bullish

Price above a rising SMA

Closes stay above the line while it slopes up. The trend is up on this length.

2Bearish lean

Close crosses below

After a run above the line, price closes under it. The trend may be losing steam.

3Bullish lean

Close crosses above

After a run below the line, price closes above it. Many traders also want the SMA to turn up.

4Bullish

Pullback that holds

Price dips to a rising SMA and closes back above it. The average is acting as support.

Flat line, many crosses
5Inconclusive

Flat line, many crosses

The SMA flattens and price crosses it back and forth. There is no trend to follow.

SMA formulaHow it is calculated.

SMAt=closet+closet−1+…+closet−N+1N
STEP 1

Collect the window

Take the last 9 closes, including the current bar.

STEP 2

Average them

Add them up and divide by 9. Every close counts the same.

STEP 3

Slide forward

On the next bar, add the new close and drop the oldest one. No value is drawn until 9 closes exist.

SMA settingsEvery setting, explained.

SettingDefaultRangeWhat it changes
Length91 to 10,000 (typical 9 to 200)How many closes are averaged. Longer is smoother and slower to turn.
SourceCloseAny price, or volumeWhich values feed the calculation.
LineBlue #2962FF, 1 pxAny colour and widthColour and width of the line. Add a second SMA with another length for a crossover.
Setting
Length
Default
9
Range
1 to 10,000 (typical 9 to 200)
What it changes
How many closes are averaged. Longer is smoother and slower to turn.
Setting
Source
Default
Close
Range
Any price, or volume
What it changes
Which values feed the calculation.
Setting
Line
Default
Blue #2962FF, 1 px
Range
Any colour and width
What it changes
Colour and width of the line. Add a second SMA with another length for a crossover.
926 price crosses in view
70,20866,82563,44360,06164,803.7

Drag to see how the setting changes the lines and how many signals you get. Illustration on simulated data.

SMA strategiesUse it in 3 setups.

Fast SMA crosses a slower one

IfSMA 9crosses aboveSMA 21exit whenit crosses back

The same idea as the 50 / 200 golden cross on a shorter scale. The 21 is drawn here in orange.

Pullback to a rising SMA

WhileSMArisesifprice dips to it and closes above

Traders often treat a rising SMA as an area where pullbacks may stall, and wait for the close back above.

Trend filter

Only long whileprice is aboveSMAandSMArises

A slow SMA keeps you on the side of the bigger trend. Other tools then time the entry.

Test a rule in the Strategy TesterFree with 1 year of history. Past results do not guarantee future results.

SMA mistakesCommon mistakes.

Flat line, many crosses

Trading every cross in a range

A flat SMA gets crossed over and over. Check the slope first.

Cross comes after the low

Expecting it to catch the turn

An SMA of 9 bars reflects the last 9 bars. It turns after price, and longer lengths turn later still.

Far above the line

Chasing far above the line

When price runs far above the SMA, it often drifts back toward it before the trend resumes.

SMA combinationsPair it with these.

SMA FAQQuestions traders ask.

What is the best SMA length?

9 is the ChartLabs default. 20 is common for swing trading, and the 50 and 200 day SMAs are the most widely followed on daily charts.

What is a golden cross?

The 50-day SMA crossing above the 200-day SMA. The reverse is a death cross. Both lag, because they use long windows.

SMA or EMA?

The SMA treats every bar equally, so it is smoother but slower. The EMA puts more weight on recent bars and turns sooner.

Why does my SMA move when price is flat?

A large bar just left the window. When it drops out, the average shifts even if today's bar is quiet.

What does price above the SMA mean?

Price is above its average of the last N bars. With a rising SMA, that usually means the trend on that length is up.

Does the SMA work on crypto?

Yes. It works on any market. Crypto trades around the clock, so the 200-bar SMA on an hourly chart covers a little over 8 days.

Is the SMA leading or lagging?

Lagging. It is an average of past closes. A move needs about half the window to show clearly in the line.

Does the SMA repaint?

No. Values on closed bars never change. The live bar moves until it closes.

Why is there no line at the start of the chart?

The SMA needs a full window. With a length of 9, the first value appears on the ninth bar.

Can I use the SMA on another indicator?

Not yet. The Source can be any price (open, high, low, close, HL2, HLC3, OHLC4) or volume, but not another indicator's line.

Related indicatorsMore trend tools.

All trend indicators

Try SMA on a live chart.
Free. No download.

Works in your browser and on iPhone too.

Example market1h
SMA (9, close)