Indicators · Trend

Supertrend

The Supertrend is a trailing stop that follows the trend: in an uptrend it sits a multiple of the ATR below the price and only rises; when price closes below it, it flips above the price and starts following the downtrend.

What it's for
  • Follow a trend with a trailing stop based on the ATR.
  • Get a simple trend filter: a green line below price in uptrends, a red line above price in downtrends.
Plus and Pro toolTry it in Analyze
Pane
On the price chart
Plan
Plus and Pro
Settings
ATR length, factor
Default
10, 3

Calculation

basic upper = (high + low) / 2 + factor × ATR(10)
basic lower = (high + low) / 2 − factor × ATR(10)
the lower band can only rise while price stays above it; the upper band can only fall while price stays below it
uptrend: line = lower band, until a close below it → downtrend: line = upper band

Oyticker's implementation follows TradingView's ta.supertrend line by line. The green line is drawn in an uptrend, the red one in a downtrend.

How to read it

Supertrend green line trailing an advance, then a flip to the red line after the top
During the advance the green line trails below the price and only rises. After the top, a close below it flips the indicator: the red line now trails above the price.
  • As a trailing stop, the line is where a trend-follower would exit.
  • As a trend filter, only trades in the direction of the current color are taken.
  • A larger factor gives fewer flips and later exits; a smaller one reacts faster and flips more often.

Case study: whipsaws in a range

Supertrend flipping repeatedly in a sideways market
In a sideways market the indicator flips at almost every swing, each time near the wrong extreme: the cost of following a trend that does not exist.

Combine it with a regime filter (a flat moving average, a narrow Bollinger Band width, or a trend-strength measure written as a custom indicator) to stand aside in ranges.

Charts in this guide use simulated prices generated for illustration; levels and outcomes shown are examples, not observations of a real market. Educational content only, not investment advice.

Supertrend indicator: ATR bands, trailing stop and trend flips | Oyticker