Instantaneous Trendline Indicator: Ehlers, Alpha 0.07

Written by Dominic Walsh · Published · Last updated

The instantaneous trendline indicator uses a filter John Ehlers designed to cut lag. It runs on median price rather than the close. A short average of the result becomes the signal line, and the two crossing is what earns a mark.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 4: ITrend, Signal, BUY, SELL
Alerts popup, push notification, email, sound
Inputs 8

What the Instantaneous TrendLine Indicator draws on the chart

A dodger blue `ITrend` line carries the filter output.

An orange `Signal` line averages it over `SignalSmoothing` `3` bars.

`BUY` uses arrow 233 and `SELL` uses 234 at each crossing.

Both lines sit on price, so no extra pane opens.

  • ITrend: line, dodger blue, width 2
  • Signal: line, orange, width 1
  • BUY: arrow, lime, width 2, arrow code 233
  • SELL: arrow, red, width 2, arrow code 234
Instantaneous trendline indicator filter line, signal line and arrows on EURUSD H1.
Instantaneous trendline indicator filter line, signal line and arrows on EURUSD H1.

How the Instantaneous TrendLine Indicator calculates its values

Median price feeds it

Each bar contributes its high plus low over two. Using the midpoint rather than the close makes the input steadier before any filtering happens.

The Ehlers recursion

`Alpha` `0.07` sets six coefficients that weight the last four midpoints and the last two outputs. That recursion is the whole filter, and it is what buys the reduced lag the name refers to.

Warm-up uses a plain average

The recursion needs two earlier outputs before it can run. So the first bars fall back to a weighted mean of four midpoints. That keeps the line from starting on a wild value.

How to read the signals

The blue line turns earlier than a simple average of the same length.

The orange line lags it deliberately, which is what creates the crossing.

A lower `Alpha` gives a smoother line that turns later.

Marks sit twenty points from the candle, a fixed gap rather than a scaled one.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` governs four routes and ships true, with `EnablePopup` handling the terminal box. Switch `EnablePushNotify` for a phone, `EnableEmail` for mail, or `EnableSound` to play `SoundFile`. Those three arrive off. One message per closed bar.

Every Instantaneous TrendLine Indicator input

Core settings

Setting What it does Default
Alpha Ehlers alpha (0.05-0.15 typical). Filter coefficient, typically between 0.05 and 0.15, default `0.07`. 0.07
SignalSmoothing SMA bars for signal line. Bars in the average that forms the signal line, default `3`. 3

Alert settings

Setting What it does Default
EnableAlerts Governs the four delivery routes, default `true`. on
EnablePopup Message box in the terminal, default `true`. on
EnablePushNotify Alert forwarded to a phone, default `false`. off
EnableEmail Alert sent as mail, default `false`. off
EnableSound Alert played as a clip, default `false`. off
SoundFile Which clip that is, default `”alert.wav”`. alert.wav
Instantaneous trendline indicator inputs panel showing Alpha and SignalSmoothing.
Instantaneous trendline indicator inputs panel showing Alpha and SignalSmoothing.

Settings that fit your chart

A low-lag filter suits charts with real swings. EURUSD H1 is the reference chart, where `Alpha` `0.07` gives a line that turns within a few bars. On M1 it still reacts to noise. H4 and daily produce a very clean line.

When the Instantaneous TrendLine Indicator fails

Reduced lag is not zero lag, so a turn still confirms after the fact.

A recursive filter can overshoot after a sharp move and take bars to settle.

`Alpha` `0.07` sits at the smooth end of the useful range, so marks are infrequent.

Copy the compiled Instantaneous TrendLine Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Instantaneous TrendLine Indicator: Derivatives market on Wikipedia, Backtesting at Investopedia.

Download the Instantaneous TrendLine Indicator for MT4 and MT5

The zip holds the compiled Instantaneous TrendLine Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does Alpha 0.07 change?

How heavily the filter weights recent bars against its own past output. Lower values give a smoother, later line. The source comment puts the useful band between 0.05 and 0.15, so 0.07 sits at the smooth end.

Why does ITrend use median price?

The midpoint of high and low is steadier than the close, which can sit anywhere in the bar. Feeding the filter a calmer input means less of its work goes into removing noise that need not be there.

What does SignalSmoothing 3 create?

The orange line, a three-bar average of the filter output. It exists purely so there is something for the blue line to cross. Lengthening it delays every mark and reduces how many appear.

Is the line really instantaneous?

No, and the name oversells it. Ehlers designed the filter to cut lag rather than remove it, so a turn still confirms a bar or two late. Treat the reduced lag as a real but limited advantage.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Instantaneous TrendLine Indicator as one input. Always backtest before trading live.

Category: this is part of our Trend collection. Also, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment