All guides
Strategy10 min readUpdated

How a Supertrend intraday strategy works

A walkthrough of the Supertrend indicator — how the ATR-based bands are calculated, why the flip rule matters, how the strategy behaves in trends versus ranges, and the filters that make it usable.

Supertrend is one of the most widely used intraday indicators in India, largely because it produces an unambiguous signal — it is either long or short, with a visible line to trail a stop against. It is a reasonable teaching example precisely because its strengths and its failure mode are both easy to see.

The calculation

Supertrend is built on Average True Range, a measure of volatility. True Range for a bar is the largest of: the high-low range, the distance from the previous close to the high, and the distance from the previous close to the low. Including the previous close is what makes it account for gaps. ATR is then a moving average of that value, typically over 10 or 14 periods.

From ATR you construct two bands around the midpoint of each bar:

hl2 = (high + low) / 2
upper_basic = hl2 + multiplier * atr
lower_basic = hl2 - multiplier * atr

A multiplier of 3 with a 10-period ATR is the common default. Then comes the part that people skip when implementing it themselves, and it is the part that makes the indicator work: the bands ratchet. The upper band may only move down while price is below it, and the lower band may only move up while price is above it. Without that rule the bands simply oscillate with volatility and the indicator produces noise.

# The ratchet: bands tighten toward price but never loosen away from it
if upper_basic < prev_upper or prev_close > prev_upper:
    upper = upper_basic
else:
    upper = prev_upper

if lower_basic > prev_lower or prev_close < prev_lower:
    lower = lower_basic
else:
    lower = prev_lower

The trend flips when price closes across the active band. Below the upper band the indicator is bearish and the upper band is the trailing stop; above the lower band it is bullish and the lower band is the stop. The visible Supertrend line is just whichever band is currently active.

Why it works when it works

Because the bands are ATR-scaled, the stop distance adapts to conditions automatically. In a quiet market it sits close to price; when volatility expands it widens, which avoids being shaken out by the larger swings that accompany a genuine trend. That single property is most of the indicator's value — it is a volatility-adjusted trailing stop with an unambiguous entry rule attached.

Why it bleeds in a range

The failure mode is not subtle and is entirely predictable. In a sideways market price crosses the bands repeatedly, and each crossing generates a flip. Every flip is a trade. Every trade pays costs and gives up part of the spread. A ranging session can produce a long sequence of small losing trades, each individually reasonable, that together carve a meaningful hole in the account.

This is worth stating plainly because it explains why Supertrend backtests look so different depending on the period chosen. Tested across a trending stretch it looks excellent. Tested across a choppy one it looks broken. It is the same indicator; the market changed. Any honest evaluation has to span both.

The filters that make it usable

Practically nobody trades raw Supertrend flips. The standard approach is to add conditions that suppress trading in the environment where it is known to fail:

  • A trend filter — for example, only take long flips while price is above a longer-period moving average. This alone removes a large share of range-bound whipsaws.
  • A volatility floor — require ATR to be above some threshold, on the reasoning that very low volatility often precedes directionless drift.
  • Time-of-day rules — the first and last few minutes of an Indian session behave differently from the middle, and many intraday systems simply exclude them.
  • A daily trade cap — a hard ceiling on flips per day bounds the damage on the worst kind of session.

Each filter reduces the number of trades, and each also reduces the number of good ones. That trade-off is the actual design work, and it is where a backtest with realistic costs earns its keep. It is also worth remembering that adding filters means adding parameters, which makes overfitting easier — a system with four filters tuned on one year of data deserves considerably more scepticism than one with none.

The wider point

Supertrend is a reasonable trailing-stop mechanism wrapped around a simple entry rule. It is not an edge on its own, and no indicator is. What determines whether a system built on it makes money is the surrounding structure — position sizing, the filter set, cost assumptions, and the discipline to keep running it through the drawdowns the design implies. The indicator is the easy part, and it is the part everyone spends their time on.

What we build

Continue reading

Want a system built around your strategy?

We build and run trading automation in production. Tell us your rules and we will automate, test, and run them.

Start a Conversation