通达信MACD面积副图指标 源码公式无未来

[复制链接]
查看94 | 回复0 | 2021-8-26 22:20:16 | 显示全部楼层 |阅读模式

以下是通达信MACD面积副图指标 源码公式无未来(无源码的请下载附件导入)

分享一个可以直观看到MACD红绿柱面积数值以及黄白线数值的MACD优化指标

如图:红箭头处MACD力度明显背驰,但指数新高,上涨动力不足,很直观就可以看出来。
 

{周期放大开关:1为普通模式,0为放大模式}
周期放大:=1;
数显开关:=1;
倍数:=
IF(PERIOD=11,1,{年}
IF(PERIOD=10,4,{季}
IF(PERIOD=9,6, {多日}
IF(PERIOD=8,10,{多分钟}
IF(PERIOD=7,12,{月}
IF(PERIOD=6,5, {周}
IF(PERIOD=5,5, {日}
IF(PERIOD=4,4, {60F}
 IF(PERIOD=3,8, {30F}
 IF(PERIOD=2,4, {15F}
 IF(PERIOD=1,6, {5F}
 IF(PERIOD=0,5, {1F}
 1))))))))))));
 N1:=IF(周期放大,12,12*倍数);
N2:=IF(周期放大,26,26*倍数);
N3:=IF(周期放大,9,9*倍数);
DIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE,NODRAW;
 DEA:EMA(DIFF,N3),COLORYELLOW,NODRAW;
 MACD: (DIFF-DEA)*2,COLORSTICK,NODRAW;
红柱面积:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW,COLORRED;
绿柱面积:ABS(IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0)),NODRAW,COLORLIGREEN;
 MACD面积:=IF(MACD>0,红柱面积,绿柱面积),NODRAW,COLORFFFF00;
位置:=MAX(HHV(DIFF,100),ABS(LLV(DIFF,100)));
 {柱变与交叉临界}
开盘价格:=O,COLORYELLOW,NODRAW;
收盘价格:=C,COLORYELLOW,NODRAW;
最高价格:=H,COLORYELLOW,NODRAW;
最低价格:=L,COLORYELLOW,NODRAW;
振幅:=(H-L)/REF(C,1)*100,COLORYELLOW,NODRAW;
柱变临界:REF((EMA(CLOSE,12)*1134-EMA(CLOSE,26)*910-DEA*702)/224,1),COLORLIMAGENTA,NODRAW;
交叉临界:351/28*
 (EMA(REF(DIFF,1),9)-11/13*EMA(REF(C,1),12)+25/27*EMA(REF(C,1),26)),COLORLIMAGENTA,NODRAW;
明日柱变临界: (EMA(CLOSE,12)*1134-EMA(CLOSE,26)*910-DEA*702)/224,COLORLIBLUE,NODRAW;
明日交叉临界:351/28*(EMA(DIFF,9)-11/13*EMA(C,12)+25/27*EMA(C,26)),COLORLIBLUE,NODRAW;
 {MACD重建-避免遮挡}
 STICKLINE(MACD>0,0,MACD,1,0),COLORRED;
 STICKLINE(MACD<0,0,MACD,1,0),COLORGREEN;
 STICKLINE(MACD>0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLORYELLOW;
 STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORWHITE;
 NOTEXTDIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE;
 NOTEXTDEA:EMA(DIFF,N3),COLORYELLOW;
 {数显开关:1为打开,0为关闭}
DRAWNUMBER(数显开关=1 AND LONGCROSS(DEA,DIFF,3),位置*0.8,REF(红柱面积,1)),COLORRED;
 DRAWNUMBER(数显开关=1 AND LONGCROSS(DIFF,DEA,3),0-位置*0.5,REF(绿柱面积,1)),COLORGREEN;
 NOTEXTLMH: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD>0,位置*0.8,红柱面积),COLORRED;
 NOTEXTLML: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD<0,0-位置*0.5,绿柱面积),COLORGREEN;

1057233285.jpg

1057233285.jpg

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则