Supertrend Indicator: ATR-Based Trend Following and Trailing Stops
How the Supertrend indicator is calculated from ATR bands, how it flips direction, and how trading bots use it as a trend filter and trailing stop - with its weaknesses in ranges.
Supertrend is a trend-following overlay that sits below price in uptrends and above price in downtrends, flipping sides when price closes through it. It is built from ATR, so its distance from price adapts to volatility. Its simplicity makes it popular for trading bots - both as a trend filter and as a trailing stop.
How Supertrend is calculated
For each bar:
- Mid price = (high + low) / 2.
- Basic upper band = mid + multiplier × ATR(n).
- Basic lower band = mid − multiplier × ATR(n).
- Final bands only move in the trend’s favour: in an uptrend, the lower band can rise but not fall; in a downtrend, the upper band can fall but not rise.
- Direction flips to down when the close falls below the final lower band, and to up when the close rises above the final upper band.
Supertrend shows the active band: the lower band during uptrends, the upper band during downtrends.
How to read it
- Line below price, usually coloured green - uptrend; above price - downtrend.
- Flip - trend change signal.
- Distance from price - wider in volatile markets.
- Flat line - price has pulled back without breaking it; the trend is intact.
How bots use Supertrend
Trend filter
Allow only longs when Supertrend is up, only shorts when it is down. Combine with a separate entry trigger, such as a pullback or breakout.
Trailing stop
For a long position, set the stop at the Supertrend line and move it as the line rises. It behaves like an ATR trailing stop that never moves against the trade. Compare with the Chandelier Exit and trailing stop strategies.
Stop-and-reverse system
The simplest version: always in the market, long after an up flip, short after a down flip. Easy to backtest, but very sensitive to ranges.
A worked example
Gold H1, Supertrend(10, 3):
- Filter: H4 Supertrend up.
- Entry: H1 Supertrend flips up while the H4 filter is up.
- Stop: H1 Supertrend line.
- Exit: H1 flip down, or trailing along the line.
The higher-timeframe filter removes many counter-trend flips; the H1 line provides both entry timing and the stop. See multi-timeframe confirmation.
Weaknesses
- Ranges. In sideways markets Supertrend flips repeatedly, each flip costing a small loss plus spread.
- Late entries and exits. It is a trend follower; it gives back part of each move before flipping.
- Gaps. A weekend gap can jump straight through the line, filling the stop far away.
- Parameter sensitivity. Multipliers between 2 and 4 change behaviour substantially; choose from a stable range.
Related tools
Several trend-cloud and trailing indicators build on the same ATR idea with extra smoothing or adaptive logic. AlgoXP’s Argo Smart Trail is an adaptive ATR trail, and Hera Trend Cloud combines adaptive volatility with trend strength into a cloud.
Key takeaways
- Supertrend is an ATR band that follows the trend and flips on closes through it.
- Use it as a trend filter or trailing stop rather than a stand-alone signal in all conditions.
- Act on closed bars; the forming bar can flip back and forth.
- Expect whipsaws in ranges and filter for regime.
FAQ
What are common Supertrend settings?
Popular defaults are an ATR period of 10 with a multiplier of 3. Smaller multipliers flip more often; larger ones stay with the trend longer but give back more on reversals.
Does Supertrend repaint?
On a closed bar it does not. On the forming bar the line can flip back and forth as price moves, so bots should act on closed-bar values.
Is Supertrend a complete strategy?
It can be a simple always-in-the-market trend system, but in ranges it produces many small losses. A regime filter or a separate entry condition usually improves it.
Sources and further reading
- StockCharts ChartSchool: Average True Range (ATR) - chartschool.stockcharts.com
- StockCharts ChartSchool: Chandelier Exit - chartschool.stockcharts.com