Lipi Reference Lipi

Functions

talib.supertrend()

Supertrend from a `multiplier` and an `atrLength`, calculated on the chart's own bars. `multiplier` accepts a float here, so a fractional setting is available — unlike the int multiplier that `talib.bb` and `talib.kc` take.

Syntax

                talib.supertrend(series float multiplier, series int atrLength) → [series float, series float]
              

Arguments

multiplier required series float The multiplier applied to the range measure. Int or float.
atrLength required series int Length used for the average true range.

Return Type

[series float, series float]

Example


          indicator("Supertrend", overlay=true)
atrLength = input(10, "ATR Length")
factor = input(3.0, "Multiplier")
[supertrend, direction] = talib.supertrend(factor, atrLength)
plot(supertrend, color=color.green, title="Supertrend")
bgcolor(direction == 1 ? color.green : color.red)