股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信真MACD日周源码贴图


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-9 11:45:33

以下是通达信真MACD日周源码贴图

新鲜出来的,没什么了不起,只是一个普通的macd指标…………

橙色和蓝色是周macd柱线,棕色和深蓝色表示周macd金叉和死叉。
橙色柱看多,蓝色柱看空....
结合日线macd观插行情…………
日线红枉多头,绿柱空头,
如果周线和日线同时多头,就表示可能有戏吧……可能

{周MACD柱线}
MACD周:=MACD.MACD#WEEK,NODRAW;
STICKLINE(MACD周>=0,0,MACD周,4.2,0),COLOR0080FF;
STICKLINE(MACD周>=0 AND MACD周<REF(MACD周,WEEKDAY),0,MACD周,4.2,0),COLORLIBLUE;
STICKLINE(MACD周<0,0,MACD周,4.2,0),COLORLIBLUE;
STICKLINE(MACD周<0 AND MACD周>REF(MACD周,WEEKDAY),0,MACD周,4.2,0),COLOR0080FF;
{日MACD的柱线}
MACD2:=2*("MACD.DIF" - "MACD.DEA");
STICKLINE(MACD2>=0,0,MACD2,1.4,0),COLOR000096;
STICKLINE(MACD2>=0,0,MACD2,1.2,0),COLOR0000A5;
STICKLINE(MACD2>=0,0,MACD2,1.0,0),COLOR0000B4;
STICKLINE(MACD2>=0,0,MACD2,0.8,0),COLOR0000C3;
STICKLINE(MACD2>=0,0,MACD2,0.6,0),COLOR0000D2;
STICKLINE(MACD2>=0,0,MACD2,0.4,0),COLOR0000E1;
STICKLINE(MACD2>=0,0,MACD2,0.2,0),COLOR0000F0;
STICKLINE(MACD2>=0,0,MACD2,0.05,0),COLOR0000FF;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,1.4,0),COLOR009600;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,1.2,0),COLOR00A500;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,1.0,0),COLOR00B400;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,0.8,0),COLOR00C300;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,0.6,0),COLOR00D200;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,0.4,0),COLOR00E100;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,0.2,0),COLOR00F000;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,0.05,0),COLOR00FF00;
STICKLINE(MACD2<0,0,MACD2,1.4,0),COLOR009600;
STICKLINE(MACD2<0,0,MACD2,1.2,0),COLOR00A500;
STICKLINE(MACD2<0,0,MACD2,1.0,0),COLOR00B400;
STICKLINE(MACD2<0,0,MACD2,0.8,0),COLOR00C300;
STICKLINE(MACD2<0,0,MACD2,0.6,0),COLOR00D200;
STICKLINE(MACD2<0,0,MACD2,0.4,0),COLOR00E100;
STICKLINE(MACD2<0,0,MACD2,0.2,0),COLOR00F000;
STICKLINE(MACD2<0,0,MACD2,0.05,0),COLOR00FF00;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.4,0),COLOR000096;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.2,0),COLOR0000A5;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.0,0),COLOR0000B4;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.8,0),COLOR0000C3;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.6,0),COLOR0000D2;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.4,0),COLOR0000E1;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.2,0),COLOR0000F0;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,0.05,0),COLOR0000FF;
{周DIF,周DEA}
周DIF:MACD.DIF#WEEK,COLORGRAY,NODRAW;
周DEA:MACD.DEA#WEEK,COLORGRAY,NODRAW;
周金叉:=周DIF>周DEA;
周死叉:=周DIF<周DEA;
STICKLINE(周金叉,周DIF,周DEA,0,0),COLOR008080;
STICKLINE(周死叉,周DIF,周DEA,0,0),COLORBLUE;
{MACD周线的背离}
ZA1:=BARSLAST(REF(CROSS(周DIF,周DEA),1));
周底背离:=REF(CLOSE,ZA1+1)>CLOSE AND 周DIF>REF(周DIF,ZA1+1) AND CROSS(周DIF,周DEA);
ZA2:=BARSLAST(REF(CROSS(周DEA,周DIF),1));
周顶背离:=REF(CLOSE,ZA2+1)<CLOSE AND REF(周DIF,ZA2+1)>周DIF AND CROSS(周DEA,周DIF);
DRAWTEXT(周底背离,周DIF*1.02,'周底背'),COLORWHITE;
DRAWTEXT(周顶背离,周DIF*1.02,'周顶背'),COLORGREEN;
{日线DIF和DEA}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26)COLORLIMAGENTA,LINETHICK2;
DEA:EMA(DIF,9)COLORFF0080;
MACD:2*(DIF-DEA)COLORWHITE,NODRAW;
{MACD日线底背离}
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(底背离,DIF*1,'日底背'),COLORWHITE;
{MACD日线顶背离}
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
DRAWTEXT(顶背离,DIF*1,'日顶背'),COLORGREEN;
{MACD_KDJ的金叉共振}
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9));
K:=SMA(RSV,9,3),NODRAW;
D:=SMA(K,9,3),NODRAW;
J:=3*K-2*D,NODRAW;
A:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);
DRAWTEXT(A,DIF*1.5,'MACD_KDJ金叉共振'),COLORWHITE;






回复

举报

QQ|

GMT+8, 2024-11-18 14:42

快速回复 返回顶部 返回列表