【指标公式源码下载】通达信全新KDJ指标公式和用法
【股票指标公式下载】-【通达信】仿决策曲线(KDJ、MACD、TRIX、DMI、RSI)
【通达信】仿决策曲线(KDJ、MACD、TRIX、DMI、RSI)-指标公式源码MA1:=MA(CLOSE,5);MA2:=MA(CLOSE,10);P01:=IF(MA1>MA2,1,IF(MA2>MA1,-1,0));MA3:=MA(CLOSE,3);MA4:=MA(CLOSE,5);P02:=IF(MA3>MA4,1,IF(MA4>MA3,-1,0));MA5:=MA(CLOSE,12);MA6:=MA(CLOSE,50);P03:=IF(MA5>MA6,1,IF(MA6>MA5,-1,0));{KDJ}RSV:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;K:=EMA(RSV,3);D:=EMA(K,3);P04:=IF(K>D,1,IF(D>K,-1,0));{MACD}DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;P05:=IF(DIF>DEA,1,IF(DEA>DIF,-1,0));{TRIX}TR:=EMA(EMA(EMA(CLOSE,12),12),12);TRIX:=(TR-REF(TR,1))/REF(TR,1)*100;MATRIX:=MA(TRIX,9) ;P06:=IF(TRIX>MATRIX,1,IF(MATRIX>TRIX,-1,0));{DMI}TR1:=EMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LO W)),7);HD :=HIGH-REF(HIGH,1);LD :=REF(LOW,1)-LOW;DMP:=EMA(IF(HD>0 AND HD>LD,HD,0),7);DMM:=EMA(IF(LD>0 AND LD>HD,LD,0),7);PDI:= DMP*100/TR;MDI:= DMM*100/TR;ADX:= EMA(ABS(MDI-PDI)/(MDI+PDI)*100,7);ADXR:=EMA(ADX,7);P07:=IF(PDI>MDI AND ADX>PDI AND ADX>50,3,IF(PDI<MDI AND ADX>MDI AND ADX>50,-3,0));{9}{RSI}LC:=REF(CLOSE,1);RSI1:=EMA(MAX(CLOSE-LC,0),5)/EMA(ABS(CLOSE-LC),5)*100;{10} P08:=IF(RSI1>80,1,IF(RSI1<20,-1,0));{10}{CCI}TYP:=(HIGH+LOW+CLOSE)/3;CCI:=(TYP-MA(TYP,8))/(0.015*AVEDEV(TYP,8));P09:=IF(CCI>180,2,IF(CCI<-180,-2,0));{12}{W%R}WR1:=(CLOSE-LLV(LOW,6))/(HHV(HIGH,6)-LLV(LOW,6))*100;P10:= IF(WR1>80,1,IF(WR1<20,-1,0));{13}{OSC}OSC:=100*(CLOSE-MA(CLOSE,20));P11:=IF(OSC>0,1,IF(OSC<0,-1,0));{14}{MTM}MOM:=CLOSE-REF(CLOSE,7);P12:=IF(MOM>0,1,IF(MOM<0,-1,0));{15}{DPO}DPO:=CLOSE-REF(MA(CLOSE,11),11/2+1);P13:=IF(DPO>0,1,IF(DPO<0,-1,0));{16}{布林线}MB:=MA(CLOSE,12);R:=(CLOSE-MB)*(CLOSE-MB);X1:=MA(R,12);X2:=SQRT(X1);D1:=1;UPPER:=MB+(D1*X2);LOWER:=MB-(D1*X2);P14:=IF(CLOSE>UPPER,2,IF(CLOSE<LOWER,-2,0));{18} {BRAR}BR:=SUM(MAX(0,HIGH-REF(CLOSE,1)),14)/SUM(MAX(0,REF(CLOSE,1)-LOW),14)* 100;AR:=SUM(HIGH-OPEN,14)/SUM(OPEN-LOW,14)*100;P15:=IF(BR>350 OR AR>180,3,IF(BR<45 OR AR<45,-3,0));{21}{VR}TH:=SUM(IF(CLOSE>REF(CLOSE,1),VOL,0),14);TL:=SUM(IF(CLOSE<REF(CLOSE,1),VOL,0),14);TQ:=SUM(IF(CLOSE=REF(CLOSE,1),VOL,0),14);VR:=0100*(TH*2+TQ)/(TL*2+TQ);P16:=IF(VR>350,3,IF(VR<45,-3,0));{24}{WVAD}WVAD:=SUM((CLOSE-OPEN)/(HIGH-LOW)*VOL,6)/10000;P17:=IF(WVAD>0,1,IF(WVAD<0,-1,0));{25}{EMV}VOLUME:=MA(VOL,4)/VOL;MID:=100*(HIGH+LOW-REF(HIGH+LOW,1))/(HIGH+LOW);EMV:=MA(MID*VOLUME*(HIGH-LOW)/MA(HIGH-LOW,4),4);P18:=IF(EMV>0,1,IF(EMV<0,-1,0));{26}{OBV}VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);OBV:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);MAOBV:=EMA(OBV,24);P19:=IF(OBV>MAOBV,1,IF(OBV<MAOBV,-1,0));{27}{PVI}PVI:= PVI,COLORWHITE;MPVI:=EMA(PVI,24),COLORYELLOW;P20:=IF(PVI>MPVI,1,IF(PVI<MPVI,-1,0));{28}{NVI}NVI:=NVI,COLORWHITE;MNVI:=EMA(NVI,24),COLORYELLOW;P21:=IF(NVI>MNVI,2,IF(NVI<MNVI,-2,0));{30}{MASS}MASS:=SUM(MA(HIGH-LOW,9)/MA(MA(HIGH-LOW,9),9),25);MA7:=MA(CLOSE,9);P22:=IF(MA7>REF(MA7,1) AND MASS>26.5,2,IF(MA7<REF(MA7,1)AND MASS<26.5,-2,0));{32}{VHF}NUM:=ABS(HHV(HIGH,15)-LLV(LOW,15));DEN:=SUM(ABS(CLOSE-REF(CLOSE,1)),15);VHF:=IF(DEN=0,0,NUM/DEN);VHF1:=EMA(VHF,240);P23:=IF(VHF>VHF1,1,IF(VHF<VHF1,-1,0));{33}{PUCU}PU:=MA(CLOSE,13);CU:=MA(VOL,13);PU1:=(PU-REF(PU,1))/REF(PU,1)*100;CU1:=(CU-REF(CU,1))/REF(CU,1)*100;逆时针曲线:=PU1+CU1;P24:=IF(逆时针曲线>REF(逆时针曲线,1),1,IF(逆时针曲线<REF(逆时针曲线,1),-1,0));{ASI}LC2:=REF(CLOSE,1);AA:=ABS(HIGH-LC2);BB:=ABS(LOW-LC2);CC:=ABS(HIGH-REF(LOW,1));DD:=ABS(LC2-REF(OPEN,1));R2:=IF(AA>BB AND AA>CC,AA+BB/2+DD/4,IF(BB>CC ANDBB>AA,BB+AA/2+DD/4,CC+DD/4));X01:=(CLOSE-LC2+(CLOSE-OPEN)/2+LC2-REF(OPEN,1));SI:=16*X01/R2*MAX(AA,BB);ASI:=SUM(SI,0),COLORWHITE;MASI:=MA(ASI,6),COLORYELLOW;P25:=IF(CLOSE<HHV(CLOSE,13) ANDASI=HHV(ASI,13),1,IF(CLOSE>LLV(CLOSE,13) AND ASI=LLV(ASI,13),-1,0)); {BIAS}BIAS1 :=(CLOSE-MA(CLOSE,12))/MA(CLOSE,12)*100;P26:=IF(BIAS1>10,1,IF(BIAS1<-10,-1,0));决策曲线:(36+P01+P02+P03+P04+P05+P06+P07+P08+P09+P10+P11+P12+P13+P14+P15+P1 6+P17+P18+P19+P20+P21+P22+P23+P24+P25+P26)*1.36;MAJCQX:MA(决策曲线,3);STICKLINE(C>0,36,36,10,0),COLOR00FF00;STICKLINE(C>0,56,56,10,0),COLORFF00FF;STICKLINE(C>0,71,71,10,0),COLORRED;STICKLINE(C>0,44,44,10,0),COLORYELLOW;【通达信】仿决策曲线(KDJ、MACD、TRIX、DMI、RSI)-指标公式效果图(文档来源:若水财经社区)。
【股票指标公式下载】-【通达信】改良六指金叉(MCDA、KDJ、RSI、LWR、BBI、MMS)
【通达信】改良六指金叉(MCDA、KDJ、RSI、LWR、BBI、MMS)-指标公式源码DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIFF,9);STICKLINE(DIFF>DEA,1,1.8,3,0),COLORRED;STICKLINE(DIFF<DEA,1,1.8,3,0),COLORGREEN;MCDA金叉:DIFF>DEA,NODRAW;RSV:=(CLOSE-LLV(LOW,12))/(HHV(HIGH,12)-LLV(LOW,12))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);STICKLINE(K>D,2,2.8,3,0),COLORRED;STICKLINE(K<D,2,2.8,3,0),COLORGREEN;KDJ金叉:K>D,NODRAW;LC:=REF(CLOSE,1);RSI1:=(SMA(MAX(CLOSE-LC,0),9,1))/(SMA(ABS(CLOSE-LC),9,1))*100; RSI2:=(SMA(MAX(CLOSE-LC,0),26,1))/(SMA(ABS(CLOSE-LC),26,1))*100; STICKLINE(RSI1>RSI2,3,3.8,3,0),COLORRED;STICKLINE(RSI1<RSI2,3,3.8,3,0),COLORGREEN;RSI金叉:RSI1>RSI2,NODRAW;LWR1:=SMA(RSV,3,1);LWR2:=SMA(LWR1,3,1);STICKLINE(LWR1>LWR2,4,4.8,3,0),COLORRED;STICKLINE(LWR1<LWR2,4,4.8,3,0),COLORGREEN;LWR金叉:LWR1>LWR2,NODRAW;BBI:=(MA(CLOSE,3)+MA(CLOSE,9)+MA(CLOSE,12)+MA(CLOSE,26))/4; STICKLINE(CLOSE>BBI,5,5.8,3,0),COLORRED;STICKLINE(CLOSE<BBI,5,5.8,3,0),COLORGREEN;BBI金叉:CLOSE>BBI,NODRAW;MTM:=CLOSE-REF(CLOSE,1);MMS:=100*EMA(EMA(MTM,9),9)/EMA(EMA(ABS(MTM),9),3);MMM:=100*EMA(EMA(MTM,26),12)/EMA(EMA(ABS(MTM),26),12); STICKLINE(MMS>MMM,6,6.8,3,0),COLORRED;STICKLINE(MMS<MMM,6,6.8,3,0),COLORGREEN;MMS金叉:MMS>MMM,NODRAW;STICKLINE(MCDA金叉 AND KDJ金叉 AND RSI金叉 AND LWR金叉 AND BBI金叉AND MMS金叉,0,0.8,3,0),COLORYELLOW;【通达信】改良六指金叉(MCDA、KDJ、RSI、LWR、BBI、MMS)-指标公式效果图 (文档来源:若水财经社区)。
KDJ日周月同共振金叉公式通达信指标公式源码
kdj的日周月同共振金叉公式月K:"KDJ.K"(89,3,3),COLOR00FF00;月D:"KDJ.D"(89,3,3),COLOR00FF00,LINETHICK2;周K:"KDJ.K"(27,3,3),COLORRED;周D:"KDJ.D"(27,3,3),COLORRED,LINETHICK2;日K:"KD.K"(5,3,3),COLORWHITE;日D:"KD.D"(5,3,3),COLORWHITE,LINETHICK2;日金叉:IF(CROSS(日K,日D),50,0),COLORFFFFFF;DRAWTEXT(日金叉,50,'日叉'),COLORFFFFFF;周金叉:IF(CROSS(周K,周D),30,0),COLORRED;DRAWTEXT(周金叉,30,'周叉'),COLORRED;月金叉:IF(CROSS(月K,月D),20,0),COLOR0080FF; DRAWTEXT(月金叉,20,'月叉'),COLORYELLOW;{KD在30以下多次金叉}JM:=CROSS("KDJ.K"(5,3,3),"KDJ.D"(5,3,3));JMCOUNT:=COUNT(JM,BARSLAST("KDJ.D"(5,3,3)>=30)); JMTJ:=28*("KDJ.D"(5,3,3)<30 AND COUNT(JMCOUNT=1,21)=1); DRAWTEXT (JMTJ,70,'①'),COLORWHITE;JMTJ2:=28*("KDJ.D"(5,3,3)<30 AND COUNT(JMCOUNT=2,21)=1); DRAWTEXT (JMTJ2,70,'②'),COLORYELLOW;JMTJ3:=28*("KDJ.D"(5,3,3)<30 AND COUNT(JMCOUNT=3,21)=1);DRAWTEXT (JMTJ3,70,'③'),COLORYELLOW;JMTJ4:=28*("KDJ.D"(5,3,3)<30 AND COUNT(JMCOUNT=4,21)=1); DRAWTEXT (JMTJ4,70,'④'),COLORYELLOW;JMTJ5:=28*("KDJ.D"(5,3,3)<30 AND COUNT(JMCOUNT=5,21)=1); DRAWTEXT (JMTJ5,70,'⑤'),COLORYELLOW;预警公式周K:="KDJ.K"(27,3,3);周D:="KDJ.D"(27,3,3);日K:="KD.K"(5,3,3);日D:="KD.D"(5,3,3);日金叉:=IF(CROSS(日K,日D),50,0);周金叉:=IF(CROSS(周K,周D),30,0);YUJ:=日金叉OR 周金叉;LB:=VOL/MA(REF(VOL,1),5);XG:YUJ AND LB>2 AND V/CAPITAL*100>3 AND V/CAPITAL*100<15;。
通达信万能KDJ指标公式
通达信万能KDJ指标公式N1:=5;N2:=10;LC:=REF(CLOSE,1);A0:=(2*C+H+L)/4;均线:=MA(A0,3)>REF(MA(A0,3),1);安全线:2,COLORRED,POINTDOT,LINETHICK4;A1:=(CLOSE-LLV(LOW,7))/(HHV(HIGH,7)-LLV(LOW,7))*10;K:MA(3*SMA(A1,6,1)-2*SMA(SMA(A1,5,1),5,1),3),LINETHICK1,COLORF00FF0;D:MA(K,3),COLORFF0000,LINETHICK1;J:3*K-2*D,LINETHICK1,COLORF00FF0;DRAWBAND(K,RGB(155,50,50),D,RGB(0,100,50));VAR1:=C-REF(C,1);VAR2:=100*EMA(EMA(VAR1,6),6)/EMA(EMA(ABS(VAR1),6),6 );MA5:=EMA(C,5);MA13:=EMA(C,13);UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1) ,LLV(L,BARSLAST(CROSS(MA13,MA5))+1),H=HHV(H,BARSLAST(CROSS(MA5,MA13)) +1),HHV(H,BARSLAST(CROSS(MA5,MA13))+1),0),COLOR0000FF;DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA1 3))+1),HHV(H,BARSLAST(CROSS(MA5,MA13))+1),L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1 ),LLV(L,BARSLAST(CROSS(MA13,MA5))+1),0),COLOR00FF00;BT:=(LLV(VAR2,2)=LLV(VAR2,7) AND COUNT(VAR2<0,2) AND CROSS(VAR2,MA(VAR2,2))) ANDREF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1);底线:0,COLORFF00FF;顶线:10,COLORFF0000;STICKLINE(UP,0,0.2,3,0),COLOR0000FF;STICKLINE(DOWN,0,0.2,3,0),COLOR00FF00;STICKLINE(BT,0,3,2,0),COLOR000088;STICKLINE(BT,0,3,1,0),COLOR0000CC;STICKLINE(BT,0,3,0.22,0),COLOR0000FF;DRAWTEXT(BT,3,'短牛'),COLOR0000FF;TJ1:=REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1) AND C<HHV(H,21)*0.82;STICKLINE(TJ1,0,2,3,0),COLOR880088;STICKLINE(TJ1,0,2,1.5,0),COLORAA00AA;STICKLINE(TJ1,0,2,0.8,0),COLORCC00CC;STICKLINE(TJ1,0,2,0.2,0),COLORFF00FF;DRAWTEXT(TJ1,2,'中牛'),COLORFF00FF;HR:=HHV(HIGH,55);HRY:=LLV(LOW,55);HRY11:=HR*HRY;HRY33:=SQRT(HRY11);TJ2:=REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1) AND C<HRY33;STICKLINE(TJ2,0,1,5,0),COLOR008888;STICKLINE(TJ2,0,1,2,0),COLOR00AAAA;STICKLINE(TJ2,0,1,1,0),COLOR00CCCC;STICKLINE(TJ2,0,1,0.2,0),COLOR00FFFF;DRAWTEXT(TJ2,1,'大牛'),COLOR00FFFF;ST:=REF(UP,1)>REF(UP,2) AND DOWN<REF(UP,1);STICKLINE(ST,10,9,5,0),COLOR008800;STICKLINE(ST,10,9,2,0),COLOR00AA00;STICKLINE(ST,10,9,1,0),COLOR00CC00;STICKLINE(ST,10,9,0.2,0),COLOR00FF00;DRAWTEXT(ST,9,'卖'),COLOR00FF00;DIFF:EMA(DCLOSE,12)-EMA(DCLOSE,26);DEA:EMA(DIFF,9),COLORFFFF00;A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,A11+1)>CLOSE AND DIFF>REF(DIFF,A11+1) AND CROSS(DIFF,DEA);DRAWTEXT(底背离,-0.6,'底背离'),COLORWHITE;A22:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A22+1)<CLOSE AND REF(DIFF,A22+1)>DIFF AND CROSS(DEA,DIFF);DRAWTEXT(顶背离,11,'顶背离'),COLORWHITE;。
【指标公式源码下载】通达信麟龙KDJ多周期指标公式
通达信麟龙KDJ多周期指标公式N:=5;M1:=3;M2:=3;ZG:=MA(HIGH,5);ZD:=MA(LOW,5);YG:=MA(HIGH,20);YD:=MA(LOW,20);ZJ:=MA(CLOSE,5);YJ:=MA(CLOSE,20);RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;日K:SMA(RSV,M1,1),COLORFF00FF,LINETHICK1;日D:SMA(日K,M2,1),COLORFFFFFF,LINETHICK1;J:3*日D-2*日K,COLOR00FFFF,LINETHICK1;MID:=MA(日K,10);CMSS:=1.03*SQRT(MA(POW((日K-MID),2),10));UPPER:MID+CMSS,LINETHICK1,COLORFFFF00;LOWER:MID-CMSS,LINETHICK1,COLOR00FF00;RSV3:=(ZJ-LLV(ZD,N*5))/(HHV(ZG,N*5)-LLV(ZD,N*5))*100;周K:SMA(RSV3,M1*5,1),LINETHICK0;周D:EMA(周K,M2*5),LINETHICK0;周J:=3*周D-2*周K,LINETHICK0;RSV2:=(YJ-LLV(YD,N*20))/(HHV(YG,N*20)-LLV(YD,N*20))*100;月K:SMA(RSV2,M1*20,1),LINETHICK0;月D:SMA(月K,M2*20,1),LINETHICK0;月J:=3*月D-2*月K,LINETHICK0;STICKLINE(周K>=REF(周K,1),周K,周D,4,0),COLOR0000FF;STICKLINE(周K<REF(周K,1),周K,周D,4,0),COLOR00FF00;STICKLINE(月K>=REF(月K,1),月K,月D,1,0),COLOR00FFFF;STICKLINE(月K<REF(月K,1),月K,月D,1,0),COLORFFFF00;大底:IF(REF(COUNT(月K<=REF(月K,1),2)=2,1) AND REF(月K<=5,1) AND月K>REF(月K,1),80,10);底:IF(REF(COUNT(月K<=REF(月K,1),2)=2,1) AND REF(月K<=10,1) AND REF(月K>=5,1)AND REF(COUNT(周K<=REF(周K,1),2)=2,1) AND REF(周K<=10,1) AND周K>REF(周K,1),80,10);大顶:IF(REF(COUNT(月K>=REF(月K,1),2)=2,1) AND REF(月K>=95,1) AND月K<REF(月K,1),20,90);顶:IF(REF(COUNT(月K>=REF(月K,1),2)=2,1) AND REF(月K>=90,1) AND REF(月K<=95,1)AND REF(COUNT(周K>=REF(周K,1),2)=2,1) AND REF(周K>=90,1) AND周K<REF(周K,1),20,90);DRAWTEXT(月K<=10 AND COUNT(月K<=REF(月K,1),2)=2 AND周K<=10 AND COUNT(周K<=REF(周K,1),2)=2 AND 日K<=10 ANDCOUNT(日K<=REF(日K,1),2)=2,50,'长线超跌');DRAWTEXT(月K>=90 AND COUNT(月K>=REF(月K,1),2)=2 AND周K>=90 AND COUNT(周K>=REF(周K,1),2)=2 AND 日K>=90 ANDCOUNT(日K>=REF(日K,1),2)=2,50,'长线超涨');DRAWTEXT(REF(COUNT(月K<=REF(月K,1),2)=2,1) AND REF(月K<=10,1)AND REF(COUNT(周K<=REF(周K,1),2)=2,1) AND REF(周K<=10,1) ANDREF(COUNT(日K<=REF(日K,1),2)=2,1) AND REF(日K<=10,1) AND日K>REF(日K,1),80,'超跌买入');DRAWTEXT(REF(COUNT(月K>=REF(月K,1),2)=2,1) AND REF(月K>=90,1)AND REF(COUNT(周K>=REF(周K,1),2)=2,1) AND REF(周K>=90,1) ANDREF(COUNT(日K>=REF(日K,1),2)=2,1) AND REF(日K>=90,1) AND日K<REF(日K,1),20,'超涨卖出');DRAWTEXT(REF(月K>10,1)AND REF(COUNT(周K<=REF(周K,1),2)=2,1) AND REF(周K<=10,1) ANDREF(COUNT(日K<=REF(日K,1),2)=2,1) AND REF(日K<=10,1) AND日K>REF(日K,1),80,'超跌买');DRAWTEXT(REF(月K<90,1)AND REF(COUNT(周K>=REF(周K,1),2)=2,1) AND REF(周K>=90,1) ANDREF(COUNT(日K>=REF(日K,1),2)=2,1) AND REF(日K>=90,1) AND日K<REF(日K,1),20,'超涨卖');DRAWTEXT(月K>10 AND周K<=10 AND COUNT(周K<=REF(周K,1),2)=2 AND 日K<=10 ANDCOUNT(日K<=REF(日K,1),2)=2,50,'中线超跌');DRAWTEXT(月K<90 AND 周K>=90 AND COUNT(周K>=REF(周K,1),2)=2 AND日K>=90 ANDCOUNT(日K>=REF(日K,1),2)=2,50,'中线超涨');。
通达信指标公式源码MACD、KDJ、RSI三合一
通达信指标公式源码MACD、KDJ、RSI三合⼀DIFF:EMA(CLOSE,7) - EMA(CLOSE,19),COLORGREEN;DEA:EMA(DIFF,9),COLORYELLOW;MACD:2*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+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 ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,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)"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)REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) ANDCROSS("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),COLORFF00FF,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.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;}STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD=REF(MACD,1) ANDMACD<0,0,MACD,0,0),COLORMAGENTA;STICKLINE(C>0,0,0,50,1),COLORBLUE;NOTEXT强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED; NOTEXT弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA; VARA1:=(DVOL/C)/2,NODRAW;VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA3:=SUM(IF(VARA1>100 AND CLOSEREF(CLOSE,1),VARA1,0),0); VARA5:=SUM(IF(VARA1<100 AND CLOSE机买:=(VARA2/VARA6)*100,LINETHICK2,COLORRED;机卖:=(VARA3/VARA6)*100,LINETHICK2,COLORGREEN;主⼒差:=机买-机卖,LINETHICK2,NODRAW;强度:主⼒差-REF(主⼒差,1),NODRAW,COLORYELLOW;STICKLINE(强度>1.5,-0.1,0,2,0),COLORYELLOW;近期:BARSLAST(强度>1.5),NODRAW,COLORGRAY;N:=7{2,100};M:=5{2,100};VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;B:=SMA(VAR1,N,1);VAR2:=SMA(B,M,1);短买:CROSS(B,VAR2) AND B<40,NODRAW,COLORRED;DRAWICON(短买,0,1);。
整合版KDJ通达信指标公式源码
非常好用,多周期K D J 同图!STICKLINE(C>0,-20,5,4,0),COLORBLACK;F1:=ZIG(3,15);F2:=IF((F1>REF(F1,1)),100,80);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(RSV,3,1);D:SMA(K,3,1);J:3*K-2*D,COLORRED;MA势:=SMA(MAX(C-REF(C,1),0),8,1)/SMA(ABS(C-REF(C,1)),8,1)*100;势:=EMA(MA势,5),COLORLIRED;趋势:=3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1)-2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1);ZZ:=趋势>REF(趋势,1);K1:=DVOL/1000000;K2:=DCLOSE;V1:=EMA(K1,5);V2:=EMA(K2,5);价异动:=K2>REF(V2,1)*1.06;量异动:=K1>REF(V1,1)*1.6&&ZZ;停牌:=DYNAINFO(17)>0;M1:=SUM(价异动,2)>0 AND 停牌;M2:=SUM(量异动,2)>0 AND REF(趋势,1)<89;鸣:(F2=100 AND C>REF(C,1) AND FILTER(M1 AND M2,3))*120,COLORRED,LINETHICK3; DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;低2:=IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL);TX:=BARSLAST(C>REF(C,1)*1.095 AND C=H);T2L:=BARSLAST(C<REF(C,1)*1.095 AND C>REF(C,1)*1.08);T3L:=BARSLAST(C<REF(C,1)*1.08 AND C>REF(C,1)*1.07);T4L:=BARSLAST(C<REF(C,1)*1.07 AND C>REF(C,1)*1.06);T5L:=BARSLAST(C<REF(C,1)*1.06 AND C>REF(C,1)*1.05);TJ1X:=COUNT(TX=0,100)=0;TJ2:=COUNT(T2L=0,100)=0;TJ3:=COUNT(T3L=0,100)=0;TJ4:=COUNT(T4L=0,100)=0;TJ5:=COUNT(T5L=0,100)=0;TJA:=C>REF(C,1)*1.05;AA:=REF(TX,1)>100 AND REF(T2L,1)>100 AND REF(T3L,1)>100 AND REF(T4L,1)>100 AND REF(T5L,1)>80 AND TJA;HHM:=HHV(MACD.MACD*100,200);LLM:=LLV(MACD.MACD*100,200);M5:=MA(C,5);M10:=MA(C,10);M20:=MA(C,20);M60:=MA(C,60);D3:=MIN(MIN(M5,M10),M20)>M60;XGT:=BARSLAST(AA AND HHM<60 AND LLM>-55);D6:=BARSSINCEN(MIN(MIN(M5,M10),M20)>M60,XGT+1);XGX:=CROSS((XGT=0 AND D3) OR D6=0,0.5);TJX:=COUNT(XGX,30)=2 AND XGX;SR11:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR21:=FILTER(SR11,10);SR31:=BACKSET(SR21,10+1);HDH:=FILTER(SR31,10);前高G:=REF(H,BARSLAST(HDH));倍量G:=VOL/REF(VOL,1)>=1.9;突破前高G:=CROSS(C,前高G);YG:= 倍量G AND 突破前高G;SJG:=BARSLAST(YG);H300:=HHVBARS(DIF,300);AL:=BOLL.UB;TQ:=BARSLAST(CROSS(AL>=REF(AL,1),0.5));E25:=EXPMA(C,25);ZF:=EVERY(RANGE(C/REF(C,1),0.97,1.05),TQ+1);ZFF:=(HHV(H,TQ+1)-LLV(L,TQ+1))/LLV(L,TQ+1)*100;TJQ:=EVERY(MAX(C,O)/AL<1.02 ,TQ+1);XL:=(ATAN((E25/REF(E25,TQ)-1)*100)*180/3.1415926);TJ1Q:=CROSS(DIF>=REF(DIF,H300),0.5) AND ZFF<17 AND ZF AND TJQ;起程:=TJ1Q AND XL>75;A1F:=REF(C,1);A3F:=(DCLOSE-A1F)/A1F*100;AA1F:=(A3F-REF(A3F,1));选股1:=CROSS(AA1F,9.8);A11F:=REF(V,1);A13F:=DVOL/A11F;AA3F:=(A13F-REF(A13F,1));选股2:=CROSS(AA3F,500);潜伏:=选股1 AND 选股2;爆发点:=(DCLOSE-REF(C,1))/REF(C,1)*100;XB:=CROSS(爆发点,20);TJ1L:=REF(CROSS(MA(C,5),C),1) AND CROSS(C,MA(C,5));TJ2L:=REF(CROSS(MA(C,10),C),1) AND CROSS(C,MA(C,10));TJ3L:=REF(CROSS(MA(C,20),C),1) AND CROSS(C,MA(C,20));TJ4L:=TJ1L OR TJ2L OR TJ3L;TJ5L:=REF(C,2)/REF(C,1)>=1.045 AND REF(C,1)<REF(O,1) AND C/REF(C,1)>1.09 AND C=H AND TJ4L;A:=(3*C+L+O+H)/6;X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8* REF(A,12)+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+ REF(A,20))/210;中线:=EMA(X,13);KKA:=EMA(C,5);KKB:=EMA(KKA,8);KKC:=EMA(KKB,13);长线1:=EMA(KKC,50);KAAA3:=REF(C,1)<REF(中线,1) AND C>中线;KBBB3:=C/REF(C,1)>1+0.01*9;KCCC3:=中线/长线1<1+0.01*20;大牛:=KAAA3 AND KBBB3 AND KCCC3 AND TJ5L;VARAA:=LLV(LOW,5);VARBA:=HHV(HIGH,5);确:=EMA((CLOSE-VARAA)/(VARBA-VARAA)*100,4);MA500:=MA(CLOSE,500);MA250:=MA(CLOSE,250);MA120:=MA(CLOSE,120);MA30:=MA(CLOSE,33);MA60:=MA(CLOSE,55);涨停收盘:=(C-REF(C,1))*100/REF(C,1)>=4 AND H-C<0.02;HD30:=FILTER(BACKSET(FILTER(REF(H,30)=HHV(H,2*30+1),30),30+1),30);LD30:=FILTER(BACKSET(FILTER(REF(H,30)=LLV(H,2*30+1),30),30+1),30);AX30:=REF(H,BARSLAST(HD30));T300:=BARSLAST(HD30)<BARSLAST(LD30) AND NOT(HD30);顶30:=IF(T300,AX30,AX30);JZ:=(CROSS(C,顶30) AND DIF>=-0.21 AND DEA<=0.37 AND MA30>MA60 AND (CROSS(C,MA30)OR CROSS(C,MA120)OR CROSS(C,MA250)OR CROSS(C,MA500) OR LOW< MA30)) AND MA30- MA60<0.7 AND 涨停收盘AND ABS((顶30-MA30)/顶30*100)<10;信:IF(确>REF(确,1) AND DIF>DEA AND (JZ OR 大牛OR XB OR 潜伏OR 起程OR CURRBARSCOUNT=CONST(SJG)+2 OR TJX OR (CCI<=100 AND L<=低2)),120,0)STICK,LINETHICK5,COLORLIMAGENTA;卖警:=IF(PEAKBARS(3,15,1)=1,80,100),COLORGREEN;泥淖:=IF((F1> REF(F1,1)),100,80),COLORFF9900;Q_1:=C-REF(C,1);Q_2:=100*EMA(EMA(Q_1,6),6)/EMA(EMA(ABS(Q_1),6),6);Q_3:=CROSS(EMA(C,19),EMA(C,7));Q_4:=CROSS(EMA(C,7),EMA(C,19));Z1:=L=LLV(L,BARSLAST(Q_3)+1);Z2:=LLV(L,BARSLAST(Q_3)+1);Z3:=H=HHV(H,BARSLAST(Q_4)+1);Z4:=HHV(H,BARSLAST(Q_4)+1);上0:=DRAWLINE(Z1,Z2,Z3,Z4,0);Y1:=H=HHV(H,BARSLAST(Q_4)+1);Y2:=HHV(H,BARSLAST(Q_4)+1);Y3:=L=LLV(L,BARSLAST(Q_3)+1);Y4:=LLV(L,BARSLAST(Q_3)+1);下0:=DRAWLINE(Y1,Y2,Y3,Y4,0);TJ:=IF(上0<REF(上0,1) AND 下0=上0,1,0);未来空柱:=IF(REF(TJ,1)=0 AND TJ>=1,100,0);AVAR1:=(C-LLV(L,20))/(HHV(H,20)-LLV(L,20))*100;AVAR2:=(C-LLV(L,10))/(HHV(H,10)-LLV(L,10))*100;AVAR3:=(C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100;AVAR4:=DMA(SMA((AVAR1+AVAR2+AVAR3)/3,2,1),3);K0:=SMA(AVAR4,2,1),COLOR0000FF,LINETHICK2;M0:=SMA(K0,2,1),COLORFFFFFF;SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR2:=FILTER(SR1,10);SR3:=BACKSET(SR2,10+1);HD:=FILTER(SR3,10);前高:=REF(H,BARSLAST(HD));倍量:=VOL/REF(VOL,1)>=1.9;突破前高:=CROSS(C,前高);Y:= 倍量AND 突破前高;SJ:=BARSLAST(Y);DRAWTEXT(CURRBARSCOUNT=CONST(SJ)+2,45,'过左峰'),COLORYELLOW;B:=ZIG(3,10);G:=MA(B,2);W:=CROSS(G,B);DRAWTEXT(W=1,70,'卖' ),COLOR00FF00;VARA1:=(((CLOSE - MA(CLOSE,6)) / MA(CLOSE,6)) * 100);VARA2:=(((CLOSE - MA(CLOSE,12)) / MA(CLOSE,12)) * 100);VARA3:=(((CLOSE - MA(CLOSE,24)) / MA(CLOSE,24)) * 100);VARA4:=(((VARA1 + (2 * VARA2)) + (3 * VARA3)) / 6);VARA5:=MA(VARA4,3);底部反转:=CROSS(KDJ.J,0) AND (VARA5 <= (0 - 7));DRAWTEXT(F2=100 AND 底部反转,50,'反转预警'),COLORRED;值:=(EMA(((CLOSE-LLV(LOW,14))/(HHV(HIGH,35)-LLV(LOW,56)))*(4),4))*(25),COLORG REEN,LINETHICK2;DRAWTEXT(FILTER(CROSS(值,5),10), 40,'超低'),COLORYELLOW;DIFX:=(2*EMA(CLOSE, 12)-EMA(EMA(CLOSE,12),12))-(2*EMA(CLOSE,26)-EMA(EMA(CLOSE, 26),26));DEAX:=2*EMA(DIFX, 9) - EMA(EMA(DIFX, 9),9);FF:=C=LLV(C,180);{}GG:= DEAX> REF(DEAX,1) AND REF(DEAX> REF(DEAX,1),1)=1;LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1;拐点出击:=(NOT(未来空柱=100) AND F2=100 AND LL AND GG)*DEAX;VAR1:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;VAR2:=SMA(VAR1,3,1);VAR3:=SMA(VAR2,3,1);VAR4:=SMA(VAR3,3,1);山底:=IF(CLOSE>SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORGREEN;山顶:=IF(CLOSE<SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORRED; DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE;DIFF变红:=IF(DIFF>=REF(DIFF,1),DIFF,DRAWNULL),COLORLIRED;{DEA:=EMA(DIFF,9),COLORWHITE;}DEA变红:=IF(DEA>=REF(DEA,1),DEA,DRAWNULL),COLORLIMAGENTA;{MACD:=2*(DIFF-DEA),COLORSTICK;}NOTEXT上买下卖:=CLOSE-REF(CLOSE,49),COLORWHITE;NOTEXT红买绿卖:=MA(NOTEXT上买下卖,49),COLORGREEN;上买下卖:=IF(NOTEXT上买下卖>NOTEXT红买绿卖,NOTEXT上买下卖,DRAWNULL),LINETHICK2,COLORMAGENTA;红买绿卖:=IF(NOTEXT红买绿卖>=REF(NOTEXT红买绿卖,1) AND NOTEXT上买下卖>NOTEXT红买绿卖,NOTEXT红买绿卖,DRAWNULL),LINETHICK3,COLORRED;红买:=上买下卖AND 红买绿卖AND DEA变红,COLORRED,NODRAW;绿卖:=红买!=1,COLORGREEN,NODRAW;底:=SMA(VAR2,3,1),COLORGREEN;顶:=SMA(底,3,1),COLORRED;方向:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,30))/MA(CLOSE,30);方向向下:=(DMA((2*CLOSE+LOW+HIGH)/4,方向)),COLORGREEN;红灯停:=IF(CLOSE<SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORRED;向下:=方向向下AND 红灯停,COLORGREEN,NODRAW;空仓基因:=绿卖AND 向下,COLORGREEN,NODRAW;B2:=BARSLAST(REF(CROSS(顶,底),1));顶背离:=空仓基因AND REF(C,B2+1)<HHV(H,3) AND REF(底,B2+1)>底AND CROSS(顶,底) AND 底>80 AND MA(C,5)>MA(C,377) AND 山顶;DRAWTEXT(顶背离=1,85,'顶背'),COLORFFFF00;DRAWTEXT(FILTER(拐点出击,30), 30,'拐点→'),COLORWHITE;多空:118,COLOR0B0BFF,LINETHICK5;红: IF(K0>M0,118,DRAWNULL),COLORFF00FF,LINETHICK5;青: IF(K0<M0,118,DRAWNULL),COLOR00FF00,LINETHICK5;STICKLINE(CROSS(90,J),88,100,1,0),COLOR00FF00;DRAWTEXT(CROSS(90,J),100,'。
整合版KDJ通达信指标公式源码
非常好用,多周期K D J 同图!STICKLINE(C>0,-20,5,4,0),COLORBLACK;F1:=ZIG(3,15);F2:=IF((F1>REF(F1,1)),100,80);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(RSV,3,1);D:SMA(K,3,1);J:3*K-2*D,COLORRED;MA势:=SMA(MAX(C-REF(C,1),0),8,1)/SMA(ABS(C-REF(C,1)),8,1)*100;势:=EMA(MA势,5),COLORLIRED;趋势:=3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1)-2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1);ZZ:=趋势>REF(趋势,1);K1:=DVOL/1000000;K2:=DCLOSE;V1:=EMA(K1,5);V2:=EMA(K2,5);价异动:=K2>REF(V2,1)*1.06;量异动:=K1>REF(V1,1)*1.6&&ZZ;停牌:=DYNAINFO(17)>0;M1:=SUM(价异动,2)>0 AND 停牌;M2:=SUM(量异动,2)>0 AND REF(趋势,1)<89;鸣:(F2=100 AND C>REF(C,1) AND FILTER(M1 AND M2,3))*120,COLORRED,LINETHICK3; DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;低2:=IF(CURRBARSCOUNT<=60, CONST(IF(ISLASTBAR=1,LLV(L,BARSLAST(CURRBARSCOUNT=60)),1)),DRAWNULL);TX:=BARSLAST(C>REF(C,1)*1.095 AND C=H);T2L:=BARSLAST(C<REF(C,1)*1.095 AND C>REF(C,1)*1.08);T3L:=BARSLAST(C<REF(C,1)*1.08 AND C>REF(C,1)*1.07);T4L:=BARSLAST(C<REF(C,1)*1.07 AND C>REF(C,1)*1.06);T5L:=BARSLAST(C<REF(C,1)*1.06 AND C>REF(C,1)*1.05);TJ1X:=COUNT(TX=0,100)=0;TJ2:=COUNT(T2L=0,100)=0;TJ3:=COUNT(T3L=0,100)=0;TJ4:=COUNT(T4L=0,100)=0;TJ5:=COUNT(T5L=0,100)=0;TJA:=C>REF(C,1)*1.05;AA:=REF(TX,1)>100 AND REF(T2L,1)>100 AND REF(T3L,1)>100 AND REF(T4L,1)>100 AND REF(T5L,1)>80 AND TJA;HHM:=HHV(MACD.MACD*100,200);LLM:=LLV(MACD.MACD*100,200);M5:=MA(C,5);M10:=MA(C,10);M20:=MA(C,20);M60:=MA(C,60);D3:=MIN(MIN(M5,M10),M20)>M60;XGT:=BARSLAST(AA AND HHM<60 AND LLM>-55);D6:=BARSSINCEN(MIN(MIN(M5,M10),M20)>M60,XGT+1);XGX:=CROSS((XGT=0 AND D3) OR D6=0,0.5);TJX:=COUNT(XGX,30)=2 AND XGX;SR11:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR21:=FILTER(SR11,10);SR31:=BACKSET(SR21,10+1);HDH:=FILTER(SR31,10);前高G:=REF(H,BARSLAST(HDH));倍量G:=VOL/REF(VOL,1)>=1.9;突破前高G:=CROSS(C,前高G);YG:= 倍量G AND 突破前高G;SJG:=BARSLAST(YG);H300:=HHVBARS(DIF,300);AL:=BOLL.UB;TQ:=BARSLAST(CROSS(AL>=REF(AL,1),0.5));E25:=EXPMA(C,25);ZF:=EVERY(RANGE(C/REF(C,1),0.97,1.05),TQ+1);ZFF:=(HHV(H,TQ+1)-LLV(L,TQ+1))/LLV(L,TQ+1)*100;TJQ:=EVERY(MAX(C,O)/AL<1.02 ,TQ+1);XL:=(ATAN((E25/REF(E25,TQ)-1)*100)*180/3.1415926);TJ1Q:=CROSS(DIF>=REF(DIF,H300),0.5) AND ZFF<17 AND ZF AND TJQ;起程:=TJ1Q AND XL>75;A1F:=REF(C,1);A3F:=(DCLOSE-A1F)/A1F*100;AA1F:=(A3F-REF(A3F,1));选股1:=CROSS(AA1F,9.8);A11F:=REF(V,1);A13F:=DVOL/A11F;AA3F:=(A13F-REF(A13F,1));选股2:=CROSS(AA3F,500);潜伏:=选股1 AND 选股2;爆发点:=(DCLOSE-REF(C,1))/REF(C,1)*100;XB:=CROSS(爆发点,20);TJ1L:=REF(CROSS(MA(C,5),C),1) AND CROSS(C,MA(C,5));TJ2L:=REF(CROSS(MA(C,10),C),1) AND CROSS(C,MA(C,10));TJ3L:=REF(CROSS(MA(C,20),C),1) AND CROSS(C,MA(C,20));TJ4L:=TJ1L OR TJ2L OR TJ3L;TJ5L:=REF(C,2)/REF(C,1)>=1.045 AND REF(C,1)<REF(O,1) AND C/REF(C,1)>1.09 AND C=H AND TJ4L;A:=(3*C+L+O+H)/6;X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8* REF(A,12)+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+ REF(A,20))/210;中线:=EMA(X,13);KKA:=EMA(C,5);KKB:=EMA(KKA,8);KKC:=EMA(KKB,13);长线1:=EMA(KKC,50);KAAA3:=REF(C,1)<REF(中线,1) AND C>中线;KBBB3:=C/REF(C,1)>1+0.01*9;KCCC3:=中线/长线1<1+0.01*20;大牛:=KAAA3 AND KBBB3 AND KCCC3 AND TJ5L;VARAA:=LLV(LOW,5);VARBA:=HHV(HIGH,5);确:=EMA((CLOSE-VARAA)/(VARBA-VARAA)*100,4);MA500:=MA(CLOSE,500);MA250:=MA(CLOSE,250);MA120:=MA(CLOSE,120);MA30:=MA(CLOSE,33);MA60:=MA(CLOSE,55);涨停收盘:=(C-REF(C,1))*100/REF(C,1)>=4 AND H-C<0.02;HD30:=FILTER(BACKSET(FILTER(REF(H,30)=HHV(H,2*30+1),30),30+1),30);LD30:=FILTER(BACKSET(FILTER(REF(H,30)=LLV(H,2*30+1),30),30+1),30);AX30:=REF(H,BARSLAST(HD30));T300:=BARSLAST(HD30)<BARSLAST(LD30) AND NOT(HD30);顶30:=IF(T300,AX30,AX30);JZ:=(CROSS(C,顶30) AND DIF>=-0.21 AND DEA<=0.37 AND MA30>MA60 AND (CROSS(C,MA30)OR CROSS(C,MA120)OR CROSS(C,MA250)OR CROSS(C,MA500) OR LOW< MA30)) AND MA30- MA60<0.7 AND 涨停收盘AND ABS((顶30-MA30)/顶30*100)<10;信:IF(确>REF(确,1) AND DIF>DEA AND (JZ OR 大牛OR XB OR 潜伏OR 起程OR CURRBARSCOUNT=CONST(SJG)+2 OR TJX OR (CCI<=100 AND L<=低2)),120,0)STICK,LINETHICK5,COLORLIMAGENTA;卖警:=IF(PEAKBARS(3,15,1)=1,80,100),COLORGREEN;泥淖:=IF((F1> REF(F1,1)),100,80),COLORFF9900;Q_1:=C-REF(C,1);Q_2:=100*EMA(EMA(Q_1,6),6)/EMA(EMA(ABS(Q_1),6),6);Q_3:=CROSS(EMA(C,19),EMA(C,7));Q_4:=CROSS(EMA(C,7),EMA(C,19));Z1:=L=LLV(L,BARSLAST(Q_3)+1);Z2:=LLV(L,BARSLAST(Q_3)+1);Z3:=H=HHV(H,BARSLAST(Q_4)+1);Z4:=HHV(H,BARSLAST(Q_4)+1);上0:=DRAWLINE(Z1,Z2,Z3,Z4,0);Y1:=H=HHV(H,BARSLAST(Q_4)+1);Y2:=HHV(H,BARSLAST(Q_4)+1);Y3:=L=LLV(L,BARSLAST(Q_3)+1);Y4:=LLV(L,BARSLAST(Q_3)+1);下0:=DRAWLINE(Y1,Y2,Y3,Y4,0);TJ:=IF(上0<REF(上0,1) AND 下0=上0,1,0);未来空柱:=IF(REF(TJ,1)=0 AND TJ>=1,100,0);AVAR1:=(C-LLV(L,20))/(HHV(H,20)-LLV(L,20))*100;AVAR2:=(C-LLV(L,10))/(HHV(H,10)-LLV(L,10))*100;AVAR3:=(C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100;AVAR4:=DMA(SMA((AVAR1+AVAR2+AVAR3)/3,2,1),3);K0:=SMA(AVAR4,2,1),COLOR0000FF,LINETHICK2;M0:=SMA(K0,2,1),COLORFFFFFF;SR1:=REF(HIGH,10)=HHV(HIGH,2*10+1);SR2:=FILTER(SR1,10);SR3:=BACKSET(SR2,10+1);HD:=FILTER(SR3,10);前高:=REF(H,BARSLAST(HD));倍量:=VOL/REF(VOL,1)>=1.9;突破前高:=CROSS(C,前高);Y:= 倍量AND 突破前高;SJ:=BARSLAST(Y);DRAWTEXT(CURRBARSCOUNT=CONST(SJ)+2,45,'过左峰'),COLORYELLOW;B:=ZIG(3,10);G:=MA(B,2);W:=CROSS(G,B);DRAWTEXT(W=1,70,'卖' ),COLOR00FF00;VARA1:=(((CLOSE - MA(CLOSE,6)) / MA(CLOSE,6)) * 100);VARA2:=(((CLOSE - MA(CLOSE,12)) / MA(CLOSE,12)) * 100);VARA3:=(((CLOSE - MA(CLOSE,24)) / MA(CLOSE,24)) * 100);VARA4:=(((VARA1 + (2 * VARA2)) + (3 * VARA3)) / 6);VARA5:=MA(VARA4,3);底部反转:=CROSS(KDJ.J,0) AND (VARA5 <= (0 - 7));DRAWTEXT(F2=100 AND 底部反转,50,'反转预警'),COLORRED;值:=(EMA(((CLOSE-LLV(LOW,14))/(HHV(HIGH,35)-LLV(LOW,56)))*(4),4))*(25),COLORG REEN,LINETHICK2;DRAWTEXT(FILTER(CROSS(值,5),10), 40,'超低'),COLORYELLOW;DIFX:=(2*EMA(CLOSE, 12)-EMA(EMA(CLOSE,12),12))-(2*EMA(CLOSE,26)-EMA(EMA(CLOSE, 26),26));DEAX:=2*EMA(DIFX, 9) - EMA(EMA(DIFX, 9),9);FF:=C=LLV(C,180);{}GG:= DEAX> REF(DEAX,1) AND REF(DEAX> REF(DEAX,1),1)=1;LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1;拐点出击:=(NOT(未来空柱=100) AND F2=100 AND LL AND GG)*DEAX;VAR1:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;VAR2:=SMA(VAR1,3,1);VAR3:=SMA(VAR2,3,1);VAR4:=SMA(VAR3,3,1);山底:=IF(CLOSE>SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORGREEN;山顶:=IF(CLOSE<SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORRED; DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE;DIFF变红:=IF(DIFF>=REF(DIFF,1),DIFF,DRAWNULL),COLORLIRED;{DEA:=EMA(DIFF,9),COLORWHITE;}DEA变红:=IF(DEA>=REF(DEA,1),DEA,DRAWNULL),COLORLIMAGENTA;{MACD:=2*(DIFF-DEA),COLORSTICK;}NOTEXT上买下卖:=CLOSE-REF(CLOSE,49),COLORWHITE;NOTEXT红买绿卖:=MA(NOTEXT上买下卖,49),COLORGREEN;上买下卖:=IF(NOTEXT上买下卖>NOTEXT红买绿卖,NOTEXT上买下卖,DRAWNULL),LINETHICK2,COLORMAGENTA;红买绿卖:=IF(NOTEXT红买绿卖>=REF(NOTEXT红买绿卖,1) AND NOTEXT上买下卖>NOTEXT红买绿卖,NOTEXT红买绿卖,DRAWNULL),LINETHICK3,COLORRED;红买:=上买下卖AND 红买绿卖AND DEA变红,COLORRED,NODRAW;绿卖:=红买!=1,COLORGREEN,NODRAW;底:=SMA(VAR2,3,1),COLORGREEN;顶:=SMA(底,3,1),COLORRED;方向:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,30))/MA(CLOSE,30);方向向下:=(DMA((2*CLOSE+LOW+HIGH)/4,方向)),COLORGREEN;红灯停:=IF(CLOSE<SAR(4,6,20),SAR(4,6,20),DRAWNULL),CIRCLEDOT,COLORRED;向下:=方向向下AND 红灯停,COLORGREEN,NODRAW;空仓基因:=绿卖AND 向下,COLORGREEN,NODRAW;B2:=BARSLAST(REF(CROSS(顶,底),1));顶背离:=空仓基因AND REF(C,B2+1)<HHV(H,3) AND REF(底,B2+1)>底AND CROSS(顶,底) AND 底>80 AND MA(C,5)>MA(C,377) AND 山顶;DRAWTEXT(顶背离=1,85,'顶背'),COLORFFFF00;DRAWTEXT(FILTER(拐点出击,30), 30,'拐点→'),COLORWHITE;多空:118,COLOR0B0BFF,LINETHICK5;红: IF(K0>M0,118,DRAWNULL),COLORFF00FF,LINETHICK5;青: IF(K0<M0,118,DRAWNULL),COLOR00FF00,LINETHICK5;STICKLINE(CROSS(90,J),88,100,1,0),COLOR00FF00;DRAWTEXT(CROSS(90,J),100,'。
通达信指标公式源码MACD、KDJ、RSI三合一
DIFF:EMA(CLOSE,7) - EMA(CLOSE,19),COLORGREEN;DEA:EMA(DIFF,9),COLORYELLOW;MACD:2*(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 ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("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 ANDREF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) ANDCROSS("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),COLORFF00FF,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.1,0,2,0),COLORRED;STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;}STICKLINE(D1>0,0.1,0,2,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<=REF(MACD,1) ANDMACD>0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORCYAN; STICKLINE(MACD>=REF(MACD,1) ANDMACD<0,0,MACD,0,0),COLORMAGENTA;STICKLINE(C>0,0,0,50,1),COLORBLUE;NOTEXT强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED; NOTEXT弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA; VARA1:=(DVOL/C)/2,NODRAW;VARA2:=SUM(IF(VARA1>100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA3:=SUM(IF(VARA1>100 AND CLOSE<REF(CLOSE,1),VARA1,0),0); VARA4:=SUM(IF(VARA1<100 AND CLOSE>REF(CLOSE,1),VARA1,0),0); VARA5:=SUM(IF(VARA1<100 AND CLOSE<REF(CLOSE,1),VARA1,0),0); VARA6:=VARA2+VARA3+VARA4+VARA5;机买:=(VARA2/VARA6)*100,LINETHICK2,COLORRED;机卖:=(VARA3/VARA6)*100,LINETHICK2,COLORGREEN;主力差:=机买-机卖,LINETHICK2,NODRAW;强度:主力差-REF(主力差,1),NODRAW,COLORYELLOW;STICKLINE(强度>1.5,-0.1,0,2,0),COLORYELLOW;近期:BARSLAST(强度>1.5),NODRAW,COLORGRAY;N:=7{2,100};M:=5{2,100};VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;B:=SMA(VAR1,N,1);VAR2:=SMA(B,M,1);短买:CROSS(B,VAR2) AND B<40,NODRAW,COLORRED;DRAWICON(短买,0,1);。
【指标公式源码下载】通达信MACD+KDJ指标公式
通达信MACD+KDJ指标公式RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K0:=SMA(RSV,3,1);D0:=SMA(K0,3,1);J0:=3*K0-2*D0;DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORGREEN,NODRAW; DEA:EMA(DIFF,9),COLORLIRED,NODRAW;MACD:2*(DIFF-DEA),COLORMAGENTA,NODRAW;{RSV1:=(HHV(H,9.8)-C)/(HHV(H,9.8)-LLV(L,9.8))*101;KK:=SMA(RSV1,3,1);DD:=SMA(KK,3,1);JJ:=3*KK-2*DD; }KX:=250;KH:=HHV(K0,KX);DH:=HHV(D0,KX);JH:=HHV(J0,KX);KL:=LLV(K0,KX);DL:=LLV(D0,KX);JL:=LLV(J0,KX);HKMAX:=MAX(KH,MAX(DH,JH));LKMIN:=MIN(KL,MIN(DL,JL));KHLB:=(HKMAX+LKMIN)/2;KHLC:=HKMAX-LKMIN;MHF:=HHV(DIFF,KX);MHD:=HHV(DEA,KX);MHM:=HHV(MACD,KX);MLF:=LLV(DIFF,KX);MLD:=LLV(DEA,KX);MLM:=LLV(MACD,KX);HMAX:=MAX(MHF,MAX(MHD,MHM));LMIN:=MIN(MLF,MIN(MLD,MLM));FHLB:=(HMAX-LMIN)/100;FHLC:=HMAX-LMIN;SH:(0-FHLB)*(KHLC/FHLC)+KHLB,COLOR00AAAA;{DIFFA:=(DIFF-FHLB)*(KHLC/FHLC)+KHLB;DEAA:=(DEA-FHLB)*(KHLC/FHLC)+KHLB;DRAWBAND(DIFFA,RGB(255,110,150),DEAA,RGB(100,255,150));} DRAWTEXT(ISLASTBAR=1,SH,' 0 轴'),COLOR00AAAA;K:K0,LINETHICK2,COLORFF6600;D:D0,LINETHICK2,COLOR99FF00;J:J0,LINETHICK2,COLORRED;MACDA:=(MACD-FHLB)*(KHLC/FHLC)+KHLB;CDA:=MACD<REF(MACD,1) AND MACD>0;CDB:=MACD>=REF(MACD,1) AND MACD>0;CDC:=MACD>REF(MACD,1) AND MACD<0;CDD:=MACD<=REF(MACD,1) AND MACD<0;STICKLINE(CDA,SH,MACDA,1.8,0),COLOR0066FF;{黄色段} STICKLINE(CDA,SH,MACDA,1.5,0),COLOR0077FF;STICKLINE(CDA,SH,MACDA,1.2,0),COLOR0088FF;STICKLINE(CDA,SH,MACDA,1.0,0),COLOR0099FF;STICKLINE(CDA,SH,MACDA,0.8,0),COLOR00AAFF;STICKLINE(CDA,SH,MACDA,0.5,0),COLOR00EEFF;STICKLINE(CDB,SH,MACDA,1.8,0),COLOR0000AA; {红色段} STICKLINE(CDB,SH,MACDA,1.5,0),COLOR0011BB;STICKLINE(CDB,SH,MACDA,1.2,0),COLOR0022CC;STICKLINE(CDB,SH,MACDA,1.0,0),COLOR0033DD;STICKLINE(CDB,SH,MACDA,0.8,0),COLOR0044EE;STICKLINE(CDB,SH,MACDA,0.5,0),COLOR0055FF;STICKLINE(CDC,SH,MACDA,1.8,0),COLORAA00BB;{向上粉红} STICKLINE(CDC,SH,MACDA,1.5,0),COLORBB11BB;STICKLINE(CDC,SH,MACDA,1.2,0),COLORCC22BB;STICKLINE(CDC,SH,MACDA,1.0,0),COLORDD33BB;STICKLINE(CDC,SH,MACDA,0.8,0),COLOREE44BB;STICKLINE(CDC,SH,MACDA,0.5,0),COLORFF55BB;STICKLINE(CDD,SH,MACDA,1.8,0),COLOR007700;{青色} STICKLINE(CDD,SH,MACDA,1.5,0),COLOR008811;STICKLINE(CDD,SH,MACDA,1.2,0),COLOR00AA22;STICKLINE(CDD,SH,MACDA,1.0,0),COLOR00BB33;STICKLINE(CDD,SH,MACDA,0.8,0),COLOR00DD44;STICKLINE(CDD,SH,MACDA,0.5,0),COLOR00DD55;{顶底信号}VAR51:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;VAR52:=SMA(VAR51,4,1);VAR53:=SMA(VAR52,6,1);VAR54:=VOL/CAPITAL*34;VAR55:=REF(VAR54,1);STICKLINE(VAR53<7 AND VAR52<11,-3,0,3,0),LINETHICK2,COLORYELLOW; STICKLINE(VAR53>89.5 AND VAR52>91,100,97,3,0),LINETHICK1,COLORFF8888; STICKLINE(VAR53>88.5 AND VAR52>94.6,100,95,5,0),COLORRED;。
通达信指标公式源码 组合智能KDJ 副图源码
源码:VAR1:=REF(LOW,1);VAR2:=SMA(ABS(LOW-VAR1),3,1)/SMA(MAX(LOW-VAR1,0),3,1)*100; VAR3:=EMA(IF(CLOSE*1.2,VAR2*10,VAR2/10),3);VAR4:=LLV(LOW,38);VAR5:=HHV(VAR3,38);VAR6:=IF(LLV(LOW,90),1,0);VAR7:=EMA(IF(LOW<=VAR4,(VAR3+VAR5*2)/2,0),3)/618*VAR6; VAR8:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;VAR9:=SMA(VAR8,13,8);底线:0,COLOR00FFFF;主力吸货:VAR7,COLOR0000FF;吸筹1:STICKLINE(VAR7,0,VAR7,6,0),COLOR0000FF;吸筹2:STICKLINE(VAR7,0,VAR7,5,0),COLOR6600FF;吸筹3:STICKLINE(VAR7,0,VAR7,4,0),COLORBB00FF;吸筹4:STICKLINE(VAR7,0,VAR7,3,0),COLORFF00FF;吸筹5:STICKLINE(VAR7,0,VAR7,2,0),COLORFF33FF;吸筹6:STICKLINE(VAR7,0,VAR7,1,0),COLORFF66FF;吸筹7:STICKLINE(VAR7,0,VAR7,0,0),COLORFF99FF;BIAS1:=(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100;BIAS2:=(CLOSE-MA(CLOSE,12))/MA(CLOSE,12)*100;BIAS3:=(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100;BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;乖离:=MA(BIAS,3);抄底:IF(乖离<-12 AND 乖离>=-18,-4,0), COLORCYAN,LINETHICK1; STICKLINE(乖离<-12 AND 乖离>=-18,2,0,6,0) , COLORCYAN;抄底二:IF(乖离<-18,3,0),COLORFF35FF,LINETHICK1;STICKLINE(乖离<-18,3,0,6,0),COLORFF35FF;抄底三:IF(乖离<-6,5,0),COLORRED,LINETHICK1;STICKLINE(乖离<-6,5,3,2,1),COLORRED;抄底四:IF(乖离<-4.5,0,0),COLOR00FFFF,LINETHICK1;STICKLINE(乖离<-4.5,0,1,3,1),COLOR00FFFF;VARA1:=DMA(CLOSE,VOL/MA(VOL,4)/4);VARA2:=DMA(CLOSE,VOL/MA(VOL,31)/31);VARA3:=(CLOSE-VARA1)/VARA1*100<-10;VARA4:=(VARA1-VARA2)/VARA2*100<-16;VARA5:=(CLOSE-MA(CLOSE,50))/MA(CLOSE,50)*100<-23;VARA6:=SMA(MAX(CLOSE-REF(CLOSE,1),0),3,1)/SMA(ABS(CLOSE-REF(CLOS E,1)),3,1)*100>16;VARA7:=100*(HHV(HIGH,27)-CLOSE)/(HHV(HIGH,27)-LLV(LOW,27)); VARA8:=INDEXC;VARA9:=MA(VARA8,6);VARA:=MA(VARA8,24);VARB:=MA(VARA8,32);VARC:=VARB>VARA9*1.11 AND VARA>VARA9*1.095;SSS:=(VARA3 AND VARA4 AND (OPEN-REF(CLOSE,1))/REF(CLOSE,1)>-0.07 OR VARA5 AND VARA6 AND CROSS(VARA7,79) OR VARC ANDCLOSE/COST(8)<=0.8)*100;抄底王:SSS>0,COLORWHITE,LINETHICK1;STICKLINE(SSS>0,0,6,6,0),COLORWHITE;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:SMA(RSV,3,1),COLORWHITE;D:SMA(K,3,1),COLORYELLOW;J:3*K-2*D,COLORMAGENTA;底: 20,LINETHICK1 ,POINTDOT, COLOR77AA1A;入顶: 80,LINETHICK2 ,POINTDOT , COLOR9966FF;大顶: 100,LINETHICK2 ,POINTDOT ,COLOR22A6E6;顶轴:105, POINTDOT,LINETHICK2;上轴:90, POINTDOT,LINETHICK2;下轴:10, POINTDOT,LINETHICK2;底轴:0, POINTDOT,LINETHICK2;抢钱轴:-10, POINTDOT,LINETHICK2;DRAWTEXT(CROSS(J,顶轴) ,100,'大出'), COLORYELLOW;DRAWTEXT(CROSS(J,上轴) ,90,'小出'), COLOR99FFCC;DRAWTEXT(CROSS(下轴,J) ,10,'小进'), COLORBLUE;DRAWTEXT(CROSS(底轴,J) ,0,'大进'), COLORRED;DRAWTEXT(CROSS(抢钱轴,J) ,-5,'狂进'), COLORWHITE;A01:=DYNAINFO(5); IF(K<REF(K,1),K,DRAWNULL),COLORGREEN,LINETHICK1;IF(D<REF(D,1),D,DRAWNULL),COLORCYAN,LINETHICK1;IF(J<REF(J,1),J,DRAWNULL),COLORFFFF00,LINETHICK1;IF(K>REF(K,1),K,DRAWNULL),COLORRED,LINETHICK1;IF(D>REF(D,1),D,DRAWNULL),COLORYELLOW,LINETHICK1;IF(J>REF(J,1),J,DRAWNULL),COLORFF00FF,LINETHICK1;小底:REF(IF((MA(C,5)-C)/C>0.04 AND(MA(C,10)-MA(C,5))/MA(C,5)>0.04,5,0),1),COLORYELLOW;A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19)+100 ;B:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14))+100;D1:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4)+1 00;大底:=(A<15 AND REF(A,1)<15 AND D1<18 AND B>REF(B,1) AND CROSS(B,A) AND B>D1AND (REF(B,1)<5 OR REF(B,2)<5 ) AND (D1>=A OR REF( B,1)<1 )); STICKLINE( 大底,0,10,11,0 ),COLORRED;DRAWTEXT(大底,11,'大底')COLORFF00FF;VARFN:=LOW*0.9;VAR11N:=EMA(VARFN,30);VAR12N:=CLOSE-REF(CLOSE,1);VAR13N:=MAX(VAR12N,0);VAR14N:=ABS(VAR12N);VAR15N:=SMA(VAR13N,7,1)/SMA(VAR14N,7,1)*100;VAR16N:=SMA(VAR13N,13,1)/SMA(VAR14N,13,1)*100;VAR17N:=BARSCOUNT(CLOSE);VAR18N:=SMA(MAX(VAR12N,0),6,1)/SMA(ABS(VAR12N),6,1)*100;VAR19N:=(-200)*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60))+10 0;VAR1AN:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,15))*100;VAR1BN:=SMA((SMA(VAR1AN,4,1)-50)*2,3,1);VAR1CN:=(INDEXC-LLV(INDEXL,14))/(HHV(INDEXH,14)-LLV(INDEXL,14))*10 0;VAR1DN:=SMA(VAR1CN,4,1);VAR1EN:=SMA(VAR1DN,3,1);VAR1FN:=(HHV(HIGH,30)-CLOSE)/CLOSE*100;VAR20N:=VAR18N<=25 AND VAR19N<-95 AND VAR1FN>20 ANDVAR1BN<-30 AND VAR1EN<30AND VAR11N-CLOSE>=-0.25 AND VAR15N<22 AND VAR16N<28 ANDVAR17N>50;STICKLINE(VAR20N,0,70,1,0),COLORBLUE,LINETHICK3 ;DRAWTEXT(VAR20N,80,'★青龙出海!'),COLORBLUE; HP:=HHV(H,9);LP:=LLV(L,9);R:=(C-LP)/(HP-LP)*100;M:=MA(R,40);S:=STD(R,40);高:=M+2*S;中:=M;低:=M-2*S;【高】: 高,COLOR0099FF;【中】: 中,POINTDOT,COLORWHITE;【低】: 低,COLOR00FF00;。
KDJ优化通达信指标公式源码
10,COLORRED;20,COLOR00FF00,LINETHICK3,POINTDOT;40,COLOR00FFFF,LINETHICK3,POINTDOT;50,COLORRED,LINETHICK2;60,COLORRED,LINETHICK3,POINTDOT;80,COLOR00FFFF,LINETHICK3,POINTDOT;90,COLORWHITE;100,COLOR00FF00,LINETHICK1;{进入异动区}{当出现进入异动区提示时需观察买入,最好是第二次KDJ三线相交时介入} VAR7:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;VAR8:=EMA(VAR7,30);VAR9:=EMA(VAR8,30);VAR10:=3*VAR8-2*VAR9;势:=EMA(VAR10,5);DRAWTEXT(CROSS(10,势),69,'进'),COLORYELLOW;DRAWTEXT(CROSS(10,势),58,'入'),COLORFF00FF;DRAWTEXT(CROSS(10,势),43,'异'),COLOR00C0FF;DRAWTEXT(CROSS(10,势),31,'动[↓]'),COLORFFFF6F;DRAWTEXT(CROSS(10,势),19,'区'), COLORB47DFF;{长线持股}{含未来函数:DRAWLINE当天出现信号可择机介入,明日买、卖需观察}A7:=C-REF(C,1);A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);SHORT:=7; LONG:=19;RMA:=EMA(CLOSE,SHORT);NMA:=EMA(CLOSE,LONG);UP:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1),LLV(L,BARSLAST(CROSS(NMA,RMA))+1),H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1),HHV(H,BARSLAST(CROSS(RMA,NMA))+1),0);DOWN:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(RMA,NMA))+1),HHV(H,BARSLAST(CROSS(RMA,NMA))+1),L=LLV(L,BARSLAST(CROSS(NMA,RMA))+1),LLV(L,BARSLAST(CROSS(NMA,RMA))+1),0);买进:=(LLV(A8,2)=LLV(A8,7) AND COUNT(A8<0,2) ANDCROSS(A8,MA(A8,2))) AND REF(DOWN,1)<REF(DOWN,2) AND UP>REF(DOWN,1); STICKLINE(买进,0,45,1.3,0),COLOR000088;STICKLINE(买进,0,45,0.9,0),COLOR0000AA;STICKLINE(买进,0,45,0.6,0),COLOR0000CC;STICKLINE(买进,0,45,0.2,0),COLOR0000FF;DRAWTEXT(买进,43,'长线持股'),COLORRED,LINETHICK1;{共振}RV:=(CLOSE-LLV(LOW,33))/(HHV(HIGH,33)-LLV(LOW,33))*100;RG:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;VAR44:=SMA(RV,3,1);VAR55:=SMA(VAR44,3,1);KK:=EMA(SMA(RG,3,1),2),COLORFFFFFF;JJ:=SMA(KK,3,1),COLOR00FFFF;共振点:=(CROSS(VAR44,VAR55) AND CROSS(KK,JJ));STICKLINE(共振点>0,0,35,1.3,0),COLOR008888;STICKLINE(共振点>0,0,35,0.9,0),COLOR00AAAA;STICKLINE(共振点>0,0,35,0.6,0),COLOR00DDDD;STICKLINE(共振点>0,0,35,0.2,0),COLOR00FFFF;DRAWTEXT(共振点>0,33,'共振'),COLOR00FF00;{涨}VAR1:=EMA(CLOSE,3);VAR2:=EMA(CLOSE,21);VAR3:=BARSLAST(CROSS(VAR2,VAR1))>15;VAR4:=VOL>MA(VOL,5)*2 AND VOL<MA(VOL,5)*5;VAR5:=CROSS(VAR1,VAR2) AND VAR4 AND VAR3;STICKLINE(VAR5,0,25,1.3,0),COLOR008800;STICKLINE(VAR5,0,25,0.9,0),COLOR00AA00;STICKLINE(VAR5,0,25,0.6,0),COLOR00CC00;STICKLINE(VAR5,0,25,0.2,0),COLOR00FF00;DRAWTEXT(VAR5,23,'★涨'),COLOR00FF00;{KDJ没有未来函}RSV:=(CLOSE-LLV(LOW,33))/(HHV(HIGH,33)-LLV(LOW,33))*100;K:SMA(RSV,3,1),COLOR00FFFF,LINETHICK2;D:SMA(K,3,1),COLORWHITE LINETHICK2;J:3*K-2*D,COLORRED,LINETHICK2;IF(J<REF(J,1),J,DRAWNULL),COLORGREEN,LINETHICK2;{KDJ相交红蓝球}DRAWICON(CROSS(J,D) AND CROSS(J,K),5,13);DRAWICON(CROSS(D,J) AND CROSS(K,J),95,14);{逃}DRAWTEXT(CROSS(80,RSI),95,'★逃'),COLORWHITE LINETHICK1;{顶}VAR22:=1;VAR23:=((((2*CLOSE)+HIGH)+LOW) / 4);VAR24:=LLV(LOW,5);VAR25:=HHV(HIGH,4);B1:=(EMA((((VAR23-VAR24)/(VAR25-VAR24))*100),4)*VAR22);B2:=(EMA(((0.667*REF(B1,1))+(0.333*B1)),2)*VAR22);TJ4:=CROSS(B2,B1) AND REF(B1,1)>80;DRAWTEXT(TJ4,102,'★顶'),COLOR00FFFF LINETHICK1;{今买明卖}MA111:=MA(CLOSE,20);MA112:=MA(CLOSE,40);MA113:=MA(CLOSE,60);A11:=OPEN<MA111 OR OPEN<MA112 OR OPEN<MA113,COLORRED;A12:=C>MAX(MA111,MAX(MA112,MA113)),COLORRED;A13:=V/MA(V,30)>1.2,COLORRED;A14:=C/REF(C,1)>1.049,COLORRED;今买明卖:IF(A11 AND A12 AND A13 AND A14,45,0),COLORWHITE LINETHICK2; DRAWTEXT(今买明卖>0.9,40,'今买明卖'),COLORWHITE LINETHICK1;{短买}你:=MA(CLOSE,1);老:=(LOW+HIGH+CLOSE)/3;老板:= MA(老,5);买卖:=LLV(老板,10);短买:IF(LLV((你<买卖),5),15,0),COLOR00FFFF LINETHICK2;{当大牛\中牛\短牛同一天出现时,果断买入}{含未来函数:DRAWLINE暴跌途中慎用!!} VAR20:=C-REF(C,1);VAR21:=100*EMA(EMA(VAR20,6),6)/EMA(EMA(ABS(VAR20),6),6);MA5:=EMA(C,5);MA13:=EMA(C,13);UP1:=DRAWLINE(L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS (MA13,MA5))+1),H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(CROS S(MA5,MA13))+1),0),COLOR0000FF;DOWN1:=DRAWLINE(H=HHV(H,BARSLAST(CROSS(MA5,MA13))+1),HHV(H,BARSLAST(C ROSS(MA5,MA13))+1),L=LLV(L,BARSLAST(CROSS(MA13,MA5))+1),LLV(L,BARSLAST(CROSS (MA13,MA5))+1),0),COLOR00FF00;BT:=(LLV(VAR21,2)=LLV(VAR21,7) AND COUNT(VAR21<0,2) ANDCROSS(VAR21,MA(VAR21,2))) ANDREF(DOWN1,1)<REF(DOWN1,2) AND UP1>REF(DOWN1,1);0,COLORFF00FF;DRAWTEXT(BT,30,'短牛'),COLOR00FFFF;TJ1:=REF(DOWN1,1)<REF(DOWN1,2) AND UP1>REF(DOWN1,1) AND C<HHV(H,21)*0.82;DRAWTEXT(TJ1,20,'中牛'),COLOR0000FF;HR:=HHV(HIGH,55);HRY:=LLV(LOW,55);HRY11:=HR*HRY;HRY33:=SQRT(HRY11);TJ2:=REF(DOWN1,1)<REF(DOWN1,2) AND UP1>REF(DOWN1,1) AND C<HRY33; DRAWTEXT(TJ2,10,'大牛'),COLORCYAN;。