Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //By Glaz and LazyBear
- study(title="Ehlers Early Onset Trend",shorttitle="EOT")
- Period=input(20)
- Q1=input(0.8)
- Q2=input(0.4)
- Quotient(LPPeriod, K)=>
- PI = 3.1415926
- angle = 0.707 * 2 * PI / 100
- alpha1 = ( cos( angle ) + sin( angle ) - 1 ) / cos( angle )
- a1 = exp( -1.414 * PI / LPPeriod )
- b1 = 2 * a1 * cos( 1.414 * PI / LPPeriod )
- c2 = b1
- c3 = -a1 * a1
- c1 = 1 - c2 - c3
- HP= pow((1-alpha1/2),2)*(close - (2*close[1]) + close[2]) + 2*(1-alpha1)*nz(HP[1]) - pow((1-alpha1),2)* nz(HP[2])
- Filt= c1 * (HP + nz(HP[1]))/2 + c2*nz(Filt[1]) + c3*nz(Filt[2])
- Pk= iff(abs(Filt) > 0.991 *nz(Pk[1]), abs(Filt), 0.991 * nz(Pk[1]))
- X = nz(Filt / Pk)
- q=( X + K ) / ( K * X + 1 )
- plot(Quotient( Period, Q1 ),color=red)
- plot(Quotient( Period, Q2 ),color=aqua)
- hline(0)
- red1 = Quotient(Period,Q1)
- aqua1 = Quotient(Period,Q2)
- up = crossover(red1,0)
- down = crossunder(aqua1,0)
- bgcolor(down?red:na,transp=50)
- bgcolor(up?green:na,transp=50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement