SuperTrend

supertrendtrendForge API 1

Trend-following line built from the average true range.

Inputs

NameTypeDefaultRange
atr_periodint101 to 500
factorfloat30.1 to 20

Outputs

NameTypeRequiredDescription
supertrendvalueOptionalcolor theme.accent, color_down theme.down, color_up theme.up, style line, width 1
directionvalueOptionalcolor theme.accent, style line, width 1
Warm-up
atr_period - 1 bars (9 at the defaults)
Repaints
No
Parity
None

Formula

upper = (high + low) / 2 + factor * ATR, lower = (high + low) / 2 - factor * ATR

Each band only moves toward price, unless the previous close crossed it.

The line is the lower band while the trend is up and the upper band while it is down. direction is 1 up and -1 down. ATR is Wilder's average true range.