自用多周期共振MACD副图源码通达信指标公式源码
通达信MACD多周期指标共振副选指标
通达信MACD多周期指标共振副选指标通达信 MACD多周期指标共振副选指标MACD月副图源码D:=DAY<=REF(DAY,1);F22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(D,2),1) OR ISLASTBAR);SC:=BARSLAST(F22);XCC:=IF(REFX(F22,12)=1,12,IF(R EFX(F22,13)=1,13,IF(REFX(F22,14)=1,14,IF(REFX(F22,15)=1,15,IF( REFX(F22,16)=1,16,IF(REFX(F22,17)=1,17,IF(REFX(F22,18)=1,18,IF (REFX(F22,19)=1,19,IF(REFX(F22,20)=1,20,IF(REFX(F22,21)=1,21,I F(REFX(F22,22)=1,22,0)))))))))));XC:=IF(REFX(F22,1)=1,1,IF(REFX(F 22,2)=1,2,IF(REFX(F22,3)=1,3,IF(REFX(F22,4)=1,4,IF(REFX(F22,5)= 1,5,IF(REFX(F22,6)=1,6,IF(REFX(F22,7)=1,7,IF(REFX(F22,8)=1,8,IF( REFX(F22,9)=1,9,IF(REFX(F22,10)=1,10,IF(REFX(F22,11)=1,11,XCC )))))))))));O1:=IF(F22=1,REF(O,REF(BARSLAST(F22),1)),DRAWNULL );H1:=IF(F22=1,HHV(H,REF(BARSLAST(F22)+1,1)),DRAWNULL);L1 :=IF(F22=1,LLV(L,REF(BARSLAST(F22)+1,1)),DRAWNULL);C1:=IF( F22=1,C,DRAWNULL),NODRAW;CC:=REF(BARSLAST(F22)+1,1);D IF2:=IF(F22=1,EMA(C1,SHORT)-EMA(C1,LONG),DRAWNULL);DEA2:=IF(F22=1,EMA(DIF2,MID),DR AWNULL);M:=IF(F22=1,(DIF2-DEA2)*2,DRAWNULL),COLORSTICK;SCMACD:=REF(M,SC);XCMA CD:=REFX(M,XC);SCDIF:=REF(DIF2,SC);XCDIF:=REFX(DIF2,XC);SC DEA:=REF(DEA2,SC);XCDEA:=REFX(DEA2,XC);DIF:IF(F22=0,(SCDI F-XCDIF)/(SC+XC)*XC+XCDIF,DIF2),LINETHICK1;DEA:IF(F22=0,(SC DEA-XCDEA)/(SC+XC)*XC+XCDEA,DEA2);MACD:IF(F22=0,(SCMACD-XCMACD)/(SC+XC)*XC+XCMACD,M),COLORSTICK;STICKLINE(F2 2=1 AND M>0,0,M,0.5,0),COLORRED;STICKLINE(F22=1 ANDM<0,0,M,0.5,0),COLORFFFF66;IF(DIF>REF(DIF,1),DIF,DRAWNULL) ,COLORRED,LINETHICK2;IF(DIF<REF(DIF,1),DIF,DRAWNULL),COL ORGREEN,LINETHICK2;DRAWTEXT_FIX(TIME>0,0.5,0.3,0,'本指标请在日线周期下使用!'),COLOR0080FF;众:DRAWNULL,COLORCCCCCC;号:DRAWNULL,COLORCCCCCC;股市客栈:DRAWNULL,COLORCCCCCC;日周月共振副图源码MACD:=IF(TIME>0,DRAWNULL,(EXPMA(CLOSE,LONG)-REF(EXPMA(CLOSE,LONG),1))/REF(EXPMA(CLOSE,LONG),1)*100);日DIF:=EMA(SUM(MACD,2),5),COLORYELLOW,LINETHICK1;日持股:日DIF>REF(日DIF,1),NODRAW;D:=WEEKDAY<=REF(WEEKDAY,1);F22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(D,2),1) OR ISLASTBAR);SC:=BARSLAST(F22);XC:=IF(REFX(F22,1)=1,1,IF(REFX(F22,2)=1,2,IF(REFX(F22,3)=1 ,3,IF(REFX(F22,4)=1,4,0))));C1:=IF(F22=1,C,DRAWNULL);DIF2:=IF(F22=1,EMA(C1,SHORT)-EMA(C1,LONG),DRAWNULL);SCDIF:=REF(DIF2,SC);XCDIF:=REFX(DIF2,XC);周DIF:=IF(F22=0,(SCDIF-XCDIF)/(SC+XC)*XC+XCDIF,DIF2),COLORYELLOW,LINETHICK2;ZLHDATA:=BARSLASTCOUNT(周DIF>REF(周DIF,1));周DIF连红:IF(ZLHDATA-REF(XC,ZLHDATA-1)>0,ZLHDATA-REF(XC,ZLHDATA-1),0),NODRAW;YD:=DAY<=REF(DAY,1);YF22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(YD,2),1) OR ISLASTBAR);YSC:=BARSLAST(YF22);YXCC:=IF(REFX(YF22,12)=1,12,IF(REFX(YF22,13)=1,13,IF(REF X(YF22,14)=1,14,IF(REFX(YF22,15)=1,15,IF(REFX(YF22,16)=1,16,IF (REFX(YF22,17)=1,17,IF(REFX(YF22,18)=1,18,IF(REFX(YF22,19)=1, 19,IF(REFX(YF22,20)=1,20,IF(REFX(YF22,21)=1,21,IF(REFX(YF22,2 2)=1,22,0)))))))))));YXC:=IF(REFX(YF22,1)=1,1,IF(REFX(YF22,2)=1,2,IF(REFX(YF22 ,3)=1,3,IF(REFX(YF22,4)=1,4,IF(REFX(YF22,5)=1,5,IF(REFX(YF22,6) =1,6,IF(REFX(YF22,7)=1,7,IF(REFX(YF22,8)=1,8,IF(REFX(YF22,9)=1 ,9,IF(REFX(YF22,10)=1,10,IF(REFX(YF22,11)=1,11,YXCC)))))))))));YC1:=IF(YF22=1,C,DRAWNULL),NODRAW;YDIF2:=IF(YF22=1,EMA(YC1,SHORT)-EMA(YC1,LONG),DRAWNULL);YSCDIF:=REF(YDIF2,YSC);YXCDIF:=REFX(YDIF2,YXC);月DIF:=IF(YF22=0,(YSCDIF-YXCDIF)/(YSC+YXC)*YXC+YXCDIF,YDIF2),COLORYELLOW,LINETH ICK3;YLHDATA:=BARSLASTCOUNT(月DIF>REF(月DIF,1));月DIF连红:IF(YLHDATA-REF(YXC,YLHDATA-1)>0,YLHDATA-REF(YXC,YLHDATA-1),0),NODRAW;选股:C<现价AND FINANCE(42)>上市日期AND FINANCE(40)/100000000<流通市值AND 日持股>日线持股AND 周DIF连红>周连红AND 月DIF连红>月连红,COLORRED,LINETHICK3;公:DRAWNULL,COLORCCCCCC;众:DRAWNULL,COLORCCCCCC;号:DRAWNULL,COLORCCCCCC;股市客栈:DRAWNULL,COLORCCCCCC;日周月副图源码MACD:=IF(TIME>0,DRAWNULL,(EXPMA(CLOSE,LONG)-REF(EXPMA(CLOSE,LONG),1))/REF(EXPMA(CLOSE,LONG),1)*100);日DIF:EMA(SUM(MACD,2),5),COLORYELLOW,LINETHICK1;日持股:日DIF>REF(日DIF,1),NODRAW;日拐点:日DIF>REF(日DIF,1) AND REF(日DIF,1)<REF(日DIF,2),NODRAW;D:=WEEKDAY<=REF(WEEKDAY,1);F22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(D,2),1) OR ISLASTBAR);SC:=BARSLAST(F22);XC:=IF(REFX(F22,1)=1,1,IF(REFX(F22,2)=1,2,IF(REFX(F22,3)=1 ,3,IF(REFX(F22,4)=1,4,0))));C1:=IF(F22=1,C,DRAWNULL);DIF2:=IF(F22=1,EMA(C1,SHORT)-EMA(C1,LONG),DRAWNULL);SCDIF:=REF(DIF2,SC);XCDIF:=REFX(DIF2,XC);周DIF:IF(F22=0,(SCDIF-XCDIF)/(SC+XC)*XC+XCDIF,DIF2),COLORYELLOW,LINETHICK2;ZLHDATA:=BARSLASTCOUNT(周DIF>REF(周DIF,1));周DIF连红:IF(ZLHDATA-REF(XC,ZLHDATA-1)>0,ZLHDATA-REF(XC,ZLHDATA-1),0),NODRAW;YD:=DAY<=REF(DAY,1);YF22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(YD,2),1) OR ISLASTBAR);YSC:=BARSLAST(YF22);YXCC:=IF(REFX(YF22,12)=1,12,IF(REFX(YF22,13)=1,13,IF(REF X(YF22,14)=1,14,IF(REFX(YF22,15)=1,15,IF(REFX(YF22,16)=1,16,IF (REFX(YF22,17)=1,17,IF(REFX(YF22,18)=1,18,IF(REFX(YF22,19)=1, 19,IF(REFX(YF22,20)=1,20,IF(REFX(YF22,21)=1,21,IF(REFX(YF22,2 2)=1,22,0)))))))))));YXC:=IF(REFX(YF22,1)=1,1,IF(REFX(YF22,2)=1,2,IF(REFX(YF22 ,3)=1,3,IF(REFX(YF22,4)=1,4,IF(REFX(YF22,5)=1,5,IF(REFX(YF22,6)=1,6,IF(REFX(YF22,7)=1,7,IF(REFX(YF22,8)=1,8,IF(REFX(YF22,9)=1 ,9,IF(REFX(YF22,10)=1,10,IF(REFX(YF22,11)=1,11,YXCC)))))))))));YC1:=IF(YF22=1,C,DRAWNULL),NODRAW;YDIF2:=IF(YF22=1,EMA(YC1,SHORT)-EMA(YC1,LONG),DRAWNULL);YSCDIF:=REF(YDIF2,YSC);YXCDIF:=REFX(YDIF2,YXC);月DIF:IF(YF22=0,(YSCDIF-YXCDIF)/(YSC+YXC)*YXC+YXCDIF,YDIF2),COLORYELLOW,LINETH ICK3;YLHDATA:=BARSLASTCOUNT(月DIF>REF(月DIF,1));月DIF连红:IF(YLHDATA-REF(YXC,YLHDATA-1)>0,YLHDATA-REF(YXC,YLHDATA-1),0),NODRAW;现价:C,NODRAW;上市日期:FINANCE(42),NODRAW;流通市值:FINANCE(40)/100000000,NODRAW;N:=BARSLAST(YEAR>REF(YEAR,1))+1;年涨幅:(C/REF(C,N)-1)*100,NODRAW;停牌:DYNAINFO(8),NODRAW;IF(日DIF>REF(日DIF,1),日DIF,DRAWNULL),COLORRED,LINETHICK1;IF(日DIF<REF(日DIF,1),日DIF,DRAWNULL),COLORGREEN,LINETHICK1;IF(周DIF>REF(周DIF,1) AND 周DIF连红>0,周DIF,DRAWNULL),COLORRED,LINETHICK2;IF(周DIF<REF(周DIF,1),周DIF,DRAWNULL),COLORGREEN,LINETHICK2;IF(月DIF>REF(月DIF,1) AND 月DIF连红>0,月DIF,DRAWNULL),COLORRED,LINETHICK3;IF(月DIF<REF(月DIF,1),月DIF,DRAWNULL),COLORGREEN,LINETHICK3;DRAWTEXT_FIX(TIME>0,0.5,0.3,0,'本指标请在日线周期下使用!'),COLOR0080FF;DRAWTEXT(CURRBARSCOUNT=1 AND C>0,日DIF,'日DIF'),COLORWHITE;DRAWTEXT(CURRBARSCOUNT=1 AND C>0,周DIF,'周DIF'),COLORWHITE;DRAWTEXT(CURRBARSCOUNT=1 AND C>0,月DIF,'月DIF'),COLORWHITE;选股指标源码MACD:=IF(TIME>0,DRAWNULL,(EXPMA(CLOSE,LONG)-REF(EXPMA(CLOSE,LONG),1))/REF(EXPMA(CLOSE,LONG),1)*100);日DIF:=EMA(SUM(MACD,2),5);日持股:=日DIF>REF(日DIF,1);D:=WEEKDAY<=REF(WEEKDAY,1);F22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(D,2),1) OR ISLASTBAR);SC:=BARSLAST(F22);XC:=IF(REFX(F22,1)=1,1,IF(REFX(F22,2)=1,2,IF(REFX(F22,3)=1 ,3,IF(REFX(F22,4)=1,4,0))));C1:=IF(F22=1,C,DRAWNULL);DIF2:=IF(F22=1,EMA(C1,SHORT)-EMA(C1,LONG),DRAWNULL);SCDIF:=REF(DIF2,SC);XCDIF:=REFX(DIF2,XC);周DIF:=IF(F22=0,(SCDIF-XCDIF)/(SC+XC)*XC+XCDIF,DIF2);ZLHDATA:=BARSLASTCOUNT(周DIF>REF(周DIF,1));周DIF连红:=IF(ZLHDATA-REF(XC,ZLHDATA-1)>0,ZLHDATA-REF(XC,ZLHDATA-1),0);YD:=DAY<=REF(DAY,1);YF22:=IF(TIME>0,DRAWNULL,FILTER(BACKSET(YD,2),1) OR ISLASTBAR);YSC:=BARSLAST(YF22);YXCC:=IF(REFX(YF22,12)=1,12,IF(REFX(YF22,13)=1,13,IF(REF X(YF22,14)=1,14,IF(REFX(YF22,15)=1,15,IF(REFX(YF22,16)=1,16,IF (REFX(YF22,17)=1,17,IF(REFX(YF22,18)=1,18,IF(REFX(YF22,19)=1, 19,IF(REFX(YF22,20)=1,20,IF(REFX(YF22,21)=1,21,IF(REFX(YF22,2 2)=1,22,0)))))))))));YXC:=IF(REFX(YF22,1)=1,1,IF(REFX(YF22,2)=1,2,IF(REFX(YF22 ,3)=1,3,IF(REFX(YF22,4)=1,4,IF(REFX(YF22,5)=1,5,IF(REFX(YF22,6) =1,6,IF(REFX(YF22,7)=1,7,IF(REFX(YF22,8)=1,8,IF(REFX(YF22,9)=1 ,9,IF(REFX(YF22,10)=1,10,IF(REFX(YF22,11)=1,11,YXCC)))))))))));YC1:=IF(YF22=1,C,DRAWNULL);YDIF2:=IF(YF22=1,EMA(YC1,SHORT)-EMA(YC1,LONG),DRAWNULL);YSCDIF:=REF(YDIF2,YSC);YXCDIF:=REFX(YDIF2,YXC);月DIF:=IF(YF22=0,(YSCDIF-YXCDIF)/(YSC+YXC)*YXC+YXCDIF,YDIF2);YLHDATA:=BARSLASTCOUNT(月DIF>REF(月DIF,1));月DIF连红:=IF(YLHDATA-REF(YXC,YLHDATA-1)>0,YLHDATA-REF(YXC,YLHDATA-1),0);选股:DYNAINFO(8)>0 AND C<现价 AND FINANCE(42)>上市日期AND FINANCE(40)/100000000<流通市值AND 日持股>日线持股 AND 周DIF连红>周连红 AND 月DIF连红>月连红;。
通达信MACD多周期确认副图指标公式源码
通达信MACD多周期确认副图指标公式源码{MACD时间}{3,7,3}{7,21,2}{12,52,9}N:=3;M:=9;M1:=3;DIF:EMA(CLOSE,N)-EMA(CLOSE,M),NODRAW;DEA:EMA(DIF,M1),NODRAW;MACD:(DIF-DEA)*2,COLORSTICK;{多周期统计}当红:IF(BARSLAST(MACD<0),BARSLAST(MACD<0),0),NODRAW,CO LORRED;当绿:IF(BARSLAST(MACD>0),BARSLAST(MACD>0),0),NODRAW,CO LORGREEN;{MACD周值}周DIF:="MACD.DIF#WEEK";周DEA:="MACD.DEA#WEEK";周MACD:=(周DIF-周DEA)*2;周红:IF(周MACD>0,BARSLAST(CROSS(周MACD,0)),DRAWNULL)+1,COLORYELLOW,NODRAW;周绿:IF(周MACD<0,BARSLAST(CROSS(0,周MACD)),DRAWNULL)+1,COLORCYAN,NODRAW;{MACD月值}月DIF:="MACD.DIF#MONTH";月DEA:="MACD.DEA#MONTH";月MACD:=(月DIF-月DEA)*2;月红:IF(月MACD>0,BARSLAST(CROSS(月MACD,0)),DRAWNULL)+1,COLORRED,NODRAW;月绿:IF(月MACD<0,BARSLAST(CROSS(0,月MACD)),DRAWNULL)+1,COLORGREEN,NODRAW;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORRED;STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1,-1),COLORRED;STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORGREEN;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,-1),COLORGREEN;ZM:=REF(MACD,BARSLAST(周红=1));STICKLINE(MACD>ZM AND ZM>0,ZM,ZM,1,0),COLORWHITE;DRAWBAND(DEA,RGB(250,250,0),DEA,RGB(0,0,0));DRAWBAND(IF(DIF>DEA,DIF,DRAWNULL),RGB(250,0,0),DIF, RGB(0,0,0));DRAWBAND(IF(周红<1,DEA,DRAWNULL),RGB(0,250,0),DEA,RGB(0,0,0));DRAWTEXT(周红=1,0,'周'),COLORYELLOW,DRAWABOVE;低位金叉:=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;DRAWTEXT(二次金叉,DEA*0.2,'二金'),COLORWHITE;三次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=3,60)=1;DRAWTEXT(三次金叉,DEA*0.2,'三金'),COLORLIMAGENTA;四次金叉:=CROSS(DIF,DEA) AND DEA<0 ANDCOUNT(JCCOUNT=4,90)=1;DRAWTEXT(四次金叉,DEA*0.2,'四金'),COLORYELLOW;五次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=5,120)=1;DRAWTEXT(五次金叉,DEA*0.2,'五金'),COLORBROWN;六次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=6,150)=1;DRAWTEXT(六次金叉,DEA*0.2,'六金'),COLORBLUE;{MACD日线底背离}A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);DRAWTEXT(底背离,DIF*0.5,'底背'),COLORRED;{日底背画线:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,DOTLINE;}{MACD日线顶背离}A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);DRAWTEXT(顶背离,DIF*1.12,'顶背'),COLORGREEN;{日顶背画线:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,DOTLINE;}{MACD积背离}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);DRAWTEXT(底背驰,DEA*0.8,'积底背'),COLORFF80FF;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);DRAWTEXT(顶背驰,DEA*0.8,'积顶背'),COLORCYAN;周K:="KDJ.K#WEEK";周D:="KDJ.D#WEEK";DRAWTEXT(CROSS(周K,周D),0,'KDJ周'),COLORYELLOW;DRAWTEXT_FIX(1,0.02,0.06,0,'周线金叉出现在周一,周五收盘后才能确定信号是否成立'),COLORLIGRAY;。
通达信软件指标公式源码常用的MACD三次背离副图指标通达信源码.docx
常用的MACD三次背离副图指标通达信源码自己常用的MACD,严重底背离红柱子和底背离绿柱子,三次背离底部划线等, 主要看图比较清晰!DIFIF1:(EMA(CLOSE,12) - EMA(CLOSE,26))*100/EMA(CLOSE Z26); DEAEA1:EMA(DIFIF1,9);MACD1:=2*(DIFIF1-DEAEA1),STICK;MACD2:=EMA(MACD1,3);STICKLINE(MACD 1 >MACD2 AND MACD1>0,0,MACD1,3,0),COLORRED; STICKLINE(MACD 1 >MACD2 AND MACD1<O Z O,MACD1,3,0),COLORGREEN; STICKLINE(MACD1<MACD2,0,MACD1Z3,0),COLORCBCBCO;STICKLINE(MACDl>=0 OR MACDl<=O z O z O z50,l)z COLORWHITE;DIFIF1,COLOR33FF33,LINETHICK2;DEAEAl’COLORYELLOW 丄INETHICK2;MACD: MACD1,NODRAW,COLORMAGENTA;强:IF(DIFIF1>=DEAEA1,DIFIF1QRAWNULL),COLORRED 丄INETHICK2;弱:IF(DEAEA1>=DIFIF1Z DEAEA1,DRAWNULL)Z COLORFF9900,LINETHICK2; DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+O.l,l);DRAWICON(CROSS(DEAEA1,DIFIF1),0.4,2);Al:=BARSLAST(REF(CROSS(n MACD. DIF H z n MACD. DEA n)z 1));B1:=REF(C,A1+1)>C AND REF(H MACD.DIF,,,Al+l)<H MACD.DIF n AND CROSS(n MACD.DIF,,,n MACD.DEA n);DRAWTEXT(Bl>0z-0.8;MACD 底背'),COLORFFOOFF;A2:=BARSLAST(REF(CROSS(,,KDJ.K,,/,,KDJ.D,,)Z1));B2:=REF(C,A2+1)>C AND REF(^^KDJ.K^,,A24-1)<^^KDJ.K,, ANDCROSS(,,KDJ.K,,z,,KDJ.D n);DRAWTEXT(B2z-0.6;KDJ 底离'),COLORYELLOW;{KDJ 底背离};A3:=BARSLAST(REF(CROSS(,,RSLRSI1,,Z,,RSI.RSI2,,),1));B3:=REF(C,A3+1)>C AND REF(,,RSLRSIl,,z A3+l)<,,RSI.RSir,AND CROSS(”RSI・RSI1TRSI・RSI2J;DRAWTEXT(B3>0,-0.3z'RSI 底离'),COLORCYAN;{RSI 底背离};C1:=BARSLAST(REF(CROSS(,,MACD.DEA,,/,MACD.DIF,,),1));Dl:=REF(C,Cl+l)vC AND [^=(“1^。
通达信指标公式源码 超前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 ;。
通达信指标公式源码 H超级KMACD 副图源码
{通达信'H超级KMACD'源码}H0:=0.25;L0:=(H+L+C)/3;L1:=H0*(L0-MA(L0,21))/(AVEDEV(L0,21));超级K:SMA(L1,3,1);超级D:SMA(超级K,3,1);超级J:超级K*3-超级D*2,COLORCC66BB;H1:=3.809*H0+REVERSE(EMA(超级J,1));H2:=-2.809*H0+REVERSE(EMA(超级J,1));IF(超级J>H1,超级J,DRAWNULL),COLORAAAA33,LINETHICK3;做顶:IF(超级J>H1,1,0),COLORCYAN,NODRAW;IF(超级J<H2,1,0),COLOR880088,NODRAW;筑底:IF(超级J<H2,超级J,DRAWNULL),COLORDD00DD,LINETHICK3;H3:=CROSS(超级K,超级D);H4:=超级J<REF(超级J,1) AND REF(超级J,1)>REF(超级D,1) AND 超级J<=超级D; H5:=超级J>H1 AND NOT(REF(超级J>H1,1));拉升为1:IF(H5,1,0),COLORFFFFCC,NODRAW;金叉:IF(H3,1,0),COLORRED,NODRAW;死叉:IF(H4,1,0),COLORGREEN,NODRAW;【选股基准线】:CONST(HHV(MAX(MAX(超级K,超级D),超级J),0))*1.1,COLORLIRED; DIF0:=EMA(DCLOSE,8)-EMA(DCLOSE,22);DEA0:=EMA(DIF0,7);MACD:=2*(DIF0-DEA0);D0:=HHV(ABS(MACD),100);M0:=COUNT(CROSS(DIF0,DEA0),BARSLAST(DEA0>=0));M1:=BARSLAST(REF(CROSS(MACD,0),1));M2:=BARSLAST(REF(CROSS(DEA0,DIF0),1));M3:=LLV(MACD,4)>0 AND MACD<REF(MACD,1) AND REF(MACD,1)>REF(MACD,2) AND REF(MACD,2)>REF(MACD,3);M4:=HHV(MACD,4)<0 AND MACD>REF(MACD,1) AND REF(MACD,1)<REF(MACD,2)AND REF(MACD,2)<REF(MACD,3);低位金叉:IF(CROSS(DIF0,DEA0) AND DIF0<-0.1,D0*0.4+【选股基准线】,0+【选股基准线】),COLORFF00FF;二次金叉:IF(CROSS(DIF0,DEA0) AND DEA0<0 AND COUNT(M0=2,21)=1,D0*0.8+【选股基准线】,0+【选股基准线】),COLORFFFF00;启点:IF(FILTER(MACD>0 AND MACD>5*REF(MACD,1),2),D0+【选股基准线】,0+【选股基准线】),COLOR0044FF;底背离:=REF(CLOSE,M1+1)>CLOSE AND MACD>REF(MACD,M1+1),COLORGREEN;D1:=7;D2:=30;D3:=6;DIF1:=EMA(C,D1)-EMA(C,D2),COLORFFFFFF;DEA1:=EMA(DIF1,D3),COLORFF6666;MACD1:=(DIF1-DEA1)*2,COLORSTICK,COLORRED;F0:=V*(O+C+H+L)/4;F1:=IF(V>0,F0/V,(O+C+H+L)/4);F2:=(F1-LLV(F1,5))/(HHV(F1,5)-LLV(F1,5));F3:=SMA(F2,13,1);F4:=SMA(F3,13,1);F5:=3*F3-2*F4;F6:=2*F5-0.5;F7:=F1*(1-(F6-F4)/40);F8:=CROSS(F1,F7) AND C/REF(C,1)<1.03 AND SUM(DYNAINFO(23),5)>=3000; MACD拉升:IF(FILTER(F8,10) AND MACD1>0,D0*1.2+【选股基准线】,0+【选股基准线】),COLOR6600FF;MACD选长:=IF(CROSS(DIF1,DEA1),HHV(ABS(MACD1),100)+【选股基准线】,0),COLORLIRED;DIF:DIF0+【选股基准线】,COLORFFFFFF;DEA:DEA0+【选股基准线】,COLOR00AAAA;0,COLOR888888,POINTDOT;DRAWTEXT(FILTER(F8,10) AND MACD1>0,D0*1.1+【选股基准线】,'拉'),COLOR6600FF; STICKLINE(H5,超级J*1.2,超级J*0.8,0,-1),COLORFFFFCC;DRAWTEXT(H5,超级J*1.25,'拉'),COLORFFFFCC;DRAWICON(H4,超级K*1.3,2);DRAWICON(H3,超级K*0.7,1);STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0+【选股基准线】,MACD+【选股基准线】,1,0),COLOR6699FF;STICKLINE(MACD>=0 AND MACD<=REF(MACD,1),0+【选股基准线】,MACD+【选股基准线】,1,-1),COLOR008800;STICKLINE(MACD<=0 AND MACD>=REF(MACD,1),0+【选股基准线】,MACD/2+【选股基准线】,1,0),COLORAAAAAA;STICKLINE(MACD<=0 AND MACD<=REF(MACD,1),0+【选股基准线】,MACD/2+【选股基准线】,1,-1),COLORCC6600;DRAWTEXT(FILTER(M3,3),-0.15+【选股基准线】,'转空'),COLOR00FF00; DRAWTEXT(FILTER(M4,3),D0*0.5+【选股基准线】,'转多'),COLORFFFFBB;DRAWTEXT(CROSS(DIF0,DEA0) AND DIF0<-0.1,D0*0.3+【选股基准线】,'低位X'),COLORFF00FF;DRAWTEXT(CROSS(DIF0,DEA0) AND DEA0<0 AND COUNT(M0=2,21)=1,D0*0.7+【选股基准线】,'二次X'),COLORFFFF00;DRAWTEXT(FILTER(MACD>0 AND MACD>5*REF(MACD,1),2),D0*0.9+【选股基准线】,'启'),COLOR0044FF;。
MACD副图通达信指标公式源码
感谢论坛股友的厚爱,一直让我感激不尽。
今天看到一文章,特意为这种形态写了一个公式,因为这公式只是种形态,诚心奉送源码,不喜勿喷。
MACD,最熟悉不过的指标了,以至于大家开始忽略。
其实大家可能只知道金叉,死叉,背离,却不知道有一个叫8天法则,这个公式有含义是:
1、MACD指标DEA长期在0轴之下,最近开始走上0轴;
2、过一段时间后MACD指标发生死叉,指标柱体由正(红色)变负(绿色);
3、此区间要求成交量萎缩;
4、MACD指标在8天内又由死叉变为金叉,指标柱体由负(绿色)变正(红色);
5、MACD指标的8日法则短线暴涨概率相当大,但也不是万能的,请注意这只是种形态。
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2 ;
JZX:=BARSLAST(CROSS(DEA,0));
XG:CROSS(DIF,DEA) AND EVERY(DEA>0,JZX) AND COUNT(CROSS(DIF,DEA),JZX)=1 AND
COUNT(CROSS(DEA,DIF),8)=1 ;。
通达信指标公式源码 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;。
通达信源码公式指标软件多周期共振.docx
设计原理:多周期共振。
{多周期共振}0;AAA:=EMA((2*C+H+L)/4,3);A1:=SLOPE(AAA*3-REF(AAA Z3),3)+C;DI:=(EMA(A1Z5) - EMA(Al,10));DE:=EMA(DI,3);一级趋势:(DI+DE)/2,NODRAW;DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF Z9);MACD:=2*(DIF-DEA);周DIF:=(”MACD・DIF#WEEIC);周DEA:=(n MACD.DEA#WEEK n);周MACD:=2*(周DIF■周DEA);二趋势:(DIF+DEA)/2,NODRAW;三趋势:j周DIF+周DEA)/2Z NODRAW;STICKLINE(周MACD>REF(周MACD,1) AND 周MACD>0Q周MACD, 18,0),COLORMAGENTA;STICKLINE(周MACDvREF(周MACD,1) AND 周MACD>0Q周MACD, 18,0),COLORWHITE;STICKLINE(周MACD>REF(周MACD Z1) AND 周MACDvOQ周MACD, 18,0),COLORCYAN;STICKLINE(周MACDvREF(周MACD,1) AND 周MACDvOQ周MACD, 18,0),COLORBLUE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,O z MACD z3.5z l),COLORRED; STICKLINE(MACD>REF(MACD,1) AND MACD<O z O z MACD,3.5,l)z COLORLIRED; STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,3.5,1),COLORWHITE; STICKLINE(MACD<REF(MACD,1) AND MACD<O z O z MACD,3.5,l)z COLORCYAN; DRAWBAND(周DIF z RGB(200,10,10),周DEA,RGB(10,10,128)); DRAWBAND(DIF,RGB(200Z100,200)Z DEA Z RGB(100,100A200));{DRAWBAND(DI z RGB(200z50,100)z DE,RGB(50,50,200));}DIFX:EMA(CLOSE,12)-EMA(CLOSE,26);DEAX:EMA(DIFX,9);周DIFX:(“MACD・DIF#WEEK“);周DEAX:(n MACD.DEA#WEEK“);MA5: = MA(CLOSE,5);MA60: = MA(CLOSE,60);Fl 趋势:(DIF+DEA)/2;周趋势:(周DIF+周DEA)/2;撑压A:IF(CROSS(DIFX,DEAX)Z DIFX Z REF(DIFX,BARSLAST(CROSS(DEAX Z DIFX)))),PO INTDOT,COLORYELLOW Z LINETHICK2;撑压B:IF(CROSS(DEAX Z DIFX),DIFX Z REF(DIFX,BARSLAST(CROSS(DIFX,DEAX))))Z PO INTD0T,C0L0RYELL0W,LINETHICK2;DIIFF:=(EMA(A1Z5)・ EMA(A1Z1O));DEAA:=EMA(DIIFF,3);K 线动能:=(DIIFF-DEAA),COLORYELLOW;STICKLINE((K 线动能> 0),0,K 线动能,1.5,0),COLORYELLOW;STICKLINE((K 线动能> 0),0,K 线动能*0.9,1.5,0),COLORYELLOW; STICKLINE((K 线动能> 0)QK 线动能*0.8,1.5,0),COLORYELLOW; STICKLINE((K 线动能> 0)z0,K 线动能*0.7,1.5,0),COLOROOOOFF; STICKLINE((K 线动能> 0)z0,K 线动能*0.6,1.5,0),COLOROOOOFF; STICKLINE((K 线动能> 0),0,K 线动能*0.5,1.5z O)z COLOROOOOFF; STICKLINE((K 线动能> 0),0,K 线动能*0.4,1.5,0),COLOROOOOFF; STICKLINE((K 线动能> 0)z0z K 线动能*0.3,1.5z O),COLOROOOOFF; STICKLINE((K 线动能> 0)z0,K 线动能*0.2,1.5,0),COLOROOOOFF; STICKLINE((K 线动能> 0)z0,K 线动能*0.1,2z O),COLOROOOOFF; STICKLINE((K 线动能< 0),0,K 线动能z1.5z O),COLOROOFFOO; STICKLINE((K 线动能< 0),0,K 线动能*0.9,1.5,0),COLOROOFFOO;STICKLINE((K 线动能v 0)z0z K 线动能*0.8,1.5,0),COLOROOFFOO; STICKLINE((K 线动能< 0)z0,K 线动能*0.7,1.5,0),COLORFF9900; STICKLINE((K 线动能< 0)z0,K 线动能*0.6,1.5,0),COLORFF9900; STICKLINE((K 线动能< 0),0,K 线动能*0.5,1.5,0)Z COLORFF9900; STICKLINE((K 线动能< 0),0,K 线动能*0.4,1.5,0),COLORFF9900;STICKLINE((K 线动能v 0)z0z K 线动能*0.3,1.5,0),COLORFF9900; STICKLINE((K 线动能< 0)z0,K 线动能*0.2,1.5,0),COLORFF9900; STICKLINE((K 线动能v 0),0,K 线动能*0.1,1.5,0),COLORFF9900;选股:周DIFXxREF(周DIFX,1) AND 周MACD>REF(周MACD,1) AND CROSS(DIF,DEA);"厘it 旧M 范曳权)均茨V29.02* rx.: *1 M4:92J| ' .2oi3>caro2/5卄山WQ〉」U旧•灿心」⑴邑加只仁的餡口万倍丄(M:im 舒u.uiumnwQ/f(呈复初浇遇3巧咲生*徉V ・•■It • ■• - • 6'•* ■ •■・;x VCclIME UW? 16| hlAWl 5 PU?9 36| V/W0I J1 5扛?曲/ »。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
MACD本身属于中期指标适合与波段操作用不同的周期同共振寻找买卖点,适合波段操作,指标的买卖结合周期共振是最佳选择
DIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA1:=EMA(DIF1,9);
MACD1:(DIF1-DEA1)*2,COLORSTICK;
DIF11:=EMA(CLOSE,16) - EMA(CLOSE,34.5);
DEA11:=EMA(DIF11,12);
MACD11:(DIF11-DEA11)*2,COLORSTICK;
DRAWBAND(DIF1,RGB(155,50,50),DEA1,RGB(0,100,50));
DIF:=EMA(CLOSE,6) - EMA(CLOSE,13);
DEA:=EMA(DIF,4.5);
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(MACD11>0,0,MACD11,1.5,0),COLOR8800FF;
STICKLINE(MACD11<0,0,MACD11,1.5,0),COLORFFFF00;
STICKLINE(MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1<0,0,MACD1,1,0),COLORBLUE;
STICKLINE(MACD>0,0,MACD,0.5,0),COLORYELLOW;
STICKLINE(MACD<0,0,MACD,0.5,0),COLOR00DD00;
DIFFFF:DIF11,COLOR8800FF,LINETHICK0;
DEAAAA:DEA11,COLORFFAA00,LINETHICK0;
DIFFF:DIF1,COLORRED,LINETHICK0;
DEAAA:DEA1,COLORBLUE,LINETHICK0;
DIFF:DIF,COLORYELLOW,LINETHICK0;
DEAA:DEA,COLORGREEN,LINETHICK0;
动力线:MA(MACD1,5),,COLORYELLOW,LINETHICK1;
中区:0,COLORBLUE,LINETHICK0;
主动:IF(MACD1>=动力线AND 动力线<=中区,动力线,DRAWNULL),COLORYELLOW,LINETHICK2;
主拉:IF(动力线>=中区,动力线,DRAWNULL),COLORRED,LINETHICK2;
翻空:IF(动力线<中区AND 动力线>MACD1,动力线,DRAWNULL),COLORGREEN,LINETHICK2;
AA:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
BB:=REF(CLOSE,AA+1)>CLOSE AND DIF1>REF(DIF1,AA+1) AND CROSS(DIF1,DEA1); JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BARSLAST(DEA1>=0));
二金:=CROSS(DIF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1; DRAWICON(二金,DEA*1.04,15) ;
DRAWTEXT(二金,-0.02,' 2'),COLORFF00FF;
VAR1:=EMA(CLOSE,12)-EMA(CLOSE,25);
VAR2:=EMA(VAR1,3);
VAR3:=VAR1>VAR2;
VAR4:=VAR1<VAR2;
STICKLINE(VAR3,VAR1,VAR2,1,0),COLORRED;
STICKLINE(VAR4,VAR1,VAR2,1,0),COLORGREEN;。