這是我學(xué)習(xí)KDJ指標(biāo)的總結(jié),內(nèi)容來自網(wǎng)絡(luò),如果您有更好的使用心得,請(qǐng)跟帖回復(fù),我會(huì)將您的心得進(jìn)行整理,并加入到該帖子中! 3 KDJ公式集合
3.1黃金跟莊KDJ公式 常用的KDJ指標(biāo),是短線指標(biāo),信號(hào)多而雜。利用它很難把握莊家的真實(shí)意圖,不能完全踏住莊家的節(jié)拍,從而不是被套、就是被過早清出。下面獻(xiàn)給大家一件操盤實(shí)戰(zhàn)KDJ公式。 人棄我用的原則,才是操盤手制勝的法寶!內(nèi)含操盤手專用參數(shù)值,為什么要用21,回帖者中許多人不明白,股價(jià)有其內(nèi)在的規(guī)律,21天日牛市漲13天跌8天,熊市中漲8天跌13天。小小參數(shù)含天機(jī),用它實(shí)戰(zhàn)方知妙!本輪回調(diào)判頂?shù)?頂已證實(shí)底亦明!日線選股捉牛馬,十五K線做波段。 //<黃金跟莊KDJ>主圖 設(shè)為常用。 參數(shù)值: //N(最小值1,最大值100,缺省值21) M1(最小值1,最大值100,缺省值3) //M2(最小值1,最大值100,缺省值3) RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100; K:SMA(RSV,M1,1),colorwhite; D:SMA(K,M2,1),coloryellow; J:3*K-2*D,colorff00ff //說明:上班族無法時(shí)時(shí)盯盤,用本指標(biāo)擇股做長(zhǎng)線極佳。 3.2乘風(fēng)破浪2008-KDJ DRAWGBK(CLOSE=CLOSE,COLORRGB(30,30,60),COLORRGB(30,30,60),1); rsvC:=(CLOSE-LLV(LOW,89))/(HHV(HIGH,89)-LLV(LOW,89))*(C+H+L+O)/4; rsv89:=(CLOSE-LLV(LOW,89))/(HHV(HIGH,89)-LLV(LOW,89))*100; k89:=SMA(rsv89,5,1); k:SMA(rsvC,5,1),LINETHICK,COLORRED,PRECISION2; d:SMA(k,4,1),Colorfff000,LINETHICK,PRECISION2; J:=4*k-3*d; RSVZ:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*(C+O+H+L)/4; KZ:=SMA(RSVZ,4,1),COLORC080FF,LINETHICK,PRECISION2; DZ:=SMA(KZ,3,1),ColorFFFFFF,LINETHICK,PRECISION2; jz:4*kz-3*dz,ColorFFFFFF,LINETHICK,LINEDOT,PRECISION2; JS:EMA(JZ,5),Color00FF00,LINETHICK,LINEDOT,PRECISION2; KEM:ema(k,14),Color1477FF,LINETHICK,PRECISION2; RSVT:=(CLOSE-LLV(LOW,14))/(HHV(HIGH,14)-LLV(LOW,14))*(C+O+H+L)/4; KT:=SMA(RSVT,3,1),COLORC080FF,LINETHICK,PRECISION2; DT:=SMA(KT,3,1),ColorFFFFFF,LINETHICK,PRECISION2; jT:=4*kT-3*dT; macd:=(jz-kz)*0.8; macd2:=(jT-kT)*0.5; MACD1:=(J-K)*1.2,COLOR8855FF,LINETHICK0; FILLRGN(K>EMA(K,14),K,EMA(K,14)),Color441F7D; FILLRGN(K<=EMA(K,14),K,EMA(K,14)),COLORGRAY; STICKLINE(MACD1>REF(MACD1,1) AND MACD1>0,0,MACD1+0,8.3,1),COLORRED; STICKLINE(MACD1<=REF(MACD1,1) AND MACD1>0,0,MACD1+0,8.3,1),COLOrfff000; STICKLINE(MACD1>REF(MACD1,1) AND MACD1<0,0,MACD1+0,8.3,1),COLOR555fff; STICKLINE(MACD1<=REF(MACD1,1) AND MACD1<0,0,MACD1+0,8.3,1),Color408080; STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD+0,5.5,0),COLORaa00bb; STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD+0,4,0),COLORcc22bb; STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD+0,2,0),COLORdd33BB; STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD+0,1,0),COLORff55bb; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD+0,5.5,0),COLOR666666; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD+0,4,0),COLOR777777; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD+0,2,0),COLOR888888; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD+0,1,0),COLOR999999; STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD+0,5.5,0),COLOR3377AA; STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD+0,4,0),COLOR3388BB; STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD+0,2,0),COLOR4499CC; STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD+0,1,0),COLOR5599DD; STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD+0,5.5,0),COLORFF3300; STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD+0,4,0),COLORFF4400; STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,2,0),COLORFF5500; STICKLINE(MACD<=REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORFF6600; STICKLINE(MACD2>REF(MACD2,1) AND MACD2>0,0,MACD2+0,1.5,0),COLOR00FFFF; STICKLINE(MACD2<=REF(MACD2,1) AND MACD2>0,0,MACD2+0,1.5,0),COLOrffF000; STICKLINE(MACD2>REF(MACD2,1) AND MACD2<0,0,MACD2+0,1.5,0),COLORFFFFFF; STICKLINE(MACD2<=REF(MACD2,1) AND MACD2<0,0,MACD2+0,1.5,0),COLOR00FF00; STICKLINE(K>D,K,D,4,0),COLORFF0070; STICKLINE(K>D,K,D,2,0),COLORFF1180; STICKLINE(K>D,K,D,1,0),COLORFF2290; STICKLINE(K<D,K,D,4,0),COLORFF4400; STICKLINE(K<D,K,D,2,0),COLORFF6600; STICKLINE(K<D,K,D,1,0),COLORFF8800; STICKLINE(K<D AND K89>50,K,D,4,0),COLORBBBB00; STICKLINE(K<D AND K89>50,K,D,2,0),COLORDDDD00; STICKLINE(K<D AND K89>50,K,D,1,0),COLORFFFF00; STICKLINE(K>D AND K89<20,K,D,4,0),COLOR1155AA; STICKLINE(K>D AND K89<20,K,D,2,0),COLOR2277BB; STICKLINE(K>D AND K89<20,K,D,1,0),COLOR3399CC; STICKLINE(K>D AND K89>50,K,D,4,0),COLOR0000AA; STICKLINE(K>D AND K89>50,K,D,2,0),COLOR0000DD; STICKLINE(K>D AND K89>50,K,D,1,0),COLOR0000FF; STICKLINE(K>D AND K89>79,K,D,4,0),COLOR00DDEE; STICKLINE(K>D AND K89>79,K,D,2,0),COLOR00EEEE; STICKLINE(K>D AND K89>79,K,D,1,0),COLOR00FFFF; STICKLINE(K>D AND K89>89,K,D,4,0),COLORAAAAAA; STICKLINE(K>D AND K89>89,K,D,2,0),COLORBBBBBB; STICKLINE(K>D AND K89>89,K,D,1,0),COLORDDDDDD; STICKLINE(K>D AND K89>94,K,D,4,0),COLOR005500; STICKLINE(K>D AND K89>94,K,D,2,0),COLOR007700; STICKLINE(K>D AND K89>94,K,D,1,0),COLOR009900; KEM,Color1477FF,LINETHICK1,PRECISION2; PARTLINE(KEM<REF(KEM,1),KEM),Color008000,LINETHICK1; PARTLINE(c,K),ColorRED,LINETHICK1,LINEDOT; PARTLINE(c,d),Colorfff000,LINETHICK1,LINEDOT; JZ,ColorFFFFFF,LINETHICK1; JS,Color00FF00,LINETHICK1; 3.3飛狐版的通達(dá)信KDJ公式 RSV:=(CLOSE-LLV(LOW,14))/(HHV(HIGH,14)-LLV(LOW,14))*100; K:SMA(RSV,3,1); D:SMA(K,3,1); J:=3*K-2*D; P1:100; P2:50; P3:0; STICKLINE(J>REF(J,1),HHV(J,3),LLV(J,3),3,0),COLOR0022FF; STICKLINE(J>REF(J,1),J,REF(J,1),3,0),COLOR0022FF; STICKLINE(J>REF(J,1),J,REF(J,1),2,0),COLOR0099FF; STICKLINE(J>REF(J,1),J,REF(J,1),1.5,0),COLOR00DDFF; STICKLINE(J>REF(J,1),J,REF(J,1),0.5,0),COLOR00DDFF; STICKLINE(J<REF(J,1),HHV(J,3),LLV(J,3),1,0),COLORFF2200; STICKLINE(J<REF(J,1),J,REF(J,1),3,0),COLORFF6600; STICKLINE(J<REF(J,1),J,REF(J,1),2,0),COLORFF9900; STICKLINE(J<REF(J,1),J,REF(J,1),1.5,0),COLORFFDD00; STICKLINE(J<REF(J,1),J,REF(J,1),0.5,0),COLORFFDD00 3.4中短波段--KDJ {-----------------------☆功能開關(guān)------------------------} {準(zhǔn)} A1:=(C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*300-150; A2:=SMA(SMA(A1,13,1),13,1); 多:100*(C-MA(C,21))/STD(C,21),LINETHICK,PRECISION2,COLORWHITE; A3:= EMA(多,13); A4:=REVERSE(A3)+2*WMA(WMA(A3,1),5); 空:3*A4-2*SMA(A4,2,1),LINETHICK,PRECISION2,COLORGREEN; {中} Z1:=(O*2+H+L+C*3)/7; Z2:=EMA(100*(Z1-LLV(Z1,30))/(HHV(Z1,30)-LLV(Z1,30)),9)*5-250; 中:EMA(Z2,1),LINETHICK1,PRECISION2,Color00A8FF; Z3:=EMA(wma(EMA(Z2,3),8),2); Z4:=FORCAST(Z3,13); {-----------------【圖解模板】---------------------} DRAWGBK((DATE > 0),COLORRGB(40,40,60),COLORRGB(10,10,10),1); {坐標(biāo)} PARTLINE(C,200),LINEDOT,COLORGRAY; PARTLINE(C,0),LINEDOT,COLORGRAY; PARTLINE(C,-200),LINEDOT,COLORGRAY; {準(zhǔn)} FILLRGN(多<=空,多,空),Color006C00; FILLRGN(多>=空,多,空),COLORBROWN; {中} STICKLINE(Z4>ref(Z4,1),Z4,ref(Z4,1),7,0),ColorFF9CFF; STICKLINE(Z4<ref(Z4,1),Z4,ref(Z4,1),7,0),COLORWHITE; {各線} PARTLINE(1,中),LINETHICK2,Color00A8FF; PARTLINE(C,多),COLORWHITE; PARTLINE(C,空),COLORGREEN; 3.5飛狐KDJ RSV:=(CLOSE-LLV(LOW,14))/(HHV(HIGH,14)-LLV(LOW,14))*100; K:SMA(RSV,3,1); D:SMA(K,3,1); J:=3*K-2*D; P1:100; P2:50; P3:0; STICKLINE(J>REF(J,1),HHV(J,3),LLV(J,3),3,0),COLOR0022FF; STICKLINE(J>REF(J,1),J,REF(J,1),3,0),COLOR0022FF; STICKLINE(J>REF(J,1),J,REF(J,1),2,0),COLOR0099FF; STICKLINE(J>REF(J,1),J,REF(J,1),1.5,0),COLOR00DDFF; STICKLINE(J>REF(J,1),J,REF(J,1),0.5,0),COLOR00DDFF; STICKLINE(J<REF(J,1),HHV(J,3),LLV(J,3),1,0),COLORFF2200; STICKLINE(J<REF(J,1),J,REF(J,1),3,0),COLORFF6600; STICKLINE(J<REF(J,1),J,REF(J,1),2,0),COLORFF9900; STICKLINE(J<REF(J,1),J,REF(J,1),1.5,0),COLORFFDD00; STICKLINE(J<REF(J,1),J,REF(J,1),0.5,0),COLORFFDD00 3.6 KDJ 火焰山, 這個(gè)不錯(cuò)! //p1 2 20 5 p2 2 20 4 P1:=5; P2:=4; 80, POINTDOT, ColorGreen, LineThick3; 20, POINTDOT, ColorRed, LineThick3; VAR1:=LLV(LOW,P1); VAR2:=HHV(HIGH,P1); K: EMA((CLOSE-VAR1)/(VAR2-VAR1)*100,P2),COLORWhite ; D: EMA(0.667*REF(K,1)+0.333*K,2), ColorYellow; VARC:=SMA(ABS(L-REF(L,1)),3,1)/SMA(MAX(L-REF(L,1),0),3,1); VARD:=EMA(IF(C< EMA(C,250),VARC*1000,VARC*10),3); 火焰山:EMA(IF(L<=LLV(L,30),VARD/2+HHV(VARD,30),0),3)/618, ColorRed; STICKLINE(火焰山>100,0,火焰山*1.2,8,0); STICKLINE(火焰山>100,0,火焰山,4,1); 3.7老楊二號(hào) Var1:=EMA(C,5); Var2:=SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,9,1); Var3:=SMA(Var2,3,1); Var4:=3*Var2-2*Var3; Var5:=(C-LLV(L,23))/(HHV(H,23)-LLV(L,23))*100; 動(dòng)態(tài)能量:EMA(WINNER((O+C*2+H+L)/5)*50,10),COLOR9FBC7D; STICKLINE(動(dòng)態(tài)能量>0 ,動(dòng)態(tài)能量,0,10,0),COLOR9FBC7D; 短趨勢(shì):EMA(SMA(MAX(C-REF(C,1),0),3,1)/SMA(ABS(C-REF(C,1)),3,1)*100,5),COLORF00FF0,linethick2; 中趨勢(shì):=3*SMA((C-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1)-2*SMA(SMA((C-LLV(L,75))/(HHV(H,75)-LLV(L,75))*100,20,1),15,1); 升勢(shì):SMA(SMA(Var5,3,1),3,1),COLORRED; 降勢(shì):EMA(升勢(shì),5),COLOR00FF00; Var6:=短趨勢(shì)>REF(短趨勢(shì),1)AND 升勢(shì)<45; Var7:=(CROSS(Var5,中趨勢(shì))OR CROSS(升勢(shì),降勢(shì)))AND 中趨勢(shì)>=REF(中趨勢(shì),1) AND 中趨勢(shì)<40; Var8:=升勢(shì)>REF(升勢(shì),1)AND 升勢(shì)<40; Var9:=CROSS(短趨勢(shì),升勢(shì))AND 短趨勢(shì)<45 AND 升勢(shì)>REF(升勢(shì),1)*0.99; Var10:=CROSS(升勢(shì),降勢(shì))AND 動(dòng)態(tài)能量<7 AND 短趨勢(shì)<45; 動(dòng)態(tài)底部:EMA(IF(L<= LLV(L,30),SMA(ABS(L-REF(L,1)),30,1)/SMA(MAX(L-REF(l,1),0),30,1),0),3)*10,STICK,COLORFFB94F,LINETHICK3; 選股要選活躍股:DRAWICON(FILTER((Var6 OR Var7 OR Var8)AND 短趨勢(shì)<45 AND Var4>REF(Var4,1)AND Var1>REF(Var1,1)*0.998 OR Var9 OR Var10,5),15,1); 趨勢(shì)不明要慎行:STICKLINE(FILTER(升勢(shì)<REF(升勢(shì),2)AND 升勢(shì)>70 OR 短趨勢(shì)<REF(短趨勢(shì),1)and 短趨勢(shì)>60 AND 動(dòng)態(tài)能量>7,7),95,85,10,1),COLOR00FF00; STICKLINE(升勢(shì)>0,升勢(shì),降勢(shì),8,0),COLORred; STICKLINE(升勢(shì)<REF(升勢(shì),1),升勢(shì),降勢(shì),8,0),COLOR00ff00; 3.8 界文KDJ N1:=7;N2:=27; STICKLINE(C>0,40,60,10,0),COLOR999999; RSV:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100; 短K:SMA(RSV,3,1),COLORF580F5,LINETHICK0; 短D:SMA(短K,3,1),COLORCCDD33,LINETHICK0; RSV1:=(CLOSE-LLV(LOW,N2))/(HHV(HIGH,N2)-LLV(LOW,N2))*100; 中K:SMA(RSV1,5,1),COLORRED,LINETHICK0; 中D:SMA(中K,10,1),COLOR33AA33,LINETHICK0; 底線:10,COLORWHITE; 頂線:90,COLOR00FFFF; STICKLINE(短K>短D,短K,短D,7,1), COLORFF00FF; //粉紫色 STICKLINE(短K<=短D,短K,短D,7,1),ColorCyan; //青色:colorcyan STICKLINE(中K>中D,中K,中D,3,0), ColorRed; //紅色 STICKLINE(中K<=中D,中K,中D,3,0),ColorGreen; //綠色 3.9 無未來數(shù)據(jù)的周 KDJ 指標(biāo)-南客編寫 引用另一個(gè)公式結(jié)果的代碼,騎兵版主已經(jīng)在樓上的鏈接給出了。 這里再給一個(gè)不引用其它公式的代碼,請(qǐng)參考: 復(fù)制內(nèi)容到剪貼板 input:n(9,1,100),m1(3,2,40),m2(3,2,40); wtj1:=datediff(ref(date,1),date)<>weekday-ref(weekday,1) or barpos=1; wtj:=refx(wtj1,1); //周末標(biāo)記 hn:=sumbars(wtj,n+1); n0:=lbound(hn); a:=setlbound(hn,1); nn:=if(barpos<n0,barpos,hn-1); RSV:=(CLOSE-LLV(LOW,nN))/(HHV(HIGH,nN)-LLV(LOW,nN))*100; start:=barpos-barssince(wtj); wk:=rsv[start[datacount]]; k[start[datacount]]:wk; wd:=k[start[datacount]]; d[start[datacount]]:wd; for i=start[datacount]+1 to datacount do begin if wtj then begin wk:=(rsv+(m1-1)*wk)/m1; wd:=(wk+(m2-1)*wd)/m2; k:=wk; d:=wd; end else begin k:=(rsv+(m1-1)*wk)/m1; d:=(k+(m2-1)*wd)/m2; end; end; j:3*k-2*d; {//驗(yàn)證代碼: drawicon(wtj,0,10); zk:"kdj.k#week"; tt:count((round(zk*1000)-round(k*1000))*wtj,0); }{頂尖財(cái)經(jīng)網(wǎng)www.整理} |
|