DIFF1:EMA(C,13) - EMA(C,34),COLOR00FFFF ;
DEA1:EMA(EMA(C,13) - EMA(C,34),12) ;
IF(EMA(C,13) - EMA(C,34) >= EMA(EMA(C,13) - EMA(C,34) ,12),EMA(C,13) - EMA(C,34) ,DRAWNULL),COLORRED;
IF((EMA(C,13) - EMA(C,34) - EMA(EMA(C,13) - EMA(C,34) ,12) ) * 1000/EMA(C,15) > 0 AND (EMA(C,13) - EMA(C,34) - EMA(EMA(C,13) - EMA(C,34) ,12) ) * 1000/EMA(C,15) < 1.85,EMA(C,13) - EMA(C,34),DRAWNULL),COLORGREEN;
IF(EMA(C,13) - EMA(C,34) < EMA(EMA(C,13) - EMA(C,34) ,12) OR EMA(C,13) - EMA(C,34) > EMA(EMA(C,13) - EMA(C,34) ,12) AND REF(EMA(C,13) - EMA(C,34) ,1) < REF(EMA(EMA(C,13) - EMA(C,34) ,12) ,1),EMA(C,13) - EMA(C,34) ,DRAWNULL),COLOR00FF00;
DRAWBAND(DIFF1,RGB(64,0,64),DEA1,RGB(57,58,66));
DIFF:=EMA(C,13)-EMA(C,21),NODRAW;
DEA:=EMA(DIFF,5);
macd:=2*(DIFF-DEA);
回吐:IF(DEA>0,DEA,0),COLORFFFFFF,NODRAW;
回补:IF(DEA<0,DEA,0),COLOR00FFFF,NODRAW;
持币:IF(DIFF<0,DIFF,0),COLORFF0000,NODRAW;
持股:IF(DIFF>0,DIFF,0),COLOR0000FF,NODRAW;
ZG:=HHVBARS(DIFF,89)+1;
HH:REF(DIFF,BARSSINCE(BacKSET(ISLASTBAR,ZG))),COLORAAAA77,LINETHICK2;
ZD:=LLVBARS(DIFF,89)+1;
LL:REF(DIFF,BARSSINCE(BACKSET(ISLASTBAR,ZD))),COLORAA77AA,LINETHICK2;
DRAWNUMBER(ISLASTBAR,HH+0.03,ZG),COLOR00AA00;
DRAWNUMBER(ISLASTBAR,LL+0.05,ZD),COLOR0000AA;
DRAWNUMBER(CURRBARSCOUNT=11 AND DIFF,HH+0.03,HH);
DRAWNUMBER(CURRBARSCOUNT=11 AND DIFF,LL+0.05,LL);
STICKLINE((DEA>0),0,DEA,2.5,0),COLORAAAAAA;
STICKLINE((DEA>0),0,DEA,1.8,0),COLORCCCCCC;
STICKLINE((DEA>0),0,DEA,1,0),COLORDDDDDD;
STICKLINE((DEA>0),0,DEA,0.2,0),COLORFFFFFF;
STICKLINE(DEA<0,0,DEA,2.5,0),COLOR0064AA;
STICKLINE(DEA<0,0,DEA,1.8,0),COLOR0093CC;
STICKLINE(DEA<0,0,DEA,1,0),COLOR00C2DD;
STICKLINE(DEA<0,0,DEA,0.2,0),COLOR00FFFF;
STICKLINE(DIFF<0,0,DIFF,2.5,0),COLORAA1100;
STICKLINE(DIFF<0,0,DIFF,1.8,0),COLORAA3300;
STICKLINE(DIFF<0,0,DIFF,1,0),COLORAA5500;
STICKLINE(DIFF<0,0,DIFF,0.2,0),COLORAA7700;
STICKLINE(DIFF>0,0,DIFF,2.5,0),COLOR0000AA;
STICKLINE(DIFF>0,0,DIFF,1.8,0),COLOR0000CC;
STICKLINE(DIFF>0,0,DIFF,1,0),COLOR0000DD;
STICKLINE(DIFF>0,0,DIFF,0.2,0),COLOR0000FF;
DRAWTEXT(REF(DIFF<0 AND DIFF<DEA,1) AND DIFF<0 AND DIFF>DEA ,DEA-0.1,'回'),COLOR00FFFF;
DRAWTEXT(REF(DIFF<0 AND DIFF<DEA,1) AND DIFF<0 AND DIFF>DEA ,DEA-0.2,'补'),COLOR00FFFF;
DRAWTEXT(crOSS(DIFF>0,0.5) ,DIFF+0.2,'买'),COLOR0000FF;
DRAWTEXT(CROSS(DIFF>0,0.5) ,DIFF+0.1,'入'),COLOR0000FF;
DRAWTEXT(REF(DIFF>0 AND DIFF>DEA,1) AND DIFF>0 AND DIFF<DEA ,DEA+0.2,'回'),COLORFFFFFF;
DRAWTEXT(REF(DIFF>0 AND DIFF>DEA,1) AND DIFF>0 AND DIFF<DEA ,DEA+0.1,'吐'),COLORFFFFFF;
DRAWICON(CROSS(EMA(C,13) - EMA(C,34) >= EMA(EMA(C,13) - EMA(C,34) ,12),0.5),EMA(EMA(C,13) - EMA(C,34) ,12) ,5);
DRAWICON(CROSS(EMA(EMA(C,13) - EMA(C,34) ,12) >=EMA(C,13) - EMA(C,34) ,0.5),EMA(EMA(C,13) - EMA(C,34) ,12) ,6);