Page 58 of 90

Re: Ehlers Indicators for MT4

Posted: Sun Dec 11, 2022 1:05 am
by vvFish
FLINNS wrote: Sun Dec 11, 2022 12:21 am Hey vvFish. Very interesting combination of lower indicators, could you share this template please.
:think:
;) All indicators are on this site, try to make your own template.
You will like it.

Re: Ehlers Indicators for MT4

Posted: Sun Dec 11, 2022 2:09 am
by FLINNS
vvFish wrote: Sun Dec 11, 2022 1:05 am :think:
;)
Image


All indicators are on this site, try to make your own template.
You will like it.
Thanks. I will try.

Re: Ehlers Indicators for MT4

Posted: Wed Dec 14, 2022 1:47 am
by Wolfgang
mrtools wrote: Sat Dec 10, 2022 4:37 am Ehlers Fisher Transform Histogram with Jurik Smoothing & Slope Coloring options

Added the alerts and eft line slope coloring. Also, you can choose to use the histo or colored line and or the signal line. Tested the button seems to work fine for me but updated it a little bit.
Image
Thank you very much, an optimal indicator!

Re: Ehlers Indicators for MT4

Posted: Sun Dec 25, 2022 5:06 pm
by scarletPip
ionone wrote: Sat Jun 11, 2022 10:44 pm but here is the Modified RSI from Ehlers
Thanks for this. Does anyone know where I can find the modified Stochastic indicator by Ehlers from his classic 'Cycle Analytics'? For MT4 preferably?

This is the EasyLanguage code snippet he provides in Chapter 7.

Code: Select all

{
    Modified Stochastic Indicator
    © 2013 John F. Ehlers
}
Inputs:
	Length(20);
Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    HighestC(0),
    LowestC(0),
    count(0),
    Stoc(0),
    MyStochastic(0);
//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2];
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / 10);
b1 = 2*a1*Cosine(1.414*180 / 10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];
HighestC = Filt;
LowestC = Filt;
For count = 0 to Length - 1 Begin
    If Filt[count] > HighestC then HighestC = Filt[count];
    If Filt[count] < LowestC then LowestC = Filt[count];
End;
Stoc = (Filt - LowestC) / (HighestC - LowestC);
MyStochastic = c1*(Stoc + Stoc[1]) / 2 + c2*MyStochastic[1] + c3*MyStochastic[2];
Plot1(MyStochastic);


Re: Ehlers Indicators for MT4

Posted: Sun Dec 25, 2022 6:26 pm
by mrtools
scarletPip wrote: Sun Dec 25, 2022 5:06 pm Thanks for this. Does anyone know where I can find the modified Stochastic indicator by Ehlers from his classic 'Cycle Analytics'? For MT4 preferably?

This is the EasyLanguage code snippet he provides in Chapter 7.

Code: Select all

{
    Modified Stochastic Indicator
    © 2013 John F. Ehlers
}
Inputs:
	Length(20);
Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    HighestC(0),
    LowestC(0),
    count(0),
    Stoc(0),
    MyStochastic(0);
//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2];
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / 10);
b1 = 2*a1*Cosine(1.414*180 / 10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];
HighestC = Filt;
LowestC = Filt;
For count = 0 to Length - 1 Begin
    If Filt[count] > HighestC then HighestC = Filt[count];
    If Filt[count] < LowestC then LowestC = Filt[count];
End;
Stoc = (Filt - LowestC) / (HighestC - LowestC);
MyStochastic = c1*(Stoc + Stoc[1]) / 2 + c2*MyStochastic[1] + c3*MyStochastic[2];
Plot1(MyStochastic);

Sounds like this version by Mladen, I just made it new mt4 compatible.

ps) added a version where you can add or use less smoothing.

Re: Ehlers Indicators for MT4

Posted: Thu Dec 29, 2022 11:44 pm
by ionone
scarletPip wrote: Sun Dec 25, 2022 5:06 pm Thanks for this. Does anyone know where I can find the modified Stochastic indicator by Ehlers from his classic 'Cycle Analytics'? For MT4 preferably?

This is the EasyLanguage code snippet he provides in Chapter 7.

Code: Select all

{
    Modified Stochastic Indicator
    © 2013 John F. Ehlers
}
Inputs:
	Length(20);
Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    HighestC(0),
    LowestC(0),
    count(0),
    Stoc(0),
    MyStochastic(0);
//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2];
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / 10);
b1 = 2*a1*Cosine(1.414*180 / 10);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];
HighestC = Filt;
LowestC = Filt;
For count = 0 to Length - 1 Begin
    If Filt[count] > HighestC then HighestC = Filt[count];
    If Filt[count] < LowestC then LowestC = Filt[count];
End;
Stoc = (Filt - LowestC) / (HighestC - LowestC);
MyStochastic = c1*(Stoc + Stoc[1]) / 2 + c2*MyStochastic[1] + c3*MyStochastic[2];
Plot1(MyStochastic);

just saw MrTools post from Mladen
my version has a tunable alpha1 parameter. Not sure if it's better though

Re: Ehlers Indicators for MT4

Posted: Sat Dec 31, 2022 10:30 am
by scarletPip
Thanks everyone. I hate to get greedy but I'm wondering if anyone has seen a 'Hurst Coefficient' indicator for MT4? I think this is often mixed up with the 'Hurst Exponent' but possibly they are the same thing?
Again, this is the code given by Ehlers.

Code: Select all

{
    Hurst Coefficient
    © 2013 John F. Ehlers
}
Inputs:
    Length(30); {Length must be an even number}
Vars:
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    count(0),
    N1(0),
    N2(0),
    N3(0),
    HH(0),
    LL(0),
    Dimen(0),
    Hurst(0),
    SmoothHurst(0);
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / 20);
b1 = 2*a1*Cosine(1.414*180 / 20);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
N3 = (Highest(Close, Length) - Lowest(Close, Length)) / Length;
HH = Close;
LL = Close;
For count = 0 to Length / 2 - 1 begin
    If Close[count] > HH then HH = Close[count];
    If Close[count] < LL then LL = Close[count];
End;
N1 = (HH - LL) / (Length / 2);
HH = Close[Length / 2];
LL = Close[Length / 2];
For count = Length / 2 to Length - 1 begin
    If Close[count] > HH then HH = Close[count];
    If Close[count] < LL then LL = Close[count];
End;
N2 = (HH - LL)/(Length / 2);
If N1 > 0 and N2 > 0 and N3 > 0 then Dimen = .5*((Log(N1 + N2) - Log(N3)) / Log(2) + Dimen[1]);
Hurst = 2 - Dimen;
SmoothHurst = c1*(Hurst + Hurst[1]) / 2 + c2*SmoothHurst[1] + c3*SmoothHurst[2];
Plot1(SmoothHurst);

Re: Ehlers Indicators for MT4

Posted: Sat Dec 31, 2022 12:16 pm
by scarletPip
As long as I'm begging, I may as well ask for this too. It seems there are several 'sinewave' indicators but none of them have the name 'Even Better Sinewave'. Of course it may not actually be as good as the ones already here but that's the point of testing.

Code: Select all

{
    Even Better Sinewave Indicator
    © 2013 John F. Ehlers

}

Inputs:
    Duration(40);

Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    count(0),
    Wave(0),
    Pwr(0);

//HighPass filter cyclic components whose periods are shorter than Duration input

alpha1 = (1 - Sine (360 / Duration)) / Cosine(360 / Duration);

HP = .5*(1 + alpha1)*(Close - Close[1]) + alpha1*HP[1];

//Smooth with a Super Smoother Filter from equation 3-3

a1 = expvalue(-1.414*3.14159 / 10);

b1 = 2*a1*Cosine(1.414*180 / 10);

c2 = b1;

c3 = -a1*a1;

c1 = 1 - c2 - c3;

Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];

//3 Bar average of Wave amplitude and power

Wave = (Filt + Filt[1] + Filt[2]) / 3;

Pwr = (Filt*Filt + Filt[1]*Filt[1] + Filt[2]*Filt[2]) / 3;

//Normalize the Average Wave to Square Root of the Average Power

Wave = Wave / SquareRoot(Pwr);

Plot1(Wave);
    

Re: Ehlers Indicators for MT4

Posted: Sat Dec 31, 2022 12:17 pm
by scarletPip
And the Hilbert Transformer. Not found on this site.

Code: Select all

{
    Hilbert Transformer Indicator
    © 2013 John F. Ehlers
}

Inputs:
    LPPeriod(20);

Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    QFilt(0),
    Real(0),
    Quadrature(0),
    IPeak(0),
    QPeak(0),
    Imag(0);

//Highpass filter cyclic components whose periods are shorter than 48 bars

alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);

HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2];

//Smooth with a Super Smoother Filter from equation 3-3

a1 = expvalue(-1.414*3.14159 / LPPeriod);

b1 = 2*a1*Cosine(1.414*180 / LPPeriod);

c2 = b1;
c3 = -a1*a1;

c1 = 1 - c2 - c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];

IPeak = .991*IPeak[1];

If Absvalue(Filt) > IPeak Then IPeak = AbsValue(Filt);
Real = Filt / IPeak;

Quadrature = (Real - Real[1]);

QPeak = .991*QPeak[1];

If Absvalue(Quadrature) > QPeak Then QPeak = AbsValue(Quadrature);
Quadrature = Quadrature /QPeak;

a1 = expvalue(-1.414*3.14159 / 10);

b1 = 2*a1*Cosine(1.414*180 / 10);

c2 = b1;

c3 = -a1*a1;

c1 = 1 - c2 - c3;
Imag = c1*(Quadrature + Quadrature[1]) / 2 + c2*Imag[1] + c3*Imag[2];

Plot1(Real);

Plot2(0);

Plot6(Imag);

Re: Ehlers Indicators for MT4

Posted: Sun Jan 01, 2023 3:33 am
by scarletPip
Autocorrelation Reversals
His autocorrelation periodogram is easily found. This one, not so much.

Code: Select all

{
    Autocorrelation Reversals
    © 2013 John F. Ehlers
}
Inputs:
    HPLength(48),
    LPLength(10),
    AvgLength(3);
Vars:
    alpha1(0),
    HP(0),
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0),
    Filt(0),
    M(0),
    N(0),
    X(0),
    Y(0),
    Lag(0),
    count(0),
    Sx(0),
    Sy(0),
    Sxx(0),
    Syy(0),
    Sxy(0),
    SumDeltas(0),
    Reversal(0);
Arrays:
    Corr[48, 2](0);
//Highpass filter cyclic components whose periods are shorter than 48 bars
alpha1 = (Cosine(.707*360 / 48) + Sine (.707*360 / 48) - 1) / Cosine(.707*360 / 48);
HP = (1 - alpha1 / 2)*(1 - alpha1 / 2)*(Close - 2*Close[1] + Close[2]) + 2*(1 - alpha1)*HP[1] - (1 - alpha1)*
(1 - alpha1)*HP[2];
//Smooth with a Super Smoother Filter from equation 3-3
a1 = expvalue(-1.414*3.14159 / LPLength);
b1 = 2*a1*Cosine(1.414*180 / LPLength);
c2 = b1;
c3 = -a1*a1;
c1 = 1 - c2 - c3;
Filt = c1*(HP + HP[1]) / 2 + c2*Filt[1] + c3*Filt[2];
//Pearson correlation for each value of lag
For Lag = 3 to 48 Begin
    Corr[Lag, 2] = Corr[Lag, 1];
    //Set the averaging length as M
    M = AvgLength;
    If AvgLength = 0 Then M = Lag;
    //Initialize correlation sums
    Sx = 0;
    Sy = 0;
    Sxx = 0;
    Syy = 0;
    Sxy = 0;
    //Advance samples of both data streams and sum Pearson components
    For count = 0 to M - 1 Begin
       X = Filt[count];
       Y = Filt[Lag + count];
       Sx = Sx + X;
       Sy = Sy + Y;
       Sxx = Sxx + X*X;
       Sxy = Sxy + X*Y;
       Syy = Syy + Y*Y;
    End;
    //Compute correlation for each value of lag
    If (M*Sxx - Sx*Sx)*(M*Syy - Sy*Sy) > 0 Then Corr[Lag, 1] = (M*Sxy - Sx*Sy)/SquareRoot((M*Sxx - Sx*Sx)*(M*Syy - Sy*Sy));
    //Scale each correlation to range between 0 and 1
    Corr[Lag, 1] = .5*(Corr[Lag, 1] + 1);
End;
SumDeltas = 0;
For Lag = 3 to 48 Begin
    If (Corr[Lag, 1] > .5 and Corr[Lag, 2] < .5) Or (Corr[Lag, 1] < .5 and Corr[Lag, 2] > .5) Then SumDeltas = SumDeltas + 1;
End;
Reversal = 0;
If SumDeltas > 24 Then Reversal = 1;
Plot1(Reversal);