MA1:=MA(CLOSE,5);
MA2:=MA(CLOSE,10);
MA3:=MA(CLOSE,20); YA:=COUNT(CROSS(MA2,MA1),21)=1 AND CROSS(MA3,MA2) AND
COUNT(CROSS(MA3,MA1),21)=1 AND
BARSLAST(CROSS(MA2,MA1))>BARSLAST(CROSS(MA3,MA1)) AND
BARSLAST(CROSS(MA3,MA1))>BARSLAST(CROSS(MA3,MA2)) AND
MA1<REF(MA1,1);
A1:=O>MAX(MA1,MAX(MA2,MA3)) AND C<MIN(MA1,MIN(MA2,MA3));
A2:=COUNT(A1,21)=1;
YA AND A2;