Going to try using it in combination with the ECO indicator.
study(title="HiLo Activator", overlay=true) length = input(3, minval=1) displace = input(0, minval=0) highsma = sma(high, length) lowsma = sma(low, length) swing = iff(close > highsma[displace], 1, iff(close < lowsma[displace], -1, 0)) mah = highest(high, length) mal = lowest(low, length) stop = iff(swing==1, mal, iff(swing==-1, mah, stop[1])) linecolor = iff(stop < low, green, red) plot(stop, style=line, linewidth=2, color=linecolor)