macd主图指标源码公式
大智慧纯金MACD副图源码
DIFF:EMA(CLOSE,12)-EMA(CLOSE,27);
DEA:EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
STICKLINE(MACD>=0,MACD,0,4,1),COLORF00FF0;
STICKLINE(MACD0,0,MACD,4,0 ),COLOR00aaff;
STICKLINE(MACD0,0,MACD,3.3,0 ),COLOR00bbff;
STICKLINE(MACD0,0,MACD,2.2,0 ),COLOR00ccff;
STICKLINE(MACD0,0,MACD,1.65,0 ),COLOR00ddff;
STICKLINE(MACD0,0,MACD,1.1,0 ),COLOR00eeff;
STICKLINE(MACD0,0,MACD,0.55,0 ),COLOR00ffff;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,4 ,0 ),COLOR0000aa;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,3.3 ,0 ),COLOR0011bb;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,2.2,0 ),COLOr0022cc;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.65 ,0 ),COLOR0033dd;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.1 ,0 ),COLOR0044ee;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,0.55 ,0 ),COLOR0055ff;
STICKLINE(MACD>ref(MACD,1)and MACDref(MACD,1)and MACDref(MACD,1)and MACDref(MACD,1)and MACDref(MACD,1)and MACDref(MACD,1)and MACDdea,dea,dea),COLORwhite,linethick1;
低位金叉:=CROSS(DIFF,DEA) AND DIFF=0));
二次金叉:=CROSS(DIFF,DEA) AND DEACLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.13,6,0),Color00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,linethick2;
DRAWTEXT(底背离,0.1,' 底背离'),Color00FF00;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,linethick2;CXH:=STRTONUM(STRRIGHT(DATESTR(CURRENTDATE),1));
WARNING('',CURRENTTIME>180000 and (CXH=1 OR CXH=6));
DRAWTEXTREL(10 ,10 ,'指标公式');