通达信周k线叠加周macd源码
通达信周k线叠加周macd源码
两个指标
周k线+周macd指标:就是周k线图和周macd叠加在同一图里,在日线图显示,效果和周线图一样
周macd副图:可以在日线图显示,效果和周线图一样。
指标在日线图看时,每一根k线代表一周,macd也一样
p.s. 原创的不是我,我只是把别人的公式修改一下.....
在日线图显示效果,上面是日k线图,下面是周k线图(每一个k线代表一周)
在周线图的显示效果,上边是系统默认的周k图,下边是我的
下面系统默认,上边我的
这周线图,可作参考,黄柱反弹,红柱多头(在日线图显示,一根柱线代表一周)
周k线+周macd源码
DRAWGBK(O>=0,RGB(0,1,0),RGB(30,31,30),0,"0",0);
{}
MON:=WEEKOFYEAR!=REF(WEEKOFYEAR,1);
MC2:=IF(MON,C#WEEK,DRAWNULL);
ML2:=IF(MON,L#WEEK,DRAWNULL);
MO2:=IF(MON,O#WEEK,DRAWNULL);
MH2:=IF(MON,H#WEEK,DRAWNULL);
周开:ALIGNRIGHT(MO2),NODRAW,COLORGRAY;
周收:ALIGNRIGHT(MC2),NODRAW,COLORGRAY;
周高:ALIGNRIGHT(MH2),NODRAW,COLORGRAY;
周低:ALIGNRIGHT(ML2),NODRAW,COLORGRAY;
{}
DIFZ:=EMA(周收,12)-EMA(周收,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=4*(DIFZ-DEAZ);
{}
中轴:REFDATE(HHV(周高,52),DATE),COLORGRAY;
{}
DRAWBAND(DIFZ*2+中轴,RGB(255,128,0),EMA(DIFZ*2+中轴,9),RGB(0,128,192));
{}
STICKLINE((中轴+MACDZ)>中轴 AND (中轴+MACDZ)>REF(中轴+MACDZ,1),中轴,中轴+MACDZ,0.8,0),COLOR000096;
STICKLINE((中轴+MACDZ)>中轴 AND (中轴+MACDZ)<=REF(中轴+MACDZ,1),中轴,中轴+MACDZ,0.8,0),COLOR009600;
STICKLINE((中轴+MACDZ)<=中轴 AND (中轴+MACDZ)<=REF(中轴+MACDZ,1),中轴,中轴+MACDZ,0.8,0),COLOR009600;
STICKLINE((中轴+MACDZ)<=中轴 AND (中轴+MACDZ)>REF(中轴+MACDZ,1),中轴,中轴+MACDZ,0.8,0),COLOR000096;
{}
DRAWKLINE(周高,周开,周低,周收);
{}
MA5周:MA(周收,5)COLORWHITE;
MA10周:MA(周收,10)COLORYELLOW;
MA20周:MA(周收,20)COLORMAGENTA;
MA60周:MA(周收,60)COLORGREEN;
周macd源码
MON:=WEEKOFYEAR!=REF(WEEKOFYEAR,1);
MC2:=IF(MON,C#WEEK,DRAWNULL);
ML2:=IF(MON,L#WEEK,DRAWNULL);
MO2:=IF(MON,O#WEEK,DRAWNULL);
MH2:=IF(MON,H#WEEK,DRAWNULL);
周开:=ALIGNRIGHT(MO2),NODRAW,COLOR8080FF;
周收:=ALIGNRIGHT(MC2),NODRAW,COLOR8080FF;
周高:=ALIGNRIGHT(MH2),NODRAW,COLORFF8000;
周低:=ALIGNRIGHT(ML2),NODRAW,COLORFF8000;
{}
DIFZ:=EMA(周收,12)-EMA(周收,26);
DEAZ:=EMA(DIFZ,9);
MACDZ:=(DIFZ-DEAZ)*2,COLORSTICK;
{}
DRAWBAND(DIFZ,RGB(192,64,0),DEAZ,RGB(0,64,150));
{}
STICKLINE(MACDZ>=0,0,MACDZ,0.8,0),COLOR000096;{0上升}
STICKLINE(MACDZ>=0 AND MACDZ<REF(MACDZ,1),0,MACDZ,0.8,0),COLOR009600;{0上跌}
STICKLINE(MACDZ<0,0,MACDZ,0.8,0),COLOR996700;{0下跌}
STICKLINE(MACDZ<0 AND MACDZ>REF(MACDZ,1),0,MACDZ,0.8,0),COLOR0096FF;{0下升};
{}
周DIF:EMA(周收,12)-EMA(周收,26)COLOR4000C0;
周DEA:EMA(周DIF,9)COLORC04000;
周MACD:(周DIF-周DEA)*2,COLORWHITE,NODRAW;
- 上一篇公式:通达信KDJ三金叉选股指标公式
- 下一篇公式:通达信破晓1.0完整版主副图、选股、预警公式