Supertrend
Supertrend
A volatility-adjusted trend-following indicator that flips bullish or bearish when price crosses through a dynamic ATR-based band.
Supertrend is a trend-following indicator that plots a single line acting as dynamic support in uptrends and resistance in downtrends. Built on ATR-based bands, the line "flips" bullish or bearish when price closes through it. Default settings: factor 3, ATR period 10.
Supertrend plots a single dynamic line that sits below price during uptrends (acting as support) and above price during downtrends (acting as resistance). The line's distance from price is set by ATR × a multiplier (default factor 3, ATR period 10) — so the indicator widens during volatile periods and tightens during calm ones.
When price closes through the line, the indicator "flips" — bullish becomes bearish or vice versa. That flip is the core signal. Supertrend is designed to keep traders in the trend until it materially changes, but it can whipsaw in choppy ranges. Pair with a regime filter (ADX, range detection) for better outcomes.
How do I read Supertrend?
- Indicator below price = bullish trend regime. The line acts as dynamic support; pullbacks toward it are buy-the-dip candidates.
- Indicator above price = bearish trend regime. The line acts as dynamic resistance.
- Direction flips (bullish ↔ bearish) are the core signal. Each flip is a regime change.
- Line distance from price = current volatility. The line widens during volatile periods (giving trades more room) and tightens during calm periods.
- Walking the line: in strong trends, price often retests the indicator line repeatedly without breaking it. Each retest is a continuation entry candidate.
- Frequent flips signal a choppy market — the indicator is whipsawing and entries should be avoided until volatility settles into a clear regime.
How is Supertrend calculated?
Supertrend builds a single line from ATR-based bands and flips direction when price closes across it. The factor controls how far the line sits from price; ATR scales the distance to the asset's volatility.
- 1.Compute the basis: (high + low) / 2.
- 2.Compute the upper band = basis + (factor × ATR(period)). Compute the lower band = basis − (factor × ATR(period)).
- 3.When the trend is bullish, the indicator line equals the lower band, trailing below price as support.
- 4.When price closes below the lower band, the trend flips bearish; the indicator line moves to the upper band as resistance.
- 5.When price closes back above the upper band, the trend flips bullish again; the line moves back to the lower band.
What are the default Supertrend settings?
| Parameter | Default | When to adjust |
|---|---|---|
| Factor (multiplier) | 3.0 | Distance multiplier on ATR. Lower (2.0) = tighter line, more flips; higher (4.0) = wider line, fewer flips and longer trend rides. |
| ATR period | 10 | Lookback for the ATR calculation that sets line distance. Shorter (5) = more reactive line; longer (14) = smoother. |
| Source for trigger | Close | Pine's ta.supertrend() uses close to detect flips. Some custom variants use HLC3 for slightly less wick-induced noise. |
How do I plot Supertrend in Pine Script?
//@version=5
indicator("Supertrend Example", overlay=true)
factor = input.float(3.0, title="Factor", minval=0.1, step=0.1)
atrPeriod = input.int(10, title="ATR Period", minval=1)
[supertrend, direction] = ta.supertrend(factor, atrPeriod)
upTrend = direction < 0 ? supertrend : na
downTrend = direction >= 0 ? supertrend : na
plot(upTrend, title="Up Trend", color=color.green, style=plot.style_linebr, linewidth=2)
plot(downTrend, title="Down Trend", color=color.red, style=plot.style_linebr, linewidth=2)Pine's ta.supertrend() returns both the line value and direction (negative = bullish, positive = bearish). Plotting bullish and bearish segments separately (with plot.style_linebr to break the line on flips) gives a clean visual: green when price is supported, red when resisted. Direction flips fire only on a confirmed close through the line — built-in confirmation, no extra logic needed.
Continue exploring
Related indicators
MACD
Moving Average Convergence Divergence
A trend-momentum indicator built from the difference between two EMAs, plus a signal line and histogram that visualise momentum shifts.
View MACDMomentumRSI
Relative Strength Index
A momentum oscillator that measures the speed and magnitude of recent price changes on a bounded 0–100 scale.
View RSIVolatilityBB
Bollinger Bands
A volatility envelope built from a moving average and ±2 standard deviations, expanding and contracting as volatility changes.
View BBAbout this reference
This page is an educational reference explaining what Supertrend is, how it is calculated, its default settings, and how to plot it in Pine Script. It is compiled from established trading literature and public technical documentation. Last review: .
Educational content. Not financial advice.