indicator · on price · open source
Ehlers Instantaneous Trendline indicator
Ehlers Instantaneous Trendline is a free open-source indicator by @deepwick. Ehlers Instantaneous Trendline (ITrend) — a low-lag trend line from a 3-pole IIR filter… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Ehlers Instantaneous Trendline does
Ehlers Instantaneous Trendline (ITrend) — a low-lag trend line from a 3-pole IIR filter; smoother than an EMA at the same length but adapts to volatility through alpha.
- Buy when price crosses above the trigger (the 2-bar-prior price projection).
- The line flips direction faster than a 50-EMA.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Ehlers Instantaneous Trendline", overlay=true)
alpha = input.float(0.07, "Alpha", minval=0.01, maxval=0.5, step=0.01)
colorLine = input.color("color.blue", "Color Line")
colorDown = input.color("color.red", "Color Down")
src = (high + low) / 2
price = (src + 2 * src[1] + 2 * src[2] + src[3]) / 6
var float iTrend = price
iTrend := (3 * alpha - 3 * alpha * alpha) * price + (3 * alpha * alpha - 6 * alpha * alpha * alpha + 3 * alpha * alpha * alpha) * price[1] + (3 * alpha * alpha * alpha) * price[2] + nz(iTrend[1], price)
trigger = 2 * price - price[2]
p_ITrend = plot(iTrend, "ITrend", color=colorLine, linewidth=2)
p_Trigger = plot(trigger, "Trigger", color=colorDown)
alertcondition(ta.crossover(close, iTrend), "Above ITrend", "Close crossed above the instantaneous trendline")
alertcondition(ta.crossunder(close, iTrend), "Below ITrend", "Close crossed below the instantaneous trendline")
No comments yet.
Sign in to comment.