John Ehlers roofing filter
Forums › ProRealTime English forum › ProBuilder support › John Ehlers roofing filter
- This topic has 6 replies, 2 voices, and was last updated 7 years ago by gabri.
-
-
04/26/2017 at 2:07 PM #33507
Hi all,
I was tring to replicate an indicator explained by John Ehlers in a youtube video.
I attach the formula as image.
When I try to code it on PRT I dont get any line, I presume is because the definition of Ehlers indicator at time t refers to the same indicator at time t-1:
Indicator:
a = (cos(0.707*360/48)+sin(0.707*360/48)-1)/cos(0.707*360/48)
hp = 0hp = (1+a/2)*(1-a/2)*(close-2*close[1]+close[2])+2*(1-a)*hp[1]-(1-a)*(1-a)*hp[2]
return hpCan someone help with that?
MAny thanks
Francesco
04/26/2017 at 2:17 PM #33516I guess I sorted this one by writing this
a = (cos(0.707*360/48)+sin(0.707*360/48)-1)/cos(0.707*360/48)
hp1 = (1+a/2)*(1-a/2)*(close[1]-2*close[2]+close[3])
hp2 = (1+a/2)*(1-a/2)*(close[2]-2*close[3]+close[4])hp = (1+a/2)*(1-a/2)*(close-2*close[1]+close[2])+2*(1-a)*hp1-(1-a)*(1-a)*hp2
return hpDo you agree?
Many thanks
Francesco
04/26/2017 at 7:29 PM #33560Francesco,
ecco il codice
1234567891011121314151617181920alpha1 = (cos(.707*360 / 48) + sin (.707*360 / 48) - 1) / cos(.707*360 / 48)if barindex>1 thenHP = (1-alpha1/2)*(1-alpha1/2)*(Close-2*dClose(1)+dClose(2))+2*(1-alpha1)*HP[1] - (1 - alpha1)*(1 - alpha1)*HP[2]elseHP = 0endifa1 = EXP(-1.414*3.14159 / 10)b1 = 2*a1*cos(1.414*180 / 10)c2 = b1c3 = -a1*a1c1 = 1 - c2 - c3if barindex>1 thenFilt = c1*(hp + hp[1]) / 2 + c2*Filt[1] + c3*Filt[2]elsefilt=0endifreturn filt1 user thanked author for this post.
04/26/2017 at 7:33 PM #33567Grazie mille Gabri!
Saluti
Francesco
04/27/2017 at 6:12 PM #33721Scusami Gabri ma continua a venire una linea pari a zero e basta, a te esce qualcosa di diverso?
Grazie
Francesco
04/27/2017 at 6:16 PM #33723problema risolto, grazie!..:)
07/17/2017 at 7:10 PM #40893 -
AuthorPosts