SHORT:=5;
LONG:=55;
MID:=10;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
macd:(DIF-DEA)*2,COLORSTICK;
VAR1:DIF,COLORRED;
VAR2:DEA,COLORRED;
关注:IF(VAR1>REF(VAR1,1),VAR1,DRAWNULL),COLORRED;
持股:IF(VAR2>REF(VAR2,1),VAR2,DRAWNULL),COLORRED;
观望:IF(VAR1<REF(VAR1,1),VAR1,DRAWNULL),COLORGREEN;
持币:IF(VAR2<REF(VAR2,1),VAR2,DRAWNULL),COLORGREEN;
X_1:=MacD.MACD*3;
X_2:=HHVBARS(MACD,BArslAST(MACD<0)+1);
X_3:=crOSS(BACKSET(CROSS(0,MACD),REF(X_2,1)+2),0.5);
X_4:=DRAWLINE(X_3,MACD,REF(X_3,1),REF(MACD,1),1);
STICKLINE(MACD>X_4,MACD,X_4,0.0001,0),COLORWHITE;