N:=5;M:=21;
LC:=REF(C,1);
DF:=C-IF(C>LC,MIN(L,LC),MAX(H,LC));
AD:SUM(IF(C=LC,0,DF),0),LINETHICK1;
AD5:EXPMEMA(AD,N),COLORYELLOW;
MAD:EXPMEMA(AD5,M),COLORRED;
{ _通达信股票指标公式}
STICKLINE(AD>AD5,AD,AD5,0.001,0),COLORWHITE;
STICKLINE(AD5>MAD,AD5,MAD,0.001,0),COLORRED;
STICKLINE(AD