TREND, MOVING AVERAGES & STRUCTURE
SMA (Simple Moving Average)
The plain average closing price over the period — the market's baseline.
spec id: smalength (default 20)
What does SMA measure?
The plain trend line — the classic "is this stock healthy?" test. Price above it is the textbook definition of an uptrend.
How is SMA calculated?
Add up the last 20 closing prices and divide by 20. Nothing fancy — every candle counts equally, which is why it moves slowly and steadily.
Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.
How do traders read SMA?
The 200-day is the classic regime line: above it, dips get bought; below it, rallies get sold. 20-day = short-term drift.
How do I use SMA in a bot?
Add indicator → SMA, set period. Note sma20 and sma200 also exist as built-in features — no setup needed.
See it inside a famous strategy
- Buy the dipA strong stock falls hard for a few days. You buy the bounce.
- Golden crossThe 50-day average crosses up through the 200-day. The oldest signal there is.
- RSI oversoldRSI drops under 30 — the textbook says the selling is overdone.
- Buy new highsA leader pushes to a fresh 52-week high. You buy strength, not weakness.
- Covered callOwn the stock on a dip and sell a call against it to collect premium.
- Bull call spreadThe same breakout, but with a capped, defined-risk options trade.
Related indicators
- Smoothed MAThe smoothed moving average — the same slow, sticky line as Wilder's RMA, under its other common name.
- Super smootherAn engineer's smoother: it removes the fast noise from price while adding far less delay than an ordinary moving average.
- SupertrendA single trend line that sits below price in an uptrend and above it in a downtrend, flipping sides when the trend changes.
- Symmetric WMAA gentle four-candle smoother.
Or browse all 158 indicators in the full library.