P:=26;S:=12;M:=9;
DIFF :=EMA(CLOSE,S) - EMA(CLOSE,P);
DEA :=EMA(DIFF,M);
macd :20*(DIFF-DEA),COLORWHITE;
STICKLINE(MacD>=REF(MACD,1) AND MACD>=0,0,MACD,5,0),COLOR0066FF;
STICKLINE(MACD>=REF(MACD,1) AND MACD<0,0,MACD,5,0),COLORWHITE;
STICKLINE(MACD<REF(MACD,1) AND MACD>=0,0,MACD,5,0),COLOR00FF00;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,5,0),COLORFF6600;
LS:=MACD>REF(MACD,1) AND (REF(MACD,1)<=0 OR REF(MACD,1)<=REF(MACD,2));
二浪:=(LS AND MACD>0 AND COUNT(LS,15)>=2)*MACD,STICK,COLORYELLOW,LINETHICK2;
DLS:=MACD<0 AND MACD>REF(MACD,1) AND REF(MACD,1)<ref(MACD,2);
二底:=DLS AND COUNT(DLS,15)>=2,STICK,COLORFF00FF,LINETHICK2;
金叉:=crOSS(MACD,0),STICK,COLORRED,LINETHICK2;
MACD走强:=金叉 OR 二浪>0 OR 二底;
{低位反转}
ZF:=(C/REF(C,1)-1)*100;
低点:LLV(C,3)=LLV(C,10) OR LLV(L,3)=LLV(L,10),COLOR00FF00,POINTDOT;
STICKLINE(低点,0 ,0.5 ,5 ,1 ),COLOR00FF00;
涨:(V>REF(V,1) AND ZF>=2 AND C>O)*0.5,COLORYELLOW,STICK,linethick2;
反转1:(涨>0 AND 低点)*2,COLOR00FF00,linethick2;
反转2:(COUNT(ZF>0,2)=2 AND 低点)*3,COLORWHITE,linethick2;
优选:(反转1>0 OR 反转2>0) AND MACD走强,COLORFF00FF,POINTDOT;
ZZ:=COUNT(优选,7) AND 涨;
追涨:(ZZ AND COUNT(ZZ,2)=1)*5,COLORRED,linethick2;
DRAWICON(优选,0.5,1);