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),COLORMAGENTA;
MABL30:IF(BARSSINCE(C)>=30,MA(BL,30),MABL3),LINETHICK1;
IF(REF(MABL30,1)>=MABL30,MABL30,DRAWNULL),COLORBLUE,LINETHICK2;
IF(REF(MABL30,1)<=MABL30,MABL30,DRAWNULL),COLORRED,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),COLORGREEN;
STICKLINE(MABL3>MABL30,MABL3,MABL30,0.1,0),COLORRED;
STICKLINE(LS AND MABL3>MABL30,MABL3,MABL30,1,0),COLORYELLOW;
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),COLORMAGENTA;