TradingView
DasanC
Feb 26, 2019 11:12 PM

Instantaneous Trend [Ehlers] 

Gold / U.S. DollarFOREX.com

Description

A low lag, trend follower for higher timeframes.
This works great as a tool to filter trades from oscillators or to provide a general trend direction.

You can also trade off the color changes, though I must recommend using timeframes higher than 1H.

-DasanC
Comments
alexdotleo
Hi! Does this repaint?
sunk_manitu
Hello, I try to convert your script to version 4 but have an effor for n being unidentified (in " if(n < 7)"). I do not see it declared in your code. Could you please tell us what n stands for?
badneo
@dalescher, try replacing "n" with bar_index (tradingview.com/pine-script-reference/v4/
DasanC
@dalescher, @badneo's reply is correct. In version 4, they removed the 'n' variable which is used to reference the current bar number.
More