DIFF:EMA(CLOSE,6)-EMA(CLOSE,16);
DEA:EMA(DIFF,5);
MACD:=2*(DIFF-DEA);
對DIFF :0-(EMA(CLOSE,6) – EMA(CLOSE,16));
對DEA :0-(EMA(DIFF,5));
STICKLINE(MACD0,0,MACD,4,0 ),Color00C4C4;
STICKLINE(MACD>=REF(MACD,1)ANDMACD>0,0,MACD,6 ,0 ),Color0000BB;
STICKLINE(MACD>REF(MACD,1)ANDMACD<0,0,MACD,6,0 ),Color9B009B;
STICKLINE(MACD<=REF(MACD,1)ANDMACD<0,0,MACD,4,0 ),Color00AA00;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
STICKLINE(低位金叉,0,-0.01,5,0),ColorE8E8E8;
DRAWTEXT(低位金叉,-0.01,' 金叉'),ColorFFFFFF;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 ANDCOUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.01,5,0),Color0042CC;
DRAWTEXT(二次金叉,-0.01,' 金叉二'),Color3375FF;