Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 8/11/2005(UTC) Posts: 104
|
Hi,
The formula below shows Wedge formations (author unknown)
Does anyone have other Wedge formations Formulas?
Or can this formula be improved?
Kind regards,
Derek
_______________________________
Code:
{Two Trend-lines Wedges Scale from right}
pv:= Input("VeryLong=4,Long=3,Med=2,Short=1",1,4,4);
pp:= LastValue(If(pv=4,4,If(pv=3,2,If(pv=2,1,0.5))));
r0:= If(MP()>=Ref(MP(),-1),ATR(1),0);
r1:= Log(If(r0>0,ATR(1),HIGH)/HIGH);
r2:= Cum(r1)/Max(1,Cum(If(r0>0,1,0)));
r3:= LastValue(100*Exp(LastValue(r2)))*pp;
r4:= LastValue(PeakBars(2,H,r3))-LastValue(PeakBars(1,H,r3));
r5:= (LastValue(Peak(1,H,r3))-LastValue(Peak(2, H,r3)))/r4; {slope}
r6:= LastValue(Peak(2, H,r3))+(r5*(Cum(1)-LastValue(Cum(1)- PeakBars(2,H,r3))));
r7:= If(Cum(1) <lastValue(Cum(1)-PeakBars(2,H,r3)),BarsSince(Cum(1)>=LastValue(Cum(1)-PeakBars( 2,H,r3))),r6);
s0:= If(MP()<=Ref(MP(),-1),ATR(1),0);
s1:= Log(If(s0>0,ATR(1),LOW)/LOW);
s2:= Cum(s1)/Max(1,Cum(If(s0>0,1,0)));
s3:= LastValue(100*Exp(LastValue(s2)))*pp;
s4:= LastValue(TroughBars(2,L,s3))-LastValue(TroughBars(1,L,s3));
s5:= (LastValue(Trough(1,L,s3))-LastValue(Trough(2,L,s3)))/s4; {slope}
s6:= LastValue(Trough(2,L,s3))+(s5*(Cum(1)-LastValue(Cum(1)-TroughBars(2,L,s3))));
s7:= If(Cum(1)<lastValue(Cum(1)-TroughBars(2,L,s3)),BarsSince(Cum(1)>=LastValue(Cum(1 )-TroughBars(2, L,s3))),s6);
r7;s7;
|