通达信K线+MACD指标公式

[复制链接]
查看173 | 回复0 | 2021-8-19 13:08:49 | 显示全部楼层 |阅读模式

以下是通达信K线+MACD指标公式(无源码的请下载附件导入)

DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
 DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA);
 STICKLINE(MACD>0,MACD,0,0.5,1),COLORRED;
 STICKLINE(MACD<0,MACD,0,0.5,1),COLORGREEN;
 STICKLINE(MACD>0 AND MACD<REF(MACD,1),MACD,0,0.5,1),COLORWHITE;
 STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,0.5,1),COLORFF00FF;
绿柱面积:IF (MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),nodraw,colorgreen;
红柱面积:IF (MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),nodraw,Colorred;
 
 DRAWTEXT(CROSS(diff,80),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-80,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-80),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(80,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,30),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-30,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-30),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(30,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,50),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-50,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-50),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(50,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,80),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-8,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-8),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(8,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,5),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-50,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-5),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(5,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,3),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-3,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-3),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(3,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,10),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-10,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-10),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(10,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,1),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-1,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-1),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(1,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,2),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-2,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-2),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(2,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,20),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(-20,diff),diff,'弱'),COLORGREEN;
 DRAWTEXT(CROSS(diff,-20),diff,'强'),COLORRED;
 DRAWTEXT(CROSS(20,diff),diff,'弱'),COLORGREEN;

89133293.png

89133293.png

回复

使用道具 举报

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

本版积分规则