通达信 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(REFX(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,IF(REFX(F22,22)=1,22,0)))))))))));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,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);DIF2:=IF(F22=1,EMA(C1,SHORT)-EMA(C1,LONG),DRAWNULL);DEA2:=IF(F22=1,EMA(DIF2,MID),DRAWNULL);M:=IF(F22=1,(DIF2-DEA2)*2,DRAWNULL),COLORSTICK;SCMACD:=REF(M,SC);XCMACD:=REFX(M,XC);SCDIF:=REF(DIF2,SC);XCDIF:=REFX(DIF2,XC);SCDEA:=REF(DEA2,SC);XCDEA:=REFX(DEA2,XC);DIF:IF(F22=0,(SCDIF-XCDIF)/(SC+XC)*XC+XCDIF,DIF2),LINETHICK1;DEA:IF(F22=0,(SCDEA-XCDEA)/(SC+XC)*XC+XCDEA,DEA2);MACD:IF(F22=0,(SCMACD-XCMACD)/(SC+XC)*XC+XCMACD,M),COLORSTICK;STICKLINE(F22=1 AND M>0,0,M,0.5,0),COLORRED;STICKLINE(F22=1 AND M<0,0,M,0.5,0),COLORFFFF66;IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORGREEN,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(REFX(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,22)=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,LINETHICK3; 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(REFX(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,22)=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,LINETHICK3; 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(REFX(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,22)=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连红>月连红; |
|
来自: 昵称66885806 > 《通达信指标》