How it works
Supertrend draws one line that sits below price in an uptrend and above price in a downtrend, flipping sides when price closes through it. Its distance from price is not fixed — it is a multiple of the average true range, so the line stands further away when the market is volatile and tightens when it is calm. That single design choice is what makes it useful: it adapts its tolerance for noise to the instrument and the moment, instead of using a percentage that is too tight for crude oil and too wide for a bond future.
The mechanism that keeps it stable is a ratchet. Bands are first computed around the bar midpoint, then constrained: while the market is trending up, the lower band is only ever allowed to rise or hold, never to fall back. It follows price up and refuses to give ground, so ordinary pullbacks do not reset it. Only a close on the wrong side of the active band flips the trend, at which point the opposite band takes over and the ratchet runs in the other direction.
Traders use it in three ways. As a regime filter it answers the up-or-down question cleanly enough to gate other rules. As a trailing stop it gives a mechanical, volatility-aware exit that most people find easier to follow than a discretionary one. And as a signal generator it produces a flip on every trend change — which is exactly where it disappoints, because a market that alternates around a single line will flip repeatedly and each flip is a full reversal.
Compared with Parabolic SAR, which also flips sides, Supertrend is calmer: SAR accelerates toward price and forces an exit on any pause, while Supertrend only moves when volatility or a new extreme justifies it. Compared with a moving average, it has a defined stop level rather than a fuzzy zone. What it does not have is any measure of trend strength — ADX or a ribbon is the natural companion, because Supertrend will confidently report a trend in a market that has none.
Calculation
The arithmetic in words, in the order it happens.
Compute ATR over the chosen period. For each bar the raw upper band is the midpoint of high and low plus the multiplier times ATR, and the raw lower band is that midpoint minus the same amount. The bands are then made monotonic: the final upper band is the lesser of the raw upper band and the previous final upper band, unless the previous close was above the previous final upper band, in which case it resets to the raw value; the final lower band follows the mirror rule using the greater value. The trend is up while the close is above the active upper band and down while it is below the active lower band, and the plotted Supertrend line is the final lower band during an uptrend and the final upper band during a downtrend.
Source
An AlgoBeamScript implementation of the formula above, written by us from the arithmetic so the code and the calculation agree line for line.
Runs unchanged on the platform and in the AlgoBeamTS runtime. The language reference is in the documentation.
Inputs
Defaults are the values most charting packages ship with. They are conventions, not optimal settings — the right length depends on your instrument and your holding period.
| Input | Default | What it changes |
|---|---|---|
| ATR length | 10 | How many bars feed the volatility estimate. Shorter lengths let the band react quickly to a change in volatility and therefore flip sooner; longer lengths give a steadier band that ignores single wild sessions. |
| Multiplier | 3 | How many ATRs the band sits from the midpoint, and the single most important setting. Below about 2 the line flips constantly; above 4 it survives deep pullbacks but gives back a large share of the move before signalling a change. |
| Change ATR calculation method | On | Selects whether ATR uses Wilder’s smoothing or a plain average of true range. Wilder’s is slower and produces fewer flips; the simple average reacts to a volatility spike within a bar or two. |
How to read it
What practitioners take from the plot. Read these as descriptions of market state, not as entry signals.
- Line below price, coloured up
- Uptrend by this definition, with the line marking the price at which that call would be abandoned. Useful as a permission state for long entries taken elsewhere.
- Flip from below price to above
- A close has broken the trailing band. A genuine change of state, but on its own a late and often expensive entry into the opposite direction.
- Line tracking price closely and tightening
- Volatility is contracting while the trend continues. The stop is drawing in, which raises the odds of being taken out by ordinary noise on the next expansion.
- Repeated flips within a handful of bars
- A range, not a trend. Supertrend has no way to report the absence of a trend, so this pattern is the only warning it gives.
- Wide gap between price and the line
- Either a strong trend that has run far from its stop, or a recent volatility spike that pushed the band out. Check ATR before assuming it is strength.
Limitations
Where this indicator misleads. None of these are fixed by a better parameter.
- It always reports a trend. There is no neutral state, so in a sideways market it will alternate long and short and lose on both sides.
- Every flip is a full reversal signal, which makes the raw indicator an aggressive system; most users need an additional filter that simply refuses to trade when trend strength is low.
- The band widens after volatility has already arrived, because ATR is backward-looking. A gap or a shock event therefore both triggers the flip and simultaneously moves the new stop far away.
- Results depend heavily on the multiplier, and it is easy to fit that number to past data. The setting that would have survived last year’s pullbacks is not necessarily the one that survives next year’s.
Educational reference. This page explains how an indicator is built and how it is commonly read. It is not investment advice, not a recommendation and not a signal service. No indicator is profitable on its own — each is a way of describing a market, and any rule built on one has to be tested with realistic costs before it is traded.