YA:=IF(C>=O,AMOUNT,0);
YaoBV:=SUM(YA,0);
Mobv:=SUM(AMOUNT,0);
BL:=100*YAOBV/MOBV;
maBL3:IF(BARSSINCE(C)>=3,MA(BL,3),50),COLORLIMAGENTA;
MABL30:IF(BARSSINCE(C)>=30,MA(BL,30),MABL3),LINETHICK1;
IF(REF(MABL30,1)>=MABL30,MABL30,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(REF(MABL30,1)<=MABL30,MABL30,DRAWNULL),COLORWHITE,LINETHICK2;
MA60:=REF(MA(C,60),1)>MA(C,60);
MAI60:=REF(MA(INDEXC,60),1)>MA(INDEXC,60);
LS:=MA60 AND MAI60;
STICKLINE(MABL3<=MABL30,MABL3,MABL30,0.1,0),COLORCYAN;
STICKLINE(MABL3>MABL30,MABL3,MABL30,0.1,0),COLORWHITE;
STICKLINE(LS AND MABL3>MABL30,MABL3,MABL30,1,0),COLORBLUE;
X1:=crOSS(MABL3,MABL30);
X2:=COUNT(MABL30>MABL3,BArslAST(CROSS(MABL30,MABL3)))>30;
STICKLINE(X1 AND X2,MABL3-0.5,MABL30--0.5,2,0),COLORLIMAGENTA;
DRAWICON(CROSS(MABL3,MABL30),MABL30+0,1);
DRAWICON(CROSS(MABL30,MABL3),MABL30+0,2);