PS 8 Day range switch w TADP

This is the place to discuss EdgeRater Chart Script

Moderator: Chris White

Post Reply
henry1224
Posts: 457
Joined: Wed Feb 24, 2016 12:04 pm

PS 8 Day range switch w TADP

Post by henry1224 »

ML1:=MA(Close,50);
ML2:=MA(Close,200);
RecP:= If((ML1 < ML2 & Close < ML2 & Close > ML1) ,1,0),ColorLightGreen;
WarnP:= If((ML1 > ML2 & Close > ML2 & Close < ML1) ,-1,0),ColorOrange;
AcumP:= If((ML1 < ML2 & Close > ML2 & Close > ML1) ,2,0),ColorGreen;
DispP:= If((ML1 > ML2 & Close < ML2 & Close < ML1) ,-2,0),ColorRed;
BullP:= If((ML1 > ML2 & Close > ML2 & Close > ML1) ,3,0),ColorDarkGreen;
BearP:= If((ML1 < ML2 & Close < ML2 & Close < ML1),-3,0),ColorDarkRed;
TD:=(RecP + WarnP + AcumP + DispP + BullP + BearP);
D13:=If(C>Ref(Max(H,Max(Ref(H,1),Max(Ref(H,2),Max(Ref(H,3),Max(Ref(H,4),Max(Ref(H,5),Max(Ref(H,6),Ref(H,7)))))))),1),
Min(L,Min(Ref(L,1),Min(Ref(L,2),Min(Ref(L,3),Min(Ref(L,4),Min(Ref(L,5),Min(Ref(L,6),Ref(L,7)))))))),
Max(H,Max(Ref(H,1),Max(Ref(H,2),Max(Ref(H,3),Max(Ref(H,4),Max(Ref(H,5),Max(Ref(H,6),Ref(H,7)))))))));

D14:=If(C<Ref(Min(L,Min(Ref(L,1),Min(Ref(L,2),Min(Ref(L,3),Min(Ref(L,4),Min(Ref(L,5),Min(Ref(L,6),Ref(L,7)))))))),1),
Max(H,Max(Ref(H,1),Max(Ref(H,2),Max(Ref(H,3),Max(Ref(H,4),Max(Ref(H,5),Max(Ref(H,6),Ref(H,7)))))))),
Min(L,Min(Ref(L,1),Min(Ref(L,2),Min(Ref(L,3),Min(Ref(L,4),Min(Ref(L,5),Min(Ref(L,6),Ref(L,7)))))))));
A8:=Cross(C,d13);
B8:=Cross(d14,C);

Long:BarsSince(A8)<BarsSince(B8) & TD>0,ColorGreen;
Short:BarsSince(A8)>BarsSince(B8) & TD<0,ColorRed;
FillRgn(Long>0,0,Long),Brush#50008000;
FillRgn(Short>0,0,Short),Brush#50800000;
FillRgn(Long==0 & Short==0,0,1),Brush#501E90FF;
Post Reply