Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
This indicator is from Victor H
ppr:=Input("Longest=4,Longer=3,Long=2,Med=1,Short=.5",0.5,4,2);
pps:=Input("Longest=4,Longer=3,Long=2,Med=1,Short=.5",0.5,4,2);
z1:= Cum(Log(If(If(MP()>=Ref(MP(),-1),ATR(1),0)>0,ATR(1),H)/H))/Max(1,Cum(If(If(MP()>=Ref(MP(),-1),ATR(1),0)>0,1,0)));
r1:= LastValue(100*Exp(LastValue(z1)))*ppr;
r2:= LastValue(Peak(1,H,r1))- LastValue(Peak(2,H,r1));
r3:= LastValue(PeakBars(2,H,r1))-LastValue(PeakBars(1,H,r1));
r4:= r2/r3; {Slope}
r6:= LastValue(Cum(1)- PeakBars(2,H,r1));
r7:= LastValue(Peak(2,H,r1))+(r4*( Cum(1)-r6));
r8:=If(Cum(1)<r6,BarsSince(Cum(1)>=r6),r7);
z2:= Cum(Log(If(If(MP()<=Ref(MP(),-1),ATR(1),0)>0,ATR(1),L)/L))/Max(1, Cum(If(If(MP()<=Ref(MP(),-1),ATR(1),0)>0,1,0)));
s1:= LastValue(100*Exp(LastValue(z2)))*pps;
s2:= LastValue(Trough(1,L,s1))- LastValue(Trough(2,L,s1));
s3:= LastValue(TroughBars(2,L,s1))-LastValue(TroughBars(1,L,s1));
s4:= s2/s3; {Slope}
s6:= LastValue(Cum(1)- TroughBars(2,L,s1));
s7:= LastValue(Trough(2,L,s1))+(s4*( Cum(1)-s6));
s8:=If(Cum(1)<s6,BarsSince(Cum(1)>=s6),s7);
R8;S8;
|