公式中的M可以分别设为1(标准)、5、25形成三个指标,同时加入副图中达到同时观察三个级别MACD的目的,三级别联立。
点击下载多级别MACD指标 通达信指标 贴图
INPUT:M(5,1,9999);
MM:=9*M;
SHORT:=MM*4/3;
LONG:=MM*26/9;
DIF:1000*(EMA(CLOSE,SHORT)-EMA(CLOSE,LONG))/ABS(EMA(CLOSE,SHORT));
MACD:EMA(DIF,MM),COLOR58FF58;
DEF:2*(DIF-MACD),COLORFFFF00,LINETHICK0;
STICKLINE(DEF =0 ANDDEF =REF(DEF,1),0,DEF,6,1),COLOR6058FF;
STICKLINE(DEF =0 AND DEF
STICKLINE(DEF 0 ANDDEF =REF(DEF,1),0,DEF,6,1),COLORFFFF00;
STICKLINE(DEF 0 AND DEF
PARTLINE(DIF 1000,0),COLORBROWN;
多头趋势:=IF(DIF =0 AND MACD =0 OR(DIF 0 AND MACD =0),1,0);
空头趋势:=DIF 0 AND MACD 0 OR(DIF =0 AND MACD
缩头:=IF(DEF 0 ANDREF(DEF,1) REF(DEF,2) AND DEF
缩脚:=IF(DEF 0 AND REF(DEF,1)REF(DEF,1),1,0);
阻力:=IF(CROSS(CLOSE,MA(CLOSE,20)) ORCROSS(CLOSE,MA(CLOSE,60)),1,0);
支撑:=IF(CROSS(MA(CLOSE,20),CLOSE) ORCROSS(MA(CLOSE,60),CLOSE),1,0);
做多:=IF(CROSS(MACD,DIF) AND DIF 0 ANDMACD 0,1,0);
放空:=IF(CROSS(DIF,MACD) AND DIF 0 ANDMACD 0,1,0);
PARTLINE(DIF,DIF 1000),COLORCCFFFF,LINETHICK2;
PARTLINE(MACD,MACD 1000),COLOR58FF58;
DRAWICON(FILTER(缩头,3) AND 缩头,DEF+0.5,8),ALIGN0;
DRAWICON(FILTER(缩脚,3) AND 缩脚,DEF,10),ALIGN1;
BV:=SUM(DEF,0);
BA:=IF(MAX(BV,REF(BV,2))REF(BV,1),1,0);
BC:=BARSLAST(BA)+1;
SMACD:=BV-REF(BV,BC);
var3:=IF(DEF 0,HHV(ABS(DEF),bc),LLV(DEF,bc));
var4:=(DEF)/20;{图形比例缩小1/20,可修改}
var5:=SMACD;
DRAWtext(REF(var4,1) 0 andvar4 =0,REF(var3,1),''+REF(var5,1)){,pxup100},colorgreen;
DRAWtext(REF(var4,1) 0 and var4 =0,REF(var3,1),''+REF(ABS(var5),1)),{pxdn40,}colorff00ff;
DRAWtext(BARSTATUS=2 andvar4 0,REF(var3,1),''+ABS(var5)),align2,colorff00ff{,pxup40};
DRAWtext(BARSTATUS=2 andvar4 0,REF(var3,1),''+var5),align2,colorgreen{,pxdn100};
M1:=REF(DEF,1);
jc := MACD-dif;
绿柱面积:IF(DEF 0,SUM(DEF,BARSLAST(jc 0)),0),linethick0,colorblue;
红柱面积:IF(DEF 0,SUM(DEF,BARSLAST(jc 0)),0),linethick0,colorred;