
The ratcheting ATR-based trend follower — one of the most popular indicators on TradingView. Dynamic stop levels that lock in as the trend confirms.
Supertrend is a hybrid trend-following / volatility indicator that wraps the price with an ATR-based stop line. The stop ratchets — it only moves in the direction of the trend, never against it — until the price crosses through, at which point the line flips to the opposite side.
Construction (per candle):
hl2 = (high + low) / 2
atr = ATR(period) — Wilder smoothing by default
upperBand = hl2 + multiplier × atr
lowerBand = hl2 - multiplier × atr
The two raw bands are then turned into final bands with a ratcheting rule:
finalUpper only ratchets down (gets tighter to price) when the previous close was below the previous finalUpper. Otherwise it stays where it was.finalLower only ratchets up when the previous close was above the previous finalLower.This means: once you're in an uptrend, the lower band (your stop) only ever rises toward your price — it never gives up gained ground. Same for downtrends with the upper band.
Trend direction:
close > prevFinalUpper → trend is up (the active line is finalLower acting as a trailing stop)close < prevFinalLower → trend is down (the active line is finalUpper)Signals:
Default params 10/3.0/wilders are the textbook values from the original Olivier Seban formulation. Larger multiplier = wider bands = fewer trades = larger drawdown tolerance. Smaller multiplier = tighter bands = more trades = more whipsaws.
Two ATR methods:
wilders (default): classic ATR with Wilder smoothing — slower, more stabletrue_range (EMA-variant): faster reaction to volatility changes, more sensitiveThe wilders variant matches the standard Supertrend implementation on TradingView; the EMA-variant is provided for traders who want a more reactive version.
| Name | Default | Range | Description |
|---|---|---|---|
| ATR Period | 10 | 2–100 | Number of candles for the ATR calculation. Default 10 — Olivier Seban's original value, slightly faster than the 14 used elsewhere. |
| Multiplier | 3 | 0.5–10 | ATR multiplier for band width. Larger = wider bands = fewer trades but more drawdown tolerance. Smaller = tighter bands = more trades but more whipsaws. |
The pre-baked mini-backtest is refreshed daily — check back soon or start a live run in the Arena.
Run in Arena →// Indicators
hl2 = (high + low) / 2
atr = ATR(period) // Wilder smoothing
upperBand = hl2 + multiplier * atr
lowerBand = hl2 - multiplier * atr
// Ratchet logic
finalUpper[i] = (close[i-1] <= finalUpper[i-1]) ? min(upperBand[i], finalUpper[i-1]) : upperBand[i]
finalLower[i] = (close[i-1] >= finalLower[i-1]) ? max(lowerBand[i], finalLower[i-1]) : lowerBand[i]
// Direction
if close[i] > finalUpper[i-1]: dir[i] = 'up'
else if close[i] < finalLower[i-1]: dir[i] = 'down'
else: dir[i] = dir[i-1]
// Signals
if dir[i-1] == 'down' and dir[i] == 'up' and position.is_flat:
BUY
if dir[i-1] == 'up' and dir[i] == 'down' and position.is_long:
SELLBoth use ATR-based bands around price. Keltner places bands at a fixed distance from a moving average and signals a breakout when the close crosses the upper band. **Supertrend ratchets** — the active stop line only ever moves with the trend, locking in gains. When you're long with Supertrend, the lower band (your stop) creeps up toward your price as the uptrend continues — never falls back. Keltner doesn't do that; its bands move freely with the moving average. Net effect: Supertrend often gives back less on rapid reversals (because the trailing stop has tightened during the up move), but enters later (because the flip requires the price to cross the previous ratcheted upper band, not just any upper band).
**Wilders** (default) matches the original Supertrend formula and what 99% of TradingView indicators show. Use it if you want to backtest against what other traders see on their charts. **True Range (EMA)** reacts faster to volatility changes — useful if you're explicitly testing a 'more sensitive' variant. In our daily-snapshot pipeline we only run the Wilders default, so that's the comparison reference.
Three reasons. **First**, it's visually beautiful — a single colored line that flips from green to red and back. No oscillator, no histogram, no overlay zoo. Just one line. **Second**, the ratchet logic feels intuitive — most traders understand 'the stop moves with the trend' immediately. **Third**, default 10/3 works passably-well on many markets without tuning, which means new traders try it, see something that works, and recommend it. Search volume for 'Supertrend backtest' is high, but most online sources give you a chart screenshot without rigorous testing. We give you the actual backtest engine.
EMA mid-line plus ATR-scaled bands — breakout above the upper band signals real momentum, mid-line exit catches reversals early. ATR-adaptive trend following.
The configurable trend-switcher — two exponential moving averages cross, and the trade direction flips. Faster than Golden Cross, simpler than EMA Trend Bias.
Two EMAs plus an ATR-based neutral zone — like the commercial Larsson Line, but tunable, transparent, and backtested. Choose your bias.
Check out our Strategy Insights Reports — pre-baked deep-dives with historical results, comparisons, and market context.