MA1:MA(C,5);
MA2:MA(C,10);
MA3:MA(C,20);
N1:=BARSLAST(CROSS(MA1,MA2));
N2:=BARSLAST(CROSS(MA1,MA3));
N3:=BARSLAST(CROSS(MA2,MA3));
X1:=HHV(MAX(MAX(MA1,MA2),MA3)/MIN(MIN(MA1,MA2),MA3),N1);
T1:=COUNT(C/REF(C,1)>1.095,5)<2;
T2:=N1>=N2 AND N2>=N3 AND CROSS(MA2,MA3);
T3:=MA3>=REF(MA3,1) AND REF(MA3,1)>=REF(MA3,2);
T4:=MA2>=REF(MA2,1) AND REF(MA2,1)>=REF(MA2,2);
T5:=MA1>=REF(MA1,1) AND REF(MA1,1)>=REF(MA1,2);
T6:=T3 OR T4 OR T5;
XG:=T1 AND T2 AND T6 AND X1>1.05;
N4:=BARSNEXT(XG);
IF(N4>0 AND N4<11 AND N4!=DRAWNULL AND MA3*1.02>MA1 AND MA1>MA2,MA1,DRAWNULL),COLORRED,LINETHICK3;
IF(N4>0 AND N4<11 AND N4!=DRAWNULL AND MA1>MA2 AND MA3*1.02>MA2,MA2,DRAWNULL),COLORRED,LINETHICK3;
IF(N4>0 AND N4<11 AND N4!=DRAWNULL AND MA1>MA3 AND MA3*1.02>MA2,MA3,DRAWNULL),COLORRED,LINETHICK3;
DRAWICON(XG,MA3,44);