Reflex and Trendflex indicators - John F. Ehlers

Category: Indicators By: Nicolas Created: January 14, 2020, 10:46 AM
January 14, 2020, 10:46 AM
Indicators
6 Comments

John Ehlers introduces a new averaging indicator in his new article “Reflex: A New Zero-Lag Indicator” in the February 2020 issue of TASC magazine. J.Ehlers has designed it with reducing lag in mind.

According to the author, this new indicator can be used to generate signals in a more timely manner than other lagging calculations. In this new article John Ehlers propose 2 new zerolag indicators: The Reflex indicator which synchronizes with the cycle component in the price data. The second, its “companion”, the Trendflex oscillator retains the trend component.

Using both of them in the same window, like I did in the attached picture, give a perfect picture of what Ehlers have in mind to mark the trend (Trendflex oscillator) and its market cycles (Reflex oscillator).

//PRC_Reflex Ehlers | indicator
//14.01.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

// --- settings
Length=20
// --- end of settings

if barindex>Length then
//Gently smooth the data in a SuperSmoother
a1 = exp(-1.414*3.14159 / (.5*Length))
b1 = 2*a1*Cos(1.414*180 / (.5*Length))
c2 = b1
c3 = -a1*a1
c1 = 1 - c2 - c3
Filt = c1*(Close + Close[1]) / 2 + c2*Filt[1] + c3*Filt[2]

//Length is assumed cycle period
Slope = (Filt[Length] - Filt) / Length

//Sum the differences
Sum = 0
For count = 1 to Length
Sum = Sum + (Filt + count*Slope) - Filt[count]
next
Sum = Sum / Length

//Normalize in terms of Standard Deviations
MS = .04*Sum*Sum + .96*MS[1]
If MS <> 0 Then
Reflex = Sum / SQRT(MS)
endif
endif

return Reflex
//PRC_Trendflex Ehlers | indicator
//14.01.2020
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

// --- settings
Length=20
// --- end of settings

if barindex>Length then
//Gently smooth the data in a SuperSmoother
a1 = exp(-1.414*3.14159 / (.5*Length))
b1 = 2*a1*Cos(1.414*180 / (.5*Length))
c2 = b1
c3 = -a1*a1
c1 = 1 - c2 - c3
Filt = c1*(Close + Close[1]) / 2 + c2*Filt[1] + c3*Filt[2]

//Sum the differences
Sum = 0
For count = 1 to Length
Sum = Sum + Filt - Filt[count]
next
Sum = Sum / Length

//Normalize in terms of Standard Deviations
MS = .04*Sum*Sum + .96*MS[1]
If MS <> 0 Then
Reflex = Sum / SQRT(MS)
endif
endif

return Reflex

 

Download
Filename: PRC_Reflex-Ehlers.itf
Downloads: 384
Download
Filename: PRC_Trendflex-Ehlers.itf
Downloads: 404
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...