R1:=5;R2:=5;R3:=5;R4:=5;M1:=10;M2:=10;0,COLOR000080,LINETHICK2;avgP1:=MA(CLOSE,R1);avgP2:=MA(CLOSE,R2);avgP3:=MA(CLOSE,R3);avgP4:=MA(CLOSE,R4);MAB1:=(CLOSE-avgP1)/avgP1*100;MAB2:=(CLOSE-avgP2)/avgP2*100;MAB3:=(CLOSE-avgP3)/avgP3*100;MAB4:=(CLOSE-avgP4)/avgP4*100;MAB:EMA((MAB1+MAB2+MAB3+MAB4)/4,M1),COLORC0C0C0;MMAB:MA(MAB,M2),COLOR00D0E0;MABD:MAB-MMAB, COLORSTICK;{EXITLONG:MAB>-1 AND MMAB>-1 AND REF(MAB,3)
[REF(MMAB,1) AND MAB<MMAB;};
]