通达信指标——超准MACD(副图)

合集下载

指标一目了然MACD背离点显示在副图上通达信指标源码贴图

指标一目了然MACD背离点显示在副图上通达信指标源码贴图

指标一目了然MACD背离点显示在副图上通达信指标源码贴图DIF:100*(EMA(CLOSE,12)-EMA(CLOSE,26)),COLORWHITE,LINETHICK1;DEA:EMA(DIF,9),COLORYELLOW,LINETHICK1;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD>REF(MACD,1)ANDMACD>0,0,MACD,0.2,0),COLORRED;STICKLINE(MACD<REF(MACD,1)ANDMACD>0,0,MACD,0.2,0),COLORYELLOW;STICKLINE(MACD>REF(MACD,1)ANDMACD<0,0,MACD,0.2,0),COLORBLUE;STICKLINE(MACD<REF(MACD,1)ANDMACD<0,0,MACD,0.2,0),COLORGREEN;FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;FH5:=FH1 AND FH2 AND MACD<0.10;二次翻红:=(FH3 OR FH4 OR FH5),COLORRED,NODRAW;低买:=CROSS(DIF,DEA) AND DIF<0,COLORFF00FF,NODRAW;加油:=CROSS(DIF,DEA) AND DIF>0,COLORYELLOW,NODRAW;DRAWICON(二次翻红,-0.05,1);DRAWTEXT(二次翻红,-0.15,'↖翻红'),COLORRED;DRAWTEXT(CROSS(DIF,DEA) AND DIF<0,DEA-0.02,'↖低买'),COLORFF00FF;DRAWTEXT(CROSS(DIF,DEA) AND DIF>0,DEA-0.05,'↖加油'),COLORYELLOW;YLZC:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDE XO)/4,AMOUNT/(VOL+0.01)/100);W1:=C>REF(C,4);NT:=BARSLASTCOUNT(W1);TJ11:=NT=9;TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;DRAWTEXT(AY>0,MACD*1.02,VAR2STR(AY,0)),COLORLIRED;DRAWTEXT(NT=9,MACD*1.02,'9'),COLORGREEN;Q1:=C<REF(C,4);NT0:=BARSLASTCOUNT(Q1);TJ21:=NT0=9 ;TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8);AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0;DRAWTEXT(AY1>0,MACD*0.98,VAR2STR(AY1,0)),COLORGRE EN;DRAWTEXT(NT0=9,MACD*0.98,'9'),COLORRED;DRAWICON(CROSS(DIF,DEA),DEA,1);DRAWICON(CROSS(DEA,DIF),DEA,2);死叉:=CROSS(DEA,DIF);N1:=BARSLAST(死叉),NODRAW;{最近一次死叉的位置}N2:=REF(BARSLAST(死叉),N1+1),NODRAW;{倒数第二次死叉与倒数第一次死叉的区间}N3:=REF(BARSLAST(死叉),N2+N1+2),NODRAW;{倒数第三次死叉与倒数第二次死叉的区间}CL1:=LLV(C,N1+1),NODRAW;{最近一次死叉后,最低收盘价} DIFL1:=LLV(DIF,N1+1),NODRAW;CL2:=REF(CL1,N1+1),NODRAW;{倒数第二次死叉与倒数第一次死叉之间的最低收盘价}CL3:=REF(CL2,N1+1),NODRAW;{倒数第三次死叉与倒数第二次死叉之间的最低收盘价}DIFL3:=REF(DIFL2,N1+1),NODRAW;PDIFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1);MDIFL2:=INTPART(DIFL2/POW(10,PDIFL2));PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1);MDIFL3:=INTPART(DIFL3/POW(10,PDIFL3));MDIFB2:=INTPART(DIF/POW(10,PDIFL2));MDIFB3:=INTPART(DIF/POW(10,PDIFL3));直接底背离:=(CL1<CL2 ) AND (MDIFB2>MDIFL2) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB2<=REF(MDIFB2,1);隔峰底背离:=(CL1<CL3 AND CL3<CL2 ) AND (MDIFB3>MDIFL3) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB3<=REF(MDIFB3,1);底部钝化:=直接底背离 OR 隔峰底背离,NODRAW;底背离:=((MDIFB2>REF(MDIFB2,1))*REF(直接底背离,1)) OR ((MDIFB3>REF(MDIFB3,1))*REF(隔峰底背离,1)),NODRAW;STICKLINE(底部钝化,DIF,DEA,1,0),COLORRED;DRAWTEXT(TFILTER(底背离,C<REF(CL1,1),1),DIF*0.98,'底部结构形成'),COLORMAGENTA;金叉:=CROSS(DIF,DEA);M1:=BARSLAST(金叉),NODRAW;{最近一次金叉的位置}M2:=REF(BARSLAST(金叉),M1+1),NODRAW;{倒数第二次金叉与倒数第一次金叉的区间}M3:=REF(BARSLAST(金叉),M2+M1+2),NODRAW;{倒数第三次金叉与倒数第二次金叉的区间}CH1:=HHV(C,M1+1),NODRAW;{最近一次金叉后,最高收盘价}CH2:=REF(CH1,M1+1),NODRAW;{倒数第二次金叉与倒数第一次金叉之间的最高收盘价}DIFH2:=REF(DIFH1,M1+1),NODRAW;CH3:=REF(CH2,M1+1),NODRAW;{倒数第三次金叉与倒数第二次金叉之间的最高收盘价}DIFH3:=REF(DIFH2,M1+1),NODRAW;PDIFH2:=IF(DIFH2>0,INTPART(LOG(DIFH2))-1,INTPART(LOG(-DIFH2))-1);MDIFH2:=INTPART(DIFH2/POW(10,PDIFH2));PDIFH3:=IF(DIFH3>0,INTPART(LOG(DIFH3))-1,INTPART(LOG(-DIFH3))-1);MDIFH3:=INTPART(DIFH3/POW(10,PDIFH3));MDIFT2:=INTPART(DIF/POW(10,PDIFH2));MDIFT3:=INTPART(DIF/POW(10,PDIFH3));直接顶背离:=(CH1>CH2 ) AND (MDIFT2<MDIFH2) AND (MACD>0 AND REF(MACD,1)>0) AND MDIFT2>=REF(MDIFT2,1);隔峰顶背离:=(CH1>CH3 AND CH3>CH2 ) AND (MDIFT3<MDIFH3) AND (MACD>0 AND REF(MACD,1)>0) AND MDIFT3>=REF(MDIFT3,1);顶部钝化:=直接顶背离 OR 隔峰顶背离,NODRAW;顶背离:=((MDIFT2<REF(MDIFT2,1))*REF(直接顶背离,1)) OR ((MDIFT3<REF(MDIFT3,1))*REF(隔峰顶背离,1)),NODRAW;STICKLINE(顶部钝化,DIF,DEA,1,0),COLORGREEN;DRAWTEXT(TFILTER(顶背离,C>REF(CH1,1),1),DIF*1.02,'顶部结构形成'),COLORMAGENTA;DRAWICON(CROSS(DIF,DEA),DEA,36);DRAWICON(CROSS(DEA,DIF),DEA,37);MACDDIF:=IF(ABS(MACD)>ABS(DIF),MACD,DIF);DRAWICON(REF(DIF,1)>REF(DIF,2) AND DIF<REF(DIF,1) ANDDIF>0 AND DIF>DEA,MACDDIF*1.1,39),COLORGREEN;DRAWICON(REF(DIF,1)<REF(DIF,2) AND DIF>REF(DIF,1) AND DIF<0 AND DIF<DEA,MACDDIF*1.1,38),COLORRED;启动点:=MACD<0 AND MACD>REF(MACD ,1) AND REF(MACD ,1)<REF(MACD ,2)AND REF(MACD ,2)<REF(MACD ,3)AND REF(MACD ,3)<REF(MACD ,4);DRAWTEXT(启动点,MACD-0.1,'↑启动点'),COLORFF33FF;GC:=IF(DIF>DEA,DIF,DRAWNULL)COLOR0099FF;A1:=BARSLAST(REF(CROSS('MACD.DIF','MACD.DEA'),1));B1:=REF(C,A1+1)>C AND REF('MACD.DIF',A1+1)<'MACD.DIF' AND CROSS('MACD.DIF','MACD.DEA');DRAWICON(B1>0,LLV(DIF,60)*0.84,1);DRAWTEXT(B1>0,LLV(DIF,60)*0.85,'MACD底背离'),COLOR9900FF;{MACD底背离}MACD底背离:=B1>0 AND LLV(DIF,60)*0.85;C1:=BARSLAST(REF(CROSS('MACD.DEA','MACD.DIF'),1));D1:=REF(C,C1+1)<C AND REF('MACD.DIF',C1+1)>'MACD.DIF' AND CROSS('MACD.DEA','MACD.DIF');DRAWICON(D1>0,HHV(DIF,60)*0.84,2);DRAWTEXT(D1>0,HHV(DIF,60)*0.85,'M顶背离'),COLOR00FF00;{MACD顶背离}A2:=BARSLAST(REF(CROSS('KDJ.K','KDJ.D'),1));B2:=REF(C,A2+1)> C AND REF('KDJ.K',A2+1)<'KDJ.K' AND CROSS('KDJ.K','KDJ.D') {AND 'KDJ.J'<30};DRAWICON(B2>0,LLV(DIF,60)*0.59,1);DRAWTEXT(B2>0,LLV(DIF,60)*0.60,'K底背'),COLORFF33FF;{KDJ底背离}K底背:=B2>0 AND LLV(DIF,60)*0.60;C2:=BARSLAST(REF(CROSS('KDJ.D','KDJ.K'),1));D2:=REF(C,C2+1)<C AND REF('KDJ.K',C2+1)> 'KDJ.K' AND CROSS('KDJ.D','KDJ.K') {AND 'KDJ.J'>70};DRAWICON(D2>0,HHV(DIF,60)*0.59,2);DRAWTEXT(D2>0,HHV(DIF,60)*0.60,'K顶背'),COLORFFFF99;{KDJ顶背离}A3:=BARSLAST(REF(CROSS('RSI.RSI1','RSI.RSI2'),1));B3:=REF(C,A3+1)> C AND REF('RSI.RSI1',A3+1)<'RSI.RSI1' AND CROSS('RSI.RSI1','RSI.RSI2') {AND 'RSI.RSI1'<40};DRAWICON(B3>0,LLV(DIF,60)*0.34,1);DRAWTEXT(B3>0,LLV(DIF,60)*0.35,'RSI底背'),COLOR00FFFF;{RSI底背离}RSI底背:=B3>0 AND LLV(DIF,60)*0.35;C3:=BARSLAST(REF(CROSS('RSI.RSI2','RSI.RSI1'),1));D3:=REF(C,C3+1)<C AND REF('RSI.RSI1',C3+1)> 'RSI.RSI1' AND CROSS('RSI.RSI2','RSI.RSI1') {AND 'RSI.RSI1'>60};DRAWICON(D3>0,HHV(DIF,60)*0.34,2);DRAWTEXT(D3>0,HHV(DIF,60)*0.35,'RSI顶背'),COLORFFCC99;{RSI顶背离}JC:=DEA-DIF;{}绿柱:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);红柱:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);本次最低价:=LLV(L,BARSLAST(JC<0));本次最高价:=HHV(H,BARSLAST(JC>0));X1:=IF (MACD<0,BARSLAST(CROSS(DIF,DEA)),0);前次绿柱:=REF(绿柱,X1+1);前次最低价:=REF(本次最低价,X1+1);Y1:=IF((绿柱<0 AND ABS(绿柱)<ABS(前次绿柱)AND 本次最低价<前次最低价),1,0);RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价AND ABS(绿柱)<ABS(前次绿柱) AND ABS(MACD)<ABS(REF(MACD,1));底背驰:=IF (CROSS(DIF,DEA),REF(Y1,1),0);DRAWICON(底背驰,LLV(DIF,60)*0.1,1);DRAWTEXT(底背驰,LLV(DIF,60)*0.1,'↑柱底背离'),COLOR00CCFF;{柱底背离}X2:=IF(MACD>0,BARSLAST(CROSS(DEA,DIF)),0);前次红柱:=REF(红柱,X2+1);前次最高价:=REF(本次最高价,X2+1);Y2:=IF((红柱>0 AND 红柱<前次红柱AND 本次最高价>前次最高价),1,0);RS2:=MACD>0 AND REF(MACD,1)>0 AND C>前次最高价AND ABS(红柱)<ABS(前次红柱) AND ABS(MACD)<ABS(REF(MACD,1));顶背驰:=IF(CROSS(DEA,DIF),REF(Y2,1),0);DRAWICON(顶背驰,HHV(DIF,60)*0.1,2);DRAWTEXT(顶背驰,HHV(DIF,60)*0.1,'↓柱'),COLORFFCCCC;{柱顶背离};。

通达信MACD和KDJ金叉共振副图指标

通达信MACD和KDJ金叉共振副图指标

一个副图显示两个指标,MACD和KDJ,根据趋势做决策。

DIF:(EMA(CLOSE,6)-EMA(CLOSE,13))*100;DEA:EMA(DIF,5);MACD:(DIF-DEA)*2,COLORSTICK;DRAWICON(CROSS(DIF,DEA),DEA,1);DRAWICON(CROSS(DEA,DIF),DEA,2);IF(DIF<DEA,DIF,DRAWNULL),COLORGREEN;DD:=C=HHV(C,180);EE:=DEA< REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1;CC:=C> REF(C,1) AND REF(C> REF(C,1),1)=1;顶背离:=(DD AND EE AND DEA< HHV(DEA,180))*DEA;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));{顶背:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);} DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORRED,LINETHICK2;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(RSV,9,3),COLORYELLOW;D:SMA(K,9,3),COLORWHITE;J:3*K-2*D,COLORMAGENTA;IF(J<D,J,DRAWNULL),COLORFFEE44;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIF,A1+1)<DIF AND CROSS(DIF,DEA);A22:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A22+1)>C AND REF("KDJ.K"(9,3,3),A22+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));DRAWTEXT(B1,DEA-0.20,'~~~▲~~~MACD底背'),COLORWHITE;DRAWTEXT(B2,D-0.20,'<<●>>KDJ底背'),COLORFF00FF;{DJ:=CROSS(J,D) AND D<20;DRAWTEXT(DJ,J-0.3,'低金叉'),COLORCYAN;MDJ:=CROSS(DIF,DEA) AND DEA<0;DRAWTEXT(MDJ,DEA-0.3,'低金叉'),COLORGREEN;DRAWTEXT(CROSS(DEA,DIF),DIF+0.3,'死叉'),COLORYELLOW;DRAWTEXT(CROSS(D,J),J+0.3,'死叉'),COLORRED;}A:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);DRAWICON(A,LOW*0.98,1);B4:CROSS(DIF,DEA) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));DRAWTEXT(B4,L-0.20,'★金叉共振★'),COLOR0099FF;DRAWICON(CROSS(K,D),D,1);DRAWICON(CROSS(D,K),D,2);BA:=DEA>REF(DEA,1);BB:=SUM(BA,5)>=4;BC:=C<O;BD:=SUM(BC,5)>=2;BXG:FILTER(BB AND BD AND J>REF(J,1) AND REF(J,1)<REF(J,2),3);STICKLINE(BXG,HHV(J,60),HHV(J,60)-20,1,0),COLORRED;SS:=EMA(C,11);LL:=(EMA(C,1)+EMA(C,2)+EMA(C,3)+EMA(C,5))/4;{短:EMA(LL,2),COLORGREEN,LINETHICK2;}{长:EMA(SS,2),COLORMAGENTA,LINETHICK2;}AA:=(C-LLV(C,10))/(HHV(C,10)-LLV(C,10));(CROSS(AA,0.05)-1);。

通达信最强悍的MACD副图指标

通达信最强悍的MACD副图指标

通达信最强悍的MACD副图指标UPD:COUNT(C>=O OR C>=REF(C,1),8) NODRAW;CM60:BARSLAST(LONGCROSS(C,MA(C,60),8))+1 NODRAW COLORRED;DIFF:=EMA(CLOSE,12)-EMA(CLOSE,24);DEA:=EMA(DIFF,9);ADIF:ATAN((DIFF/REF(DIFF,1)-1)*100)*180/3.1416 NODRAW;RADIF:REF(ADIF,1) NODRAW;C2:=IF(V>MA(V,150)*0.98,0.1,-0.1);C1:=IF(V<MA(V,150)*0.98,-0.1,0.1);B2:=EMA(CLOSE,55)-MA(CLOSE,60) DOTLINE COLORGREEN;B3:=EMA(B2,9) DOTLINE COLORCYAN;DRAWBAND(B2,RGB(120,50,50),B3,RGB(50,120,50));MACD:=2*(DIFF-DEA), STICK,LINETHICK1 COLORCYAN;N:=20;MID:=MA(C,20);VART1:=POW((C-MID),2);VART2:=MA(VART1,N);VART3:=SQRT(VART2);UPPER:=MID+2*VART3;LOWER:=MID-2*VART3;BOLL:=REF(MID,1),COLORGREEN;UB:=REF(UPPER,1),COLOR00FFFF;LB:=REF(LOWER,1),COLOR00FFFF NODRAW;BLTJ:=REF(L,1)<REF(LB,1) AND L>LB;BLLDT:BARSLAST(BLTJ ) NODRAW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));A1:=BARSLAST(REF(CROSS(DIFF,DEA),1)) COLORRED NODRAW;底背离:REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA) NODRAW;STICKLINE(底背离,0,0.03,1.2,1),COLOR00FF00;{底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2 CROSSDOT;} DRAWTEXT(底背离,0.1,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1)) ;顶背离:REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF) CROSSDOT COLORRED NODRAW;{顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2 CROSSDOT;}底背D:BARSLAST(底背离)+1 NODRAW COLORRED;顶背D:A2+1 COLORGREEN NODRAW;{判断天地量}AA:=SUMBARS(VOL,CAPITAL);地量:=VOL<MA(VOL,AA)*21/100 AND VOL>0;天量:=VOL>MA(VOL,AA)*34/10 ;MACDA:2*(DIFF-DEA), STICK,LINETHICK1 COLORCYAN;NOTEXT3:IF(地量 AND PERIOD>4,MACD*1.5,DRAWNULL) STICK LINETHICK6 COLORYELLOW;NOTEXT4:IF(天量 AND PERIOD>4,MACD*1.5,DRAWNULL) STICK LINETHICK6 COLORAAAAFF;NOTEXT5:IF(V<=MA(V,5)*0.22,MACD,DRAWNULL) STICK LINETHICK4 COLORBLUE; NOTEXT:IF(REF(MACD,1)<=MACD,MACD,DRAWNULL) STICK COLORRED; NOTEXT1:0 LINETHICK3 COLORGRAY;NOTEXT8:IF(V>MA(V,150)*0.98,0,DRAWNULL) COLORRED LINETHICK2 CIRCLEDOT ;DEAA:DEA COLORYELLOW;DIFA:DIFF COLORWHITE ;DIFF1:EMA(CLOSE,12)-EMA(CLOSE,26) DOTLINE COLORGREEN NODRAW;DEA1:EMA(DIFF1,9) DOTLINE COLORCYAN NODRAW;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2 CROSSDOT;顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2 CROSSDOT;强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED LINETHICK2;弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA LINETHICK2;必买: DRAWICON(REF(TROUGHBARS(3,15,1),1)=0 AND HIGH>LOW,0,25),COLORRED,LINETHICK4;必卖: DRAWICON(REF(PEAKBARS(3,15,1),1)=1,0,27),COLORRED,LINETHICK8;B1:A1 NODRAW;TOP:A2 NODRAW;BSR:((BIDORDERVOL-BIDCANCELVOL)/(OFFERORDERVOL-OFFERCANCELVOL)-1)*10 NODRAW;NOTEXTBRS:IF(BSR>0,DEA,DRAWNULL) COLORFFFFFF LINETHICK2 CIRCLEDOT; HSJ:=BARSLAST(CROSS(DIFF,0) AND DIFF>=0 )+1 NODRAW;LSJ:=BARSLAST(CROSS(0,DIFF) AND DIFF<0 )+1 NODRAW;T:IF(DIFF>0,HSJ,LSJ) NODRAW;IF(T=1,ABS(MACD),0) STICK LINETHICK2 COLORMAGENTA;IF(CROSS(DEA,0),ABS(MACD),0) STICK LINETHICK2 COLORYELLOW;S:IF(HSJ>1,SUM(ABS(MACD),T),DRAWNULL) NODRAW ;DRAWNUMBER(ISLASTBAR ,ABS(MACD*1.02),S) COLORYELLOW;DRAWNUMBER(T=1 ,ABS(MACD*1.02),REF(S,1)) ;T2:REF(T,T)+T NODRAW;Q1S:REF(S,T) NODRAW;Q2S:=REF(S,T2) NODRAW;BL:=Q1S/Q2S NODRAW;{E2T:BARSLAST(CROSS(DIF,DEA) AND FILTER(CROSS(DIF,DEA) ,5) )+1 NODRAW;E6T:BARSLAST(CROSS(DEA,DIF) AND FILTER(CROSS(DEA,DIF) ,5) )+1 NODRAW; ET:IF(DIF>=DEA,E2T,E6T) NODRAW;ES:SUM(ABS(DIF-DEA),ET) NODRAW;BZ:=MAX(ABS(DEA),ABS(DIF));XS:=IF(DIF<0,-1,1);IF(ET=1,DIF,DRAWNULL) CIRCLEDOT LINETHICK2;DRAWNUMBER(ISLASTBAR ,DIF*1.05,ES) COLORYELLOW;DRAWNUMBER(ET=1 ,BZ*XS*1.05,REF(ES,1)) COLORYELLOW;};TTJ:=IF(BARSLAST(顶背离=1)+1=144 OR BARSLAST(顶背离=1)+1=89 OR BARSLAST(顶背离=1)+1=13 OR BARSLAST(顶背离=1)+1=47 OR BARSLAST(顶背离=1)+1=1 OR BARSLAST(顶背离=1)+1=8 OR BARSLAST(顶背离=1)+1=21 OR BARSLAST(顶背离=1)+1=34 OR BARSLAST(顶背离=1)+1=55,1,O) ;TTJA:=IF( BARSLAST(底背离=1)+1=144 OR BARSLAST(底背离=1)+1=89 OR BARSLAST(底背离=1)+1=8 OR BARSLAST(底背离=1)+1=1 OR BARSLAST(底背离=1)+1=47 OR BARSLAST(底背离=1)+1=13 OR BARSLAST(底背离=1)+1=21 OR BARSLAST(底背离=1)+1=34 OR BARSLAST(底背离=1)+1=55,1,O) ;DRAWNUMBER((BARSLAST(顶背离=1)+1<144 AND TTJ=1 AND CURRBARSCOUNT<233) OR ISLASTBAR,MIN(DIFF,DEA)*0.98,BARSLAST(顶背离=1)+1) COLORGREEN;DRAWNUMBER((BARSLAST(底背离=1)+1<144 AND TTJA=1 AND CURRBARSCOUNT<233)OR ISLASTBAR,0,BARSLAST(底背离=1)+1) COLORYELLOW;。

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

好厉害的MACD背离(通达信副图指标)DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;持仓段:=0,COLOR00CFFF;空仓段:=0,COLORFFCCFF;STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORFFCCFF;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(((MACD<REF(MACD,1)) AND(MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;STICKLINE(((MACD>REF(MACD,1)) AND(MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1; DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4; DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); 顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;。

通达信指标——新MACD(副图)

通达信指标——新MACD(副图)

{SHORT:1,500,12 LONG:1,500,26 M:1,500,9}DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),LINETHICK0;DEA : EMA(DIFF,M),LINETHICK0;DRAWBAND(DIFF,RGB(155,50,50),DEA,RGB(0,100,50));力:2*(DIFF-DEA),NODRAW;MACD : 2*(DIFF-DEA), COLORSTICK,LINETHICK2;DD:=C=HHV(C,180);EE:=DEA < REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1;CC:=C > REF(C,1) AND REF(C > REF(C,1),1)=1;DRAWICON(CC AND EE,0.1,11);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=IF(REF(CLOSE,A1+1) > CLOSE AND DIFF > REF(DIFF,A1+1) AND CROSS(DIFF,DEA),1.2,DRAWNULL),COLORRED,LINETHICK4,CROSSDOT;势:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED LINETHICK2;DRAWICON(DD AND EE AND DEA< HHV(DEA,180),0.1,2);A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF),COLORWHITE;压:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN LINETHICK2;FF:=C=LLV(C,180);GG:= DEA > REF(DEA,1) AND REF(DEA > REF(DEA,1),1)=1;LL:=C < REF(C,1) AND REF(C< REF(C,1),1)=1;DRAWICON(LL AND GG,-0.1,16);DRAWICON(FF AND GG AND DEA> LLV(DEA,180),-0.3,9);MM:=IF(MACD < 0,MACD,0);JJ:=MM> REF(MM,1);ZZ:=REF(JJ,1)=1;介入区:(JJ AND ZZ)*DEA,POINTDOT,COLORFFFFFF;{MACD蓝柱缩短---指今日比昨天短}STICKLINE(介入区=DEA,DEA,DIFF,0,0),COLORFFFFFF;STICKLINE(MACD0,0,MACD,0,0),COLORFF00FF;STICKLINE(MACD < 0,0,MACD,0,0)COLOR00FF00;STICKLINE(MACD > REF(MACD,1)AND MACD,0,MACD,0,0),COLORYELLOW; STICKLINE(MACD > REF(MACD,1)AND MACD > 0,0,MACD,0,0),COLORRED;持:IF(DIFF >= DEA,DIFF,DRAWNULL),COLORRED;观:IF(DEA >= DIFF,DEA,DRAWNULL),COLORFF9900;股:IF(DIFF >= DEA,DEA,DRAWNULL),COLOR00FFFF;望:IF(DEA >= DIFF,DIFF,DRAWNULL),COLOR00FF00;AA:=BARSLAST(REF(CROSS(DIFF,DEA),1));BB:=REF(CLOSE,AA+1) > CLOSE AND DIFF > REF(DIFF,AA+1) AND CROSS(DIFF,DEA); 进:DRAWLINE(AA=0,DEA,BB,DEA,0),COLOR0000FF;STICKLINE(BB,0,0.1,0,1),COLORFFFFFF;火:=BARSLAST(EMA(CLOSE,5) < REF(EMA(CLOSE,5),1)),NODRAW;山:=COUNT(EMA(CLOSE,5) > REF(EMA(CLOSE,5),1),5),COLORGREEN;DRAWTEXT(REF(火,3) > 0 AND REF(火,2) > 0 AND REF(火,1) > 0 AND 火=0 AND REF(火,1) > 山,DIFF,'●'),COLORRED;DRAWTEXT(REF(火,3) > 0 AND REF(火,2) > 0 AND REF(火,1) > 0 AND 火=0 AND REF(火,1) > 山,DIFF,'¤'),COLORYELLOW;STICKLINE(REF(山,1)=0 AND 山> 0,0,0.1{-1},5,2),COLORRED;DRAWTEXT(REF("KDJ.J",1) < 0 AND "KDJ.J" > 0,DIFF,'短'),COLORRED ;。

【股票指标公式下载】-【通达信】立体MACD(副图)

【股票指标公式下载】-【通达信】立体MACD(副图)

【通达信】立体MACD(副图)-指标公式源码A1:=100*(EMA(C,12)-EMA(C,26))/EMA(C,26);A2:=EMA(A1,9);MACD:(A1-A2)*2,NODRAW;STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,3,0),COLOR0000AA;{红色} STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLOR0000CC; STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLOR0000EE; STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,0.1,0),COLOR5555FF; STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,0,0),COLOR8080FF; STICKLINE(MACD>=0 AND MACD<REF(MACD,1),0,MACD,3,0),COLOR770077;{紫色} STICKLINE(MACD>=0 AND MACD<REF(MACD,1),0,MACD,2,0),COLOR990099; STICKLINE(MACD>=0 AND MACD<REF(MACD,1),0,MACD,1,0),COLORBB00BB; STICKLINE(MACD>=0 AND MACD<REF(MACD,1),0,MACD,0,0),COLORDD00DD; STICKLINE(MACD>=0 AND MACD<REF(MACD,1),0,MACD,0.1,0),COLORFF00FF; STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,3,0),COLORFF0000;{蓝色} STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORFF5500; STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORFF9900; STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,0,0),COLORFFFF00; STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,3,0),COLOR155500;{绿色} STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,2,0),COLOR208000; STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,1,0),COLOR2BAA00; STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,0.1,0),COLOR35D500; STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,0,0),COLOR40FF00;DIF:A1,COLORWHITE;DEA:A2,COLORYELLOW;DD:=EMA(EMA((C-LLV(L,10))/(HHV(H,10)-LLV(L,10))*100,3),3);关注:IF(DD<30 AND MACD<0 ANDMACD>=REF(MACD,1),MACD*0.5,DRAWNULL)CIRCLEDOT,COLORMAGENTA;A3:=BARSLAST(REF(CROSS(DIF,DEA),1));DRAWTEXT(REF(CLOSE,A3+1)>CLOSE AND DIF>REF(DIF,A3+1) ANDCROSS(DIF,DEA),-3,'DB');RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;K:SMA(RSV,3,1)NODRAW,COLORYELLOW;D:=SMA(K,3,1);J:3*K-2*D,NODRAW,COLORYELLOW;【通达信】立体MACD(副图)-指标公式效果图(文档来源:若水财经社区)。

通达信指标公式源码 MACD精品副图源码

通达信指标公式源码 MACD精品副图源码

{改良MACD}LC:=REF(C,1);预量:=IF(ISLASTBAR,V*240/FROMOPEN,V),NODRAW;量比:=预量/MA(REF(V,1),5),NODRAW;JJ:=(L+H+C*2)/4;DI:(EMA(C,12)-EMA(C,26))/C*500,COLORFF00FF;DE:EMA(DI,9),LINETHICK1,COLORFFFFFF;STICKLINE(DI>REF(DI,1) AND DI>DE AND MA(C,20)>REF(MA(C,20),1),-15,15,1,0),COLOR000066;MACD:(DI-DE)*2,COLORSTICK,COLORFFAA00;金:IF(((MACD<=-50 OR (MACD<=-30 AND MA(C,11)>REF(MA(C,11),1) AND MA(C,20)>REF(MA(C,20),1)AND MA(C,60)>REF(MA(C,60),1)) AND (H>LC OR C<LLV(LC,6)*0.98) AND C=LLV(C,10) AND (L=LLV(L,15)OR C<LLV(L,15)*1.015))) AND 预量<REF(V,1) AND 预量<MA(V,5) AND H<LLV(REF(L,1),2)*1.06 AND C>LC*0.9014 AND H>LC AND C<L*1.025,48,0),LINETHICK2,COLOR00FFFF; 银:IF(LLV(MACD,8)<-40 AND (C=LLV(C,11) OR L=LLV(L,11)) ANDDOWNNDAY(C,2) AND NDAY(O,C,2) AND 预量<REF(V,1) AND 预量<MA(V,5) AND C>LC*0.9015AND H<REF(H,1) AND H<LLV(REF(L,1),2)*1.06 AND C<L*1.02,45,0),LINETHICK4,COLORFFFFFF,STICK;低:IF(MACD<-26 AND HHV(DE,10)-DE>25 AND HHV(DI,250)<10 AND ((C=LLV(C,11) AND (L=LLV(L,15) OR C<LLV(L,15)*1.015)) OR (L<MA(C,5)*0.9 AND MA(C,5)/C>1.05)) AND H>LC ANDC<MA(C,5)*0.96AND H>LC AND C<L*1.025 AND H<LLV(REF(L,1),2)*1.06 AND C>LC*0.9014 AND预量<REF(V,1),38,0),LINETHICK2,COLOR0099FF;买:IF((LLV(DI,5)<-50) AND C<LLV(REF(L,1),10) AND H<LLV(REF(L,1),2)*1.06 AND C<L* 1.015 AND C>LC*0.9014 AND PERIOD=5 AND 预量<HHV(V,10),32,0),LINETHICK2,COLORFF00FF;抢:IF(LLV(MACD,10)<-16.2 AND HHV(DI,250)<10 AND C<MA(C,10)*0.92 AND L<MA(C,5)*0.88 ANDC<MA(C,5)*0.947 AND H>LC AND C=LLV(C,10) AND (L=LLV(L,10) OR C<LLV(L,10)*1.015) AND C<L*1.01 AND V<HHV(V,10) AND C>LC*0.901 AND H<LLV(REF(L,1),2)*1.06 AND H>LC AND C<L*1.025,30,0), LINETHICK2,COLORFF99FF;低2:IF(((MACD<-35 AND C<LLV(REF(L,1),10) AND C<L*1.02 AND H<LLV(REF(L,1),2)*1.06) OR((LLV(MACD,10)<-20 OR LLV(DE,10)<-30) AND C>400)) AND C=LLV(C,10) AND L=LLV(L,10),15,0),LINETHICK3,STICK,COLORFFAA00;买2:IF((HHV(REF(金,1),12)=10 AND C=LLV(C,10) AND (L=LLV(L,15) OR C<LLV(L,15)*1.015) ANDH>LC AND C>LC*0.9014) AND C*1.025>H AND H>LC AND C<L*1.025 AND H<LLV(REF(L,1),2)*1.06,-MACD,0),LINETHICK2,COLORCC00FF;高:IF(MACD>35 AND MACD>REF(MACD,1) AND C<LC*1.0985,-5,DRAWNULL),LINETHICK6,CROSSDOT,COLOR00FF00;卖:IF(HHV(MACD,4)>=42 AND (C=HHV(C,10) AND ((H=HHV(H,10) OR H>LC*1.07) OR C<MA(C,20)))AND (L<LC OR C>MA(C,5)*1.15) AND C<LC*1.0985,-10,0),STICK,LINETHICK3,COLOR00CC00;危:IF(HHV(MACD,7)>42 AND C=HHV(C,10) AND H=HHV(H,10) AND C<LC*1.0985 AND PERIOD=5,-10,0),LINETHICK3,STICK,COLORFFFFFF;大盘危:IF(HHV(MACD,8)>15 AND C>400 AND C<LC*1.0985 AND C=HHV(C,10) AND H=HHV(H,10),-15,0),COLORFFFFFF,LINETHICK4,STICK;DRAWICON(LLV(MACD,5)<-30 AND C>LC*0.9014 AND C<=O AND C=LLV(C,10) AND L=LLV(L,10),MACD,9);DRAWTEXT_FIX(ISLASTBAR AND DI>REF(DI,1) AND DI>DE AND C>MA(C,20),0.97,0.05,1,'上涨持股'),COLORYELLOW;。

通达信指标公式源码 超前MACD优化版 副图源码

通达信指标公式源码 超前MACD优化版 副图源码

DIFF:EMA(CLOSE,7) - EMA(CLOSE,19);DEA:EMA(DIFF,9);MACD:6*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;KDJ底背:IF(B2>0,-0.1,0),COLORCC0055,POINTDOT;RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;STICKLINE(B1>0,-0.2,0,2.5,1),COLORMAGENTA;STICKLINE(B2>0,-0.16,0,3.5,1),COLORCC0066;STICKLINE(B3>0,-0.18,0,5,1),COLORYELLOW;STICKLINE(D1>0,0.2,0,2.5,0),COLOR00FF00;STICKLINE(D2>0,0.18,0,3.5,0),COLORFFCC66;STICKLINE(D3>0,0.16,0,6,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,1),COLORRED; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0,1),COLORCYAN; STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,1),COLORGREEN; STICKLINE(MACD>=REF(MACD,1) AND MACD<0,0,MACD,1,1),COLORMAGENTA; STICKLINE(C>0,0,0,50,1),COLORBLUE;DIFF,COLORGREEN;DEA,COLORYELLOW;强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED;弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA;{大盘神针}UAR1:=INDEXA/100000000;UAR2:=INDEXADV;UAR3:=INDEXDEC;UAR4:=UAR2/(UAR2+UAR3);UAR5:=UAR3/(UAR2+UAR3);UAR6:=EMA(UAR4,3);UAR7:=EMA(UAR5,3);UAR8:=EMA(UAR6,5);UAR9:=EMA(UAR7,5);进场资金: EMA(UAR8,10)/150 ;资金: EMA(UAR9,10)/150;大盘神针:=(SMA(MAX(CLOSE-REF(CLOSE,1),0),7,1)/SMA(ABS(CLOSE-REF(CLOSE,3)),7,1)*100< 20ANDSMA(MAX(CLOSE-REF(CLOSE,3),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,3)),13,1)*100<25 AND MA((LLV(LOW,45)-CLOSE)/(HHV(HIGH,45)-LLV(LOW,45))*100,5)>-19AND (LOW>LLV(LOW,5) AND (CLOSE-HHV(CLOSE,8))/HHV(CLOSE,8)<-0.05 ANDMA(AMOUNT,125)/MA(VOL,125)/(MA(AMOUNT,5)/MA(VOL,5))>1.12))*0.75;买入:=BARSLAST(大盘神针)<15 AND CROSS(MACD.DIF,MACD.DEA);底:=BARSLAST(LLV(L,4)=LLV(L,120))<5 ;均线买:=CROSS(MA(C,5),MA(C,20));买:=(底AND 均线买AND (进场资金>资金) OR 买入);STICKLINE(买,资金-1.35,资金-1.5,2,0),COLORYELLOW;DRAWTEXT(买,资金-1.28,'买'),COLORYELLOW;安全区:STICKLINE(底,资金-0.01,资金,0.04,1),COLORRED;{黄雀}短线趋势:=(EMA(C,7) - EMA(C,13));中线趋势:=EMA(短线趋势,13);VAR4:=MA(C,7);VAR5:=MA(C,13);VAR6:=MA(C,34);VAR7:=MA(C,55);VAR10:=((0 - ((10 * (HHV(C,5) - C)) / (HHV(C,5) - LLV(L,5)))) + 10);VAR11:=((0 - ((10 * (HHV(C,13) - C)) / (HHV(C,13) - LLV(L,13)))) + 10);VAR12:=((0 - ((10 * (HHV(C,21) - C)) / (HHV(C,21) - LLV(L,21)))) + 10);VAR13:=((0 - ((10 * (HHV(C,34) - C)) / (HHV(C,34) - LLV(L,34)))) + 10);VAR14:=REF(中线趋势,1);VAR15:=中线趋势;VAR16:=(VAR15 - VAR14);VAR17:=REF(短线趋势,1);VAR18:=短线趋势;VAR19:=(VAR18 - VAR17);VARE:=(SUM(((C * VOL) * 10),34) / SUM((VOL * 200),34));VARF:=(INTPART((VARE * 10)) / 10);吃货:(((((((O<= VAR4) AND (O<= VAR5)) AND (O<= VAR6)) AND (C>= VAR4)) AND (C>= VARF)) AND (VAR16 > 0)) AND (VAR19 > 0)),LINETHICK0;DRAWBAND (0>吃货,RGB(0,0,0),0<吃货,RGB(200,0,10)),NODRAW;STICKLINE (吃货,-1.75,-1.60,5,1),COLORCC0099;{抄}STICKLINE((DMI.PDI(14,6)<5 AND DMI.ADX(14,6)>70),1.5,-1.5,0,-1),COLORRED; DRAWTEXT (抄,-1.58,'抄'),COLORRED;{一阳二阴}VAR1:=3;VAR2:=((3 * SMA((((CLOSE - LLV(LOW,89)) / (HHV(HIGH,89) - LLV(LOW,89))) * 100),5,1))- (2 * SMA(SMA((((CLOSE - LLV(LOW,89)) / (HHV(HIGH,89) - LLV(LOW,89))) * 100),5,1),3,1)));大赚小赔:1.5*IF(CROSS(VAR2,VAR1),-0.89,-1),COLORRED,LINETHICK1;{黄金坑}RR8:=MA(CLOSE,27);RR9:=(CLOSE-RR8)/RR8*100;RRA:=MA(RR9,2);RRB:=BARSLAST(CROSS(-10,RRA)=1);RRD:=RRA<-10 AND RRB>3;黄金坑:0.01*IF(RRD,-300,1),COLORYELLOW,LINETHICK2;{神秘买点}SM01:=MA((2*C+H+L)/4,5);SM02:=SM01*(200-102)/100;SM03:=(1-7/100)*DMA(C,ABS((2*C+H+L)/4-MA(C,20))/MA(C,20));SM04:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;SM05:=3*SMA(SM04,3,1)-2*SMA(SMA(SM04,3,1),3,1);SM06:=((H+L+C)/3-MA((H+L+C)/3,14))/(0.015*AVEDEV((H+L+C)/3,14));SM07:=SM02<SM03&&SM05>REF(SM05,1)&&REF(SM05,1)<REF(SM05,2)&&SM06<-100 &&SM06>REF(SM06,1);神秘买点:IF(SM07*0.35,-1.3,-1.5),COLORCC0099,LINETHICK1;{止盈}转折周期:=7;转折灵敏:=50;TTR:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),转折周期,1);HD:=HIGH-REF(HIGH,1);LD:=REF(LOW,1)-LOW;DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),转折周期,1);DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),转折周期,1);正DI:=DMP*100/TTR,COLORRED;负DI:=DMM*100/TTR,COLORGREEN;转折点:SMA(ABS(负DI-正DI)/(负DI+正DI)*100,转折周期,1),NODRAW;转折点A:=FILTER(转折点<REF(转折点,1)-1.3 AND EVERY(REF(转折点,1)>=REF(转折点,2)-1.3,5) AND REF(转折点,1)>转折灵敏,5);STICKLINE(转折点A AND REF(正DI>负DI,1),1.5,-1.5,0,-1),COLORGREEN; DRAWTEXT (转折点A AND REF(正DI>负DI,1),1.45,'止'),COLORGREEN;顶:1.5*IF(LAST(MA(C,5)>MA(C,10),5,0) AND "I"<REF("I",1) AND CROSS(100,"I"),0.9,1),COLORWHITE;N:=38;N1:=5;N2:=13;WAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;X: SMA(WAR1,7,1),LINETHICK1,NODRAW;WAR2:=SMA(X,5,1);Y: IF(CROSS(X,WAR2) AND CROSS(MA(C,N1),MA(C,N2) AND X>50) ,WAR2*2,WAR2),COLORYELLOW,NODRAW;WAR4:= EMA(CLOSE,8);WAR5:= EMA(CLOSE,20);黑码上山:IF(CROSS(MA(CLOSE,1),MA(CLOSE,N)) AND X-Y>2 AND WAR4>WAR5 ,WAR2*2,WAR2),COLOR00FF00,NODRAW;入:=(CROSS(MA(CLOSE,1),MA(CLOSE,N)) AND X-Y>2 AND WAR4>WAR5 );排序:IF(入>0,2,0), STICK,COLORCC0099;DRAWICON(排序>0,2,1);STICKLINE(X>WAR2,X,Y,0,0), , COLORF00FF0,NODRAW;STICKLINE(X<WAR2,X,WAR2,0,0), ,COLOR00FF00,NODRAW ;。

通达信-【优化macd】副指标源码

通达信-【优化macd】副指标源码

通达信-【优化macd】副指标源码通达信-【优化macd】副指标源码副图指标源码DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);DIF:EMA(CLOSE,12)-EMA(CLOSE,26),LINETHICK2;DEA:EMA(DIF,9),COLORWHITE;MACD:(DIF-DEA)*2,NODRAW;DRAWBAND(DIF,RGB(150,20,20),DEA,RGB(10,150,20));DRAWBAND(IF(DIF,DIF,DRAWNULL),RGB(250,250,250),DIF,R GB(0,0,0));DRAWBAND(IF(DEA,DEA,DRAWNULL),RGB(250,250,10),DEA, RGB(0,0,0));STICKLINE(MACD>0,0,MACD,1,0),COLORRED;STICKLINE(MACD<0,0,MACD,1,0),COLORGREEN;STICKLINE(MACD>0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLORYELLOW;STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORWHITE;FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;FH5:=FH1 AND FH2 AND MACD<0.10;VV:=CLOSE>OPEN AND MA(CLOSE,5)>MA(CLOSE,10) AND MA(CLOSE,10)>MA(CLOSE,30)AND DIFF>DEA AND MACD>REF(MACD,1) AND DIFF>0 AND DEA>0 ANDMA(VOL,5)>MA(VOL,34) ANDMA(CLOSE,30)>=REF(MA(CLOSE,30),1);佛手:IF(VV,1,0),NODRAW;DRAWICON(佛手,0.06,11);二次翻红:(FH3 OR FH4 OR FH5),COLORRED,NODRAW;低买:CROSS(DIF,DEA) AND DIF<0,COLORFF00FF,NODRAW;加油:CROSS(DIF,DEA) AND DIF>0,COLORYELLOW,NODRAW;DRAWICON(二次翻红,-0.05,1);DRAWTEXT(二次翻红,-0.15,'翻红'),COLORRED;DRAWTEXT(CROSS(DIF,DEA) AND DIF<0,DEA-0.02,'低买'),COLORFF00FF;DRAWTEXT(CROSS(DIF,DEA) AND DIF>0,DEA-0.05,'加油'),COLORYELLOW;XG:二次翻红 OR 低买 OR 加油,NODRAW;YLZC:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDE XO)/4,AMOUNT/(VOL+0.01)/100);阻价:=IF(CLOSE=INDEXC,YLZC+INDEXC-INDEXL,YLZC+(CLOSE-LOW));支价:=IF(CLOSE=INDEXC,INDEXL+INDEXC-YLZC,LOW+(CLOSE-YLZC));今压:REF(阻价,1),LINETHICK0,COLORAA11BB,NODRAW;今撑:REF(支价,1),LINETHICK0,COLOR009900,NODRAW;明压:阻价,LINETHICK0,NODRAW;明撑:支价,LINETHICK0,NODRAW;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1) ;DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;B1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,B1+1)>CLOSE AND DIFF>REF(DIFF,B1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;B2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,B2+1)<CLOSE AND REF(DIFF,B2+1)>DIFF AND CROSS(DEA,DIFF);DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;入1:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;入2:IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLOR00FF00,LINETHICK2;E3:=EMA(DIF,3);E5:=EMA(DIF,5);E10:=EMA(DIF,10);E20:=EMA(DIF,20);E60:=EMA(DIF,60);E120:=EMA(DIF,120);E240:=EMA(DIF,240);E480:=EMA(DIF,480);E960:=EMA(DIF,960);E1920:=EMA(DIF,1920);EE:=(E3*3+E5*5+E10*10+E20*20+E60*60+E120*120+E240* 240+E480*480+E960*960+E1920*1920)/3818;EE1:=(E3*3+E5*5)/8;EE2:=(E20*20+E60*60+E120*120+E240*240+E480*480)/920;EE3:=(E3*3+E5*5+E10*10)/18;CE1:=((((EE2+EE3)/2+DIF)/2+DIF)/2+DIF)/2;TT:EE2*(1+0.01*344),CIRCLEDOT,COLOR0000FF;公:DRAWNULL,COLORCCCCCC;众:DRAWNULL,COLORCCCCCC;号:DRAWNULL,COLORCCCCCC;股市客栈:DRAWNULL,COLORCCCCCC;。

通达信2指标——MACD画线(副图)

通达信2指标——MACD画线(副图)
DRAWICON(D1,OBV,1);
DRAWICON(D2,OBV,2);
当满足条件d1时在obv位置画直线起点当满足条件s11时在obv位置画直线终点1表示是否延长
{MACD画线}
{OBV:=DIF; short:12 long:26 mid:9}
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
{当满足条件D1时,在OBV位置画直线起点,
当满足条件S11时,在OBV位置画直线终点,1表示是否延长.,画黄色}
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,OBV,U11,OBV,1),COLOR00FF00;
STICKLINE(C>0,下,下,1,0),COLOR00FF00;
STICKLINE(C>0,上,上,1,0),COLORFF00FF;
DRAWTEXT(CROSS(OBV,上*1.01),上,'上'),COLORYELLOW;
DRAWTEXT(CROSS(下*0.99,OBV),下,'下'),COLORYELLOW;
OBV:=DIF;
P:=5;
A1:=REF(OBV,P)=HHV(OBV,2*P+1);{A1赋值:P日前的OBV=2*P+1日内OBV的最高值}
B1:=FILTER(A1,P);{A1的P日过滤}
C1:=BACKSET(B1,P+1);{若B1则将最近P+1周期置为1}

通达信指标公式源码 macd副图指标,逃顶抄底,买卖利器

通达信指标公式源码 macd副图指标,逃顶抄底,买卖利器

RSV:=(CLOSE-LLV(LOW,11))/(HHV(HIGH,11)-LLV(LOW,11))*100;DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA1:=EMA(DIFF,9);MACD1:=2*(DIFF-DEA1),COLORSTICK,LINETHICK2;趋势:=MA(MACD,1);DRAWICON(MACD1>REF(MACD1,1) AND 趋势>0 ,趋势,1);低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=(3*K-2*D);DRAWTEXT(二次金叉,DEA*1,'低二叉'),COLORYELLOW;周DIF:="MACD.DIF#WEEK"(12,26,9);周DEA:="MACD.DEA#WEEK"(12,26,9);周MACD:="MACD.MACD#WEEK"(12,26,9);DIF周金叉:=CROSS(周DIF,周DEA);DRAWTEXT(DIF周金叉,0,'周叉'),COLORYELLOW;DRAWTEXT(CROSS(周DEA,周DIF),0,'周死'),COLORGREEN;MACD周金叉:=CROSS(周MACD,周DIF) AND 周MACD>=(0-0.05) AND 周MACD<=0.02; VARR:=EMA(EMA(CLOSE,13),13);控盘:=(VARR-REF(VARR,1))/REF(VARR,1)*1000;A10:=CROSS(控盘,0);控盘B:=FILTER(IF(A10,1,0),5);JJ:=DYNAINFO(11);P:=55;S:=8;M1:=3;刘:=(EMA(CLOSE,S)-EMA(CLOSE,P))*10;剑:=EMA(刘,M1);BTJ11:=(C-JJ)/JJ<-0.03;BTJ2:=控盘>REF(控盘,1) AND 控盘<-0.2;BTJ3:=CROSS(刘,剑) AND 刘<-0.3;BTJ811:=FILTER(BTJ11 AND BTJ2 AND BTJ3,13);庄:= BTJ11 AND BTJ2 AND BTJ3;有庄:=FILTER(庄,55),COLORWHITE;DRAWTEXT(BTJ811,-0.2,'★有庄'),COLORYELLOW;DRAWTEXT(CROSS(J,-3),DIF,'出击'),COLORWHITE;A1:=BARSLAST(REF(CROSS(EMA(CLOSE,12)-EMA(CLOSE,26),EMA(EMA(CLOSE,12)-EMA( CLOSE,26),9)),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND EMA(CLOSE,12)-EMA(CLOSE,26)>REF(EMA(CLOSE,12)-EMA(CLOSE,26),A1+1) AND CROSS(EMA(CLOSE,12)-EMA(CLOSE,26),EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9));底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORMAGENTA,LINETHICK2;A2:=BARSLAST(REF(CROSS(EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9),EMA(CLOSE,12)-E MA(CLOSE,26)),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(EMA(CLOSE,12)-EMA(CLOSE,26),A2+1)>EMA(CLOSE,12)-EMA(CLOSE,26) AND CROSS(EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9),EMA(CLOSE,12)-EMA(CLOSE,26));顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档