Supertrend
Supertrend is an ATR-based trend-following line drawn under price in uptrends and above it in downtrends.
What it is
Supertrend uses ATR to set a safe distance from price. While price closes above the line the trend is up, and the line rises with price but never moves down. A close below the line flips the direction.
How it's calculated
- Candle midpoint = (high + low) ÷ 2
- Upper band = midpoint + factor × ATR; lower band = midpoint − factor × ATR
- In an uptrend the line follows the lower band, in a downtrend the upper band, moving only in the trend's direction.
How traders read it
- A colour change from red to green or back signals a trend change.
- Many traders use Supertrend as a trailing stop.
- Supertrend works best in steady trends.
Settings
Common settings are an ATR length of 10 and a factor of 3. A lower factor gives faster, noisier signals; a higher one slower, more reliable ones.
Where it misleads
- In a range Supertrend keeps flipping and produces many false signals.
- Its signals come after the move starts; part of the move is always missed.
Its Pine Script on Vlevel
This is the script the chart runs. In the chart's indicators window you can open it, change it and save your own copy.
Supertrend · Pine Script v6
//@version=6
indicator("Supertrend", overlay = true)
atrPeriod = input.int(10, "ATR Length", minval = 1)
factor = input.float(3.0, "Factor", minval = 0.01, step = 0.01)
[st, direction] = ta.supertrend(factor, atrPeriod)
plot(direction < 0 ? st : na, "Up Trend", color = #2ee6a6, style = plot.style_linebr)
plot(direction > 0 ? st : na, "Down Trend", color = #ff4d6a, style = plot.style_linebr)Indicators describe past prices; none predicts the future. For education, not investment advice.