您的位置:爱股网 > 查股公式 > 通达信真MACD日周源码[查股公式]
股票行情消息数据:

通达信真MACD日周源码[查股公式]

2022/6/13 17:45:41

新鲜出来的,没什么了不起,只是一个普通的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;


相关文章列表
天天查股公式列表

股票公式分类

天天查股:股票行情消息 实时DDX在线 资金流向 千股千评 业绩报告 十大股东 最新消息 超赢数据 大小非解禁 停牌复牌 股票分红数据 股票评级报告
广告客服:315126368   843010021
爱股网免费查股,本站内容与数据仅供参考,不构成投资建议,据此操作,风险自担,股市有风险,投资需谨慎。 沪ICP备15043930号-29