短:=12;
长:=26;
差:=9;
DIF:EMA(C,短)-EMA(C,长),COLORWHITE;
DEA:EMA(DIF,差),COLORYELLOW;
macd:(DIF-DEA)*2,COLORSTICK;
输出0轴:0,DOTLINE;
输出MacD:=MA(MACD,1);
绿柱缩量条件:=输出MACD<0 AND 输出MACD>REF(输出MACD,1);
绿柱放量条件:=输出MACD<0 AND 输出MACD<REF(输出MACD,1);
红柱缩量条件:=输出MACD>0 AND 输出MACD<REF(输出MACD,1);
红柱放量条件:=输出MACD>0 AND 输出MACD>REF(输出MACD,1);
STICKLINE(绿柱缩量条件,输出0轴,输出MACD,2,0),COLORRED;
STICKLINE(绿柱放量条件,输出0轴,输出MACD,2,0),COLORGREEN;
STICKLINE(红柱缩量条件,输出0轴,输出MACD,2,0),COLORCYAN;
STICKLINE(红柱放量条件,输出0轴,输出MACD,2,0),COLORMAGENTA;
IF(DEA>REF(DEA,1),DEA,DRAWNULL),COLORRED;
IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORMAGENTA;
金叉CORO:=crOSS(DIF,DEA);
DRAWICON(金叉CORO,DIF,1);