日周MACD 新办法日周同图显示 通达信副图指标 源码 贴图
日周MACD 新办法日周同图显示 通达信副图指标 源码 贴图
{日周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;{WWW.GPXIAZAI.COM}
周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,'███████'),COLORYELLOW;
DRAWTEXT_FIX(1,0,0,0,' 日线MACD'),COLORRED;
DRAWTEXT_FIX(1,0,0.53,0,'███████'),COLORYELLOW;
DRAWTEXT_FIX(1,0,0.53,0,' 周线MACD'),COLORRED;
- 上一篇公式:复合看盘 通达信副图指标 源码 贴图
- 下一篇公式:财务基本面叠加 通达信主图/副图/选股一套指标 源码 贴图