Page 1 of 1

PS 6 Day range switch w TADP

Posted: Fri Jul 29, 2016 10:16 am
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);
D9:=If(C>Ref(Max(H,Max(Ref(H,1),Max(Ref(H,2),Max(Ref(H,3),Max(Ref(H,4),Ref(H,5)))))),1),
Min(L,Min(Ref(L,1),Min(Ref(L,2),Min(Ref(L,3),Min(Ref(L,4),Ref(L,5)))))),
Max(H,Max(Ref(H,1),Max(Ref(H,2),Max(Ref(H,3),Max(Ref(H,4),Ref(H,5)))))));

D10:=If(C<Ref(Min(L,Min(Ref(L,1),Min(Ref(L,2),Min(Ref(L,3),Min(Ref(L,4),Ref(L,5)))))),1),
Max(H,Max(Ref(H,1),Max(Ref(H,2),Max(Ref(H,3),Max(Ref(H,4),Ref(H,5)))))),
Min(L,Min(Ref(L,1),Min(Ref(L,2),Min(Ref(L,3),Min(Ref(L,4),Ref(L,5)))))));
A6:=Cross(C,d9);
B6:=Cross(d10,C);

Long:BarsSince(A6)<BarsSince(B6) & TD>0,ColorGreen;
Short:BarsSince(A6)>BarsSince(B6) & 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;