日KDJ和周KDJ在同個圖的公式
2007-09-04 19:01
-------------------------------------------------------------------------------------------------
精確KDJ
N1:=9;N:=3;
VAR1:=REF(CLOSE,1); VAR2:=(CLOSE-LLV(LOW,N1))/(HHV(HIGH,N1)-LLV(LOW,N1))*100; VAR3:=SMA(VAR2,3,1); VAR4:=SMA(VAR3,3,1); VAR5:=SMA(VAR4,3,1); K: VAR3,COLORMAGENTA; D: VAR4, COLORRED; J: VAR5 ,COLORYELLOW; VAR6:=CROSS(VAR3,VAR4) AND VAR4<25; 高壓線: 85; 觸底線: 20; 強勢線:52.5,COLORRED; VARA:=CROSS(VAR5,VAR4) AND REF(VAR4,1)>80; VAR1A:=(CLOSE-LLV(LOW,15))/(HHV(HIGH,15)-LLV(LOW,15))*100; VAR1B:=SMA((SMA(VAR1A,4,1)-50)*2,3,1); VAR1C:=(INDEXC-LLV(INDEXL,14))/(HHV(INDEXH,14)-LLV(INDEXL,14))*100; VAR1D:=SMA(VAR1C,4,1); VAR1E:=SMA(VAR1D,3,1); VAR1F:=(HHV(HIGH,30)-CLOSE)/CLOSE*100; VARE:=REF(LOW,1)*0.9; VARF:=LOW*0.9; VAR10:=(VARF*VOL+VARE*(CAPITAL-VOL))/CAPITAL; VAR11:=EMA(VAR10,30); VAR12:=CLOSE-REF(CLOSE,1); VAR13:=MAX(VAR12,0); VAR14:=ABS(VAR12); VAR15:=SMA(VAR13,7,1)/SMA(VAR14,7,1)*100; VAR16:=SMA(VAR13,13,1)/SMA(VAR14,13,1)*100; VAR17:=BARSCOUNT(CLOSE); VAR18:=SMA(MAX(VAR12,0),6,1)/SMA(ABS(VAR12),6,1)*100; VAR19:=(-200)*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60))+100; VAR20:=VAR18<=25 AND VAR19<-95 AND VAR1F>20 AND VAR1B<-30 AND VAR1E<30 AND VAR11-CLOSE>=-0.25 AND VAR15<22 AND VAR16<28 AND VAR17>50;
-------------------------------------------------------------------------------
龍虎霸附圖源碼:
龍為吉祥物,虎出必傷人。 信號指標,一目了然。 【選準股票,認定指標,信號出現(xiàn),堅決執(zhí)行,波段操作,必有收益】 STICKLINE(C>0,0,120,15,0),COLORBLUE; RSV:=(CLOSE-LLV(LOW,4))/(HHV(HIGH,4)-LLV(LOW,4))*100; FASTK:=SMA(RSV,3,1); 龍:SMA(FASTK,2,1); 龍D:=SMA(龍,5,1); DRAWBAND(龍D,RGB(0,104,154),龍,RGB(255,0,0)); STICKLINE(龍>=龍D,龍D,龍,3,0),COLOR000085; STICKLINE(龍<龍D,龍D,龍,3,0),COLOR324800; DRAWTEXT(CROSS(龍D,龍) AND 龍>70,50,'賣'),COLORGREEN; L1:=(CLOSE-LLV(LOW,11))/(HHV(HIGH,11)-LLV(LOW,11))*200-60; 鳳:SMA(L1,3,1),COLORYELLOW; 鳳D:=SMA(鳳,3,1),COLORRED; DRAWBAND(鳳D,RGB(0,128,0),鳳,RGB(255,97,0)); DRAWTEXT(CROSS(鳳D,鳳)AND 鳳>78,鳳,'←快賣'); DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26); DEA:=EMA(DIFF,9); MACD:=1000* (2*(DIFF-DEA))/EMA(C,30); VARA:=EMA(REF(CLOSE,1),4); VAR1:=(SMA(MAX(CLOSE-VARA,0),6,1)/SMA(ABS(CLOSE-VARA),6,1)*100); VAR2:=FILTER(MACD<0 AND MACD>REF(MACD,1) AND VAR1<20,5); VAR3:=CROSS(VAR1,90); 準備:IF(VAR1<3.5,15,0),COLORCYAN,LINETHICK2; DRAWTEXT(VAR1<3.5,7,'準備'),COLORCYAN; 錢進:IF(VAR2,20,0),COLORMAGENTA,LINETHICK3; DRAWTEXT(VAR2,10,'“錢”進'),COLORRED; DRAWTEXT(VAR3,70,'鳳舞ラ小心'),COLORCYAN; VAR4:=LLV(LOW,10); VAR5:=HHV(H,25); VAR6:=EMA((C-VAR4)/(VAR5-VAR4)*4,4); DRAWTEXT(CROSS(3.5,VAR6),110,'急賣'); 恭喜:STICKLINE(CROSS(VAR6,0.3),-50,-30,3,0), COLOR00AAFF,LINETHICK1; STICKLINE(CROSS(VAR6,0.3),-40,-30,3,0),COLORRED,LINETHICK1; DRAWTEXT(CROSS(VAR6,0.3),-45,'恭喜'),COLORMAGENTA; 發(fā)財:STICKLINE(CROSS(3.5,VAR6),100,120,2,0), COLORRED,LINETHICK2; STICKLINE(CROSS(3.5,VAR6),110,120,2,0),COLORYELLOW,LINETHICK2; DRAWTEXT(CROSS(3.5,VAR6),90,'發(fā)財'),COLORYELLOW; 龍行鳳影:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1) -2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27) -LLV(LOW,27))*100,5,1),3,1); 龍飛:IF(龍行鳳影<=10,-20,-40),COLOR0000FF,LINETHICK2; DRAWTEXT(龍行鳳影<=10,-25,'龍飛'),COLORYELLOW; DRAWTEXT(CROSS( 0,MACD)AND VAR1>75,110,'☆高空'),COLORFFFFFF; 紅紅的天:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1) -2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27) -LLV(LOW,27))*100,5,1),3,1); 花開:IF(CROSS(紅紅的天,2),70,-50),COLORLIMAGENTA,LINETHICK2; DRAWTEXT(CROSS(紅紅的天,2),75,'花開了'),COLORMAGENTA; IF(CROSS(紅紅的天,2),70,DRAWNULL),CROSSDOT,LINETHICK6,COLORFF77FF; IF(CROSS(紅紅的天,2),70,DRAWNULL),POINTDOT,LINETHICK4,COLOR00CCFF; RSV1:=(((CLOSE - LLV(LOW,29)) / (HHV(HIGH,29) - LLV(LOW,29))) * 100); K1:=MA(RSV1,5); D1:=MA(K1,2); J1:=((3 * K1) - (2 * D1)); 明天漲:IF((J1 < 5),25,0),COLORRED,LINETHICK2; DRAWTEXT((J1 < 5),30,'明天漲'),COLORYELLOW; R:=RSI; MAR:=MA(R,3); F:=100*(C-REF(C,1))/REF(C,1); HHH:=EMA(R,25)+6,COLORBLUE; GAODIAN:=REF(R,1)>REF(R,2) AND REF(R,1)>R; DIDIAN:=(REF(R,1)<REF(R,2) AND REF(R,1)<R) OR (REF(R,1)=REF(R,2) AND REF(R,1)<R AND REF(R,2)<REF(R,3)); BIAOJI:=CROSS(HHH,R); JIN:STICKLINE(REF(R,2)>REF(R,3) AND REF(R,2)>REF(R,1) AND R>REF(R,1) AND MAR>REF(MAR,1)+1 AND REF(MAR,2)-REF(MAR,1)>-1 AND REF(R,1)<REF(MAR,1) AND REF(R,2)-REF(MAR,2)>-3 AND REF(R,1)<38 AND R<HHH AND F<8,100,120,2,0),COLORRED; DRAWTEXT(JIN,110,'RSI買'),COLORYELLOW; VAR7:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1); VAR8:=EMA(VAR7,5), LINETHICK2,COLOR6600FF; VAR9:=100*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60)),LINETHICK2; STICKLINE(CROSS(VAR8,VAR9),0,20,2,0); DRAWTEXT(CROSS(VAR8,VAR9),20,'追漲'); VOLUME:=VOL/10000,VOLSTICK; MAVOL1:=MA(VOLUME,5)/10000; MAVOL2:=MA(VOLUME,35)/10000; MAVOL3:=MA(VOLUME,135)/10000; 地量:IF(CROSS(0.9,1/VOL*1000>0.01 AND "KDJ.J"<0),-25,-50),COLORMAGENTA,LINETHICK3; DRAWTEXT(CROSS(0.9,1/VOL*1000>0.01 AND "KDJ.J"<0),-29,' 地量'),COLORRED; DRAWTEXT(LAST(MA(C,5)<MA(C,10),5,0) AND "CCI.CCI">REF("CCI.CCI",1) AND CROSS("CCI.CCI",-100),-45,'CCI買點'),COLORYELLOW; A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1); LC:=REF(CLOSE,1); RSI2:=((SMA(MAX((CLOSE-LC),0),3,1)/SMA(ABS((CLOSE-LC)),3,1))*100); FF:=EMA(CLOSE,3); MA15:=EMA(CLOSE,21); 出局:IF(CROSS(88,RSI2),100,120),COLORLIGREEN,LINETHICK3; DRAWTEXT(CROSS(88,RSI2),100,'虎'),COLORGREEN; RSV3:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100; K:=SMA(RSV3,3,1); D:=SMA(K,3,1); J:=3*K-2*D; X:=LLV(J,2)=LLV(J,8); 進場:IF(CROSS(J,REF(J+0.01,1)) AND X AND J<20,0,-20),COLORYELLOW,LINETHICK2; DRAWTEXT(CROSS(J,REF(J+0.01,1)) AND X AND J<20,-10,'龍'),COLORYELLOW; WZ:=100=CURRBARSCOUNT; DRAWTEXT(WZ=1,-30,'【選準股票,認定指標,信號出現(xiàn),堅決執(zhí)行,波段操作,必有收益】'),COLORYELLOW; |
|