N1:=12;N2:=12;
EF:=MAX(HHV(C,N1)-LLV(C,N1),Abs(C-REF(C,N1)))/SUM(ABS(C-REF(C,1)),N1);
EFMA:=EMA(EF,N1);
MER:=INTPART(N1-(EFMA-0.5)*N2);
LY:=SUM((C-REF(C,1)),MER);
LYSX:EMA(LY,N1);
0;
FILLRGN(0,LYSX,LYSX>0),COLORRED;
VERTLINE(crOSS(LYSX,0),1),COLORRED;
FILLRGN(0,LYSX,LYSX<0),COLORGREEN;
VERTLINE(CROSS(0,LYSX),1),COLORGREEN;
XG:=CROSS(LYSX,0);