通达信日周MACD同现副图指标公式
安装后如下图,友情提示(指标只是辅助,不作建议) 所有程序均为免费分享。
不会安装点击 安装指南 步骤操作。
周放大数:=0.8;下移周期:=1;日缩小数:=1;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
QJZXZ:=CONST(MIN(CONST(LLV(DIF,下移周期)),CONST(LLV(MACD,下移周期))));
DRAWGBK(C>1,RGB(0,0,0),RGB(1,1,1),1,0,0);
{====================MACD过前高=======================}
QGZSJ1:=BARSLAST(CROSS(0,MACD));
QGZSJ2:=IF(MACD<0 AND ISLASTBAR,SUMBARS(CROSS(MACD,0),1),SUMBARS(CROSS(MACD,0),2));
ZDZ:=CONST(FINDHIGH(MACD,QGZSJ1,QGZSJ2-QGZSJ1,1));
ZDZSJ:=CONST(FINDHIGHBARS(MACD,QGZSJ1,QGZSJ2-QGZSJ1,1));
HX:=DRAWLINE(ZDZ=MACD,MACD,REF(ZDZ=MACD,1),REF(MACD,1),1);
NOTEXTQ22:IF(CURRBARSCOUNT<=ZDZSJ+1,HX,DRAWNULL),COLORYELLOW,DOTLINE;
NOTEXTQ23:IF(CURRBARSCOUNT<=ZDZSJ+1,NOTEXTQ22*1.38,DRAWNULL),COLORBLACK,POINTDOT;
DRAWTEXT(ISLASTBAR,NOTEXTQ22,STRCAT(' ',CON2STR(NOTEXTQ22,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=ZDZSJ+1,MACD,'前横线'),COLORYELLOW,DRAWABOVE;
SCSJ:=CONST(BARSLAST(DIF<REF(DIF,1) AND REF(DIF,1)>REF(DIF,2)))+1;
NOTEXTSCHX:IF(CURRBARSCOUNT<=SCSJ+1,CONST(REF(DIF,SCSJ)),DRAWNULL),COLORGREEN,DOTLINE;
DRAWICON(CROSS(DIF,NOTEXTSCHX),NOTEXTSCHX,1);
{更多指标关注微信公众号:程序化指标}
日DIF:DIF,COLORWHITE,NODRAW;
日DEA:DEA,COLORMAGENTA,NODRAW;
日MACD:MACD,COLORRED,NODRAW;
STICKLINE(日MACD>0,日MACD*日缩小数,0,0,0),COLORRED;
STICKLINE(日MACD<0,日MACD*日缩小数,0,0,0),COLORCYAN;
NOTEXTDIF:日DIF*日缩小数,COLORWHITE;
NOTEXTDEA:日DEA*日缩小数,COLORMAGENTA;
{更多指标关注微信公众号:程序化指标}
下移线1:=0.1;
周DIF:EMA(CLOSE,12*5)-EMA(CLOSE,26*5),COLORWHITE,NODRAW;
周DEA:EMA(周DIF,9*5),COLORMAGENTA,NODRAW;
周MACD:(周DIF-周DEA)*2,COLORRED,NODRAW;
MACD转换1:=周MACD*周放大数+下移线1;
T22:=周DIF*周放大数+下移线1;
QJZDZ:=CONST(MAX(CONST(HHV(T22,下移周期)),CONST(HHV(MACD转换1,下移周期))));
下移线2:=-(ABS(QJZXZ)+ABS(QJZDZ));
MACD转换2:=周MACD*周放大数+下移线2;
STICKLINE(周MACD>0,MACD转换2,下移线2,0,1),COLORRED;
STICKLINE(周MACD<0,MACD转换2,下移线2,0,1),COLORCYAN;
NOTEXT22:周DIF*周放大数+下移线2,COLORMAGENTA;
NOTEXT33:周DEA*周放大数+下移线2,COLORWHITE;
DRAWTEXT_FIX(1,0,0,0,' 日线MACD'),COLORRED;
DRAWTEXT_FIX(1,0,0.53,0,' 周线MACD'),COLORRED;
指标先生有话说:用完记得多多分享文章哦!感谢您的支持!
需要改写成选股公式大声呼唤我!