以下是通达信macd主图简版主图贴图原码
现今论坛,加密横行,加密的才多人关注,我也不能逆流哟!
说明:此指标在日线时引用的周MACD、在分钟线时引用日MACD数据用未来函数编写画方框,其它均无未来函数!!
此主图需引用ZDIF指标,ZDIF指标为完全加密无时限。
{MACD主图简版}
DRAWGBK(C>0,RGB(50,60,50),RGB(50,50,100),0,' ',0);
ZDIF:ZDIF.ZDIF,COLORC050FF,NODRAW;
ZDEA:ZDIF.ZDEA,COLORAAA000,NODRAW;
ZMACD:=(ZDIF-ZDEA)*1.5;
MA5:MA(C,5),COLORFFFFFF,NODRAW;
MA10:MA(C,10),COLOR00FFFF,NODRAW;
MACD试盘:IF((ZDEA/REF(ZDEA,1)-1)*1000<-10 AND ZDIF>ZDEA,1,0),COLORFF00FF,NODRAW;
MDSMACD:=BARSLASTCOUNT(IF(PERIOD>4,MACD.DIF#WEEK,MACD.DIF#DAY)>IF(PERIOD>4,MACD.DEA#WEEK,MACD.DEA#DAY));
GYSMACD:=BACKSET((MDSMACD>1)*MDSMACD,MDSMACD)*MDSMACD;
SDMACD:=GYSMACD=1;
WDMACD:=FILTERX(GYSMACD>0,GYSMACD);
MDHMACD:=IF(GYSMACD>0,HHV(H,GYSMACD)*IF(PERIOD>4,1.025,1.011),DRAWNULL);
MDLMACD:=IF(GYSMACD>0,LLV(L,GYSMACD)*IF(PERIOD>4,0.975,0.985),DRAWNULL);
FXSMACD:=BARSNEXT(WDMACD);
HHMACD:=DRAWLINE(SDMACD,REFX(MDHMACD,FXSMACD),WDMACD,MDHMACD,0);
LLMACD:=DRAWLINE(SDMACD,REFX(MDLMACD,FXSMACD),WDMACD,MDLMACD,0);
MDSMACDL:=BARSLASTCOUNT(IF(PERIOD>4,MACD.DIF#WEEK,MACD.DIF#DAY)<IF(PERIOD>4,MACD.DEA#WEEK,MACD.DEA#DAY));
GYSMACDL:=BACKSET((MDSMACDL>1)*MDSMACDL,MDSMACDL)*MDSMACDL;
SDMACDL:=GYSMACDL=1;
WDMACDL:=FILTERX(GYSMACDL>0,GYSMACDL);
MDHMACDL:=IF(GYSMACDL>0,HHV(HHV(H,10),GYSMACDL),DRAWNULL);
MDLMACDL:=IF(GYSMACDL>0,LLV(LLV(L,10),GYSMACDL),DRAWNULL);
FXSMACDL:=BARSNEXT(WDMACDL);
HHMACDL:=DRAWLINE(SDMACDL,REFX(MDHMACDL,FXSMACDL),WDMACDL,MDHMACDL,0);
LLMACDL:=DRAWLINE(SDMACDL,REFX(MDLMACDL,FXSMACDL),WDMACDL,MDLMACDL,0);
HLMACDX:=IF(GYSMACD>0,LLMACD*1.015,HHMACDL*0.98);
DRAWBAND(HHMACD,RGB(128,108,128),LLMACD,DRAWNULL);
STICKLINE(IF(PERIOD>4,MACD.DEA#WEEK,MACD.DEA#DAY)>0,IF(GYSMACD>0,LLMACD*0.995,HHMACDL*0.995),IF(GYSMACD>0,LLMACD*0.985,HHMACDL*0.985),2,1),COLOR00FFFF;
DRAWBAND(ZDIF,RGB(100,30,30),ZDEA,RGB(0,155,88));
DRAWBAND(IF(MACD.DEA>=0,ZDIF,DRAWNULL),RGB(120,60,150),IF(MACD.DEA>=0,ZDEA,DRAWNULL),RGB(0,108,108));
STICKLINE(C>=O,H,L,0,0),COLOR0000FF;
STICKLINE(C<O,H,L,0,0),COLORFFF000;
STICKLINE(C>=O,C,O,3.2,1),COLOR0000FF;
STICKLINE(C<O,C,O,3.2,1),COLORFFF000;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)<EMA((C+O)/2,12),C,O,3.2,0),COLORBB33BB;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)<EMA((C+O)/2,12),C,O,1.5,0),COLORCC33CC;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)<EMA((C+O)/2,12),C,O,0.5,0),COLORDD33DD;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)<EMA((C+O)/2,12) AND C<O,C,(C+O)/2,3.2,0),COLOR998000;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)<EMA((C+O)/2,12) AND C<O,C,(C+O)/2,1.5,0),COLORAA9000;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)<EMA((C+O)/2,12) AND C<O,C,(C+O)/2,0.5,0),COLORBBA000;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12),C,O,3.2,0),COLORC0C0C0;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12),C,O,1.5,0),COLORD0D0D0;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12),C,O,0.5,0),COLORE0E0E0;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND C<O,C,(C+O)/2,3.2,0),COLORDDD000;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND C<O,C,(C+O)/2,1.5,0),COLOREEE000;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND C<O,C,(C+O)/2,0.5,0),COLORFFF000;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12),C,O,3.2,0),COLOR0000DD;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12),C,O,1.5,0),COLOR0000EE;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12),C,O,0.5,0),COLOR0000FF;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND C<O,C,(C+O)/2,3.2,0),COLOR009900;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND C<O,C,(C+O)/2,1.5,0),COLOR00AA00;
STICKLINE(EMA((C+O)/2,3)>=EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND C<O,C,(C+O)/2,0.5,0),COLOR00BB00;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND EMA((C+O)/2,12)>=REF(EMA((C+O)/2,12),1) AND C>O,C,O,3.2,0),COLOR00DDDD;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND EMA((C+O)/2,12)>=REF(EMA((C+O)/2,12),1) AND C>O,C,O,1.5,0),COLOR00EEEE;
STICKLINE(EMA((C+O)/2,3)<EMA((C+O)/2,6) AND EMA((C+O)/2,6)>=EMA((C+O)/2,12) AND EMA((C+O)/2,12)>=REF(EMA((C+O)/2,12),1) AND C>O,C,O,0.5,0),COLOR00FFFF;
IF((ZDEA/REF(ZDEA,1)-1)*1000<-10 AND ZDIF>ZDEA,HHV(H,BARSLAST(CROSS(MA(C,5),MA(C,2)))+1),DRAWNULL),COLORFF00FF,CROSSDOT,LINETHICK3;
MA5,COLORFFFFFF;
MA10,COLOR00FFFF;
DRAWICON(CROSS(ZDIF,ZDEA),LLV(MA(C,5),5),1);
DRAWICON(CROSS(ZDEA,ZDIF),HHV(MA(C,5),5),2);