Skip to content
StatePath
Tool Atlasmarket.supertrend

Tool

Supertrend

market.supertrend

MarketTrend

Inputs

No typed inputs.

Outputs

Bundle (untagged)

A bundle: supertrend (the trailing stop price level) and direction (+1 up, -1 down).

Supertrend is a trailing stop drawn from volatility: a line that hugs price from below in uptrends and from above in downtrends, flipping sides when price closes through it. It answers two questions at once - which way is the trend, and where is the stop.

Supertrend overview diagramST

How it works

Two basic bands are drawn at hl2 +/- multiplier x ATR(period). The running upper band may only move down, the lower band only up (each resets when price closes beyond the previous band), which makes the active band a ratchet. While price holds above the lower band the tool reports direction +1 and the line sits below price; a close through the line flips it to the other band and direction to -1.

Configuration

periodscalar

ATR length that sets how much room the bands get (classic 10).

period diagram
multiplierscalar

How many ATRs of distance the bands keep from hl2 (classic 3.0). Bigger = fewer, later flips.

Connects to

Feeds into

Examples

  • Regime gate: only allow long entries while direction is +1.
  • Stop placement: wire supertrend (via math.last) into an ORDER_EXIT stop-loss so the stop trails the trend.

Common mistakes

  • In sideways chop the line flips constantly - Supertrend is a trend tool, pair it with a range filter.
  • The line is causal but the flip confirms on close; intrabar touches that recover do not flip it.

See also