indicator · on price · open source

Supertrend Multi-Timeframe

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Two stacked Supertrends with different factors and lookbacks — the fast one for entries, the slow one for the regime filter.

  • Only trade in the direction of the slow Supertrend.
  • Fast Supertrend flips inside the slow Supertrend = high-probability pullback entries.
  • Four lines on the chart: fast up/down (green/red) and slow up/down (teal/orange).

Source code

//@version=5
indicator("Supertrend Multi-Timeframe", overlay=true)
atrLen1 = input.int(10, "Fast ATR Length", minval=1)
factor1 = input.float(2, "Fast Factor", minval=0.5, step=0.1)
atrLen2 = input.int(20, "Slow ATR Length", minval=1)
factor2 = input.float(4, "Slow Factor", minval=0.5, step=0.1)
[s1, d1] = ta.supertrend(factor1, atrLen1)
[s2, d2] = ta.supertrend(factor2, atrLen2)
up1 = d1 < 0
up2 = d2 < 0
p_Fast_Up = plot(up1 ? s1 : na, "Fast Up", color=color.green, style=plot.style_linebr, linewidth=2)
p_Fast_Down = plot(up1 ? na : s1, "Fast Down", color=color.red, style=plot.style_linebr, linewidth=2)
p_Slow_Up = plot(up2 ? s2 : na, "Slow Up", color=color.teal, style=plot.style_linebr, linewidth=3)
p_Slow_Down = plot(up2 ? na : s2, "Slow Down", color=color.orange, style=plot.style_linebr, linewidth=3)
alertcondition(up1 and not up1[1] and up2, "Fast long in slow uptrend", "Fast Supertrend flipped long inside a slow uptrend")
alertcondition(not up1 and up1[1] and not up2, "Fast short in slow downtrend", "Fast Supertrend flipped short inside a slow downtrend")

Comments

No comments yet.

Sign in to comment.