信号:=1;
DIFF:EMA(CLOSE,11)-EMA(CLOSE,24),COLORBLUE;
DEA:EMA(DIFF,9),COLORWHITE;
MACD:=(DIFF-DEA)*2,COLORSTICK;
{股票指标网 }
STICKLINE(MACD>0 AND MACD>REF(MACD,1),MACD,0,1,0),COLORRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),MACD,0,1,0),COLORWHITE;
STICKLINE(MACD<REF(MACD,1) AND REF(MACD,1)>REF(MACD,2) AND MACD>0,MACD,0,1,0),COLORLIGREEN;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),MACD,0,1,0),COLORFF9900;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,1,0),COLORBROWN;
STICKLINE(MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2) AND MACD<=0,MACD,0,2,0),COLORYELLOW;
STICKLINE(CROSS(DIFF,DEA),0,DEA,1,0),COLORLIMAGENTA;
STICKLINE(CROSS(DEA,DIFF),0,DIFF,1,0),COLORBLUE;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0))*信号;
二次金叉:=(CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1)*信号;
STICKLINE(二次金叉,0,MACD,0.1,0)*信号,COLORGREEN;
DRAWTEXT(二次金叉,DEA,' 二次金叉')*信号,COLORYELLOW;
DRAWICON(二次金叉,MACD,1)*信号;
IF(DIFF<0,DIFF,DRAWNULL),COLORBLUE,LINETHICK3;
IF(DEA>0,DEA,DRAWNULL),COLORCYAN,LINETHICK3;
IF(DEA<0,DEA,DRAWNULL),COLORWHITE,LINETHICK3;
IF(DIFF>DEA,DIFF,DRAWNULL),COLORRED,LINETHICK3;
IF(DEA<DIFF,DEA,DRAWNULL),COLORMAGENTA,LINETHICK3;
IF(DIFF>0,DIFF,DRAWNULL),COLORYELLOW,LINETHICK3;
0,LINETHICK3,COLORWHITE;
分水岭:0.07,LINETHICK2,COLORGREEN;