indicator · on price · open source
Gann HiLo Activator
Running…
Loading chart…
About
Gann HiLo Activator switches its value between yesterday's low (uptrend) and yesterday's high (downtrend) based on where the SMA of close sits. A clean trailing-stop line.
- Long when the line is below price and the SMA is rising; short when above and falling.
- Used by Gann followers as both entry trigger and trailing exit.
- Pair with a longer-term trend filter for swing trades.
Source code
//@version=5
indicator("Gann HiLo Activator", overlay=true)
len = input.int(10, "SMA Length", minval=2)
sma = ta.sma(close, len)
hilo = close > sma ? low : high
hilo := close > sma[1] ? low : (close < sma[1] ? high : hilo[1])
p_HiLo_Activator = plot(hilo, "HiLo Activator", color=close > sma ? color.green : color.red, linewidth=2)
alertcondition(ta.crossover(close, hilo), "Price above HiLo", "Close crossed above the HiLo activator")
alertcondition(ta.crossunder(close, hilo), "Price below HiLo", "Close crossed below the HiLo activator")
No comments yet.
Sign in to comment.