优化KDJ
2016-6-13 19:03:45点击:
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,M1,1);
D:SMA(K,M2,1);
J:3*K-2*D;
跟进:IF(CROSS(K,D) OR CROSS(REF(K,1),REF(D,1)) OR CROSS(REF(K,2),REF(D,2)),10,0),COLORYELLOW;
DRAWBAND(D,RGB(0,128,50),K,RGB(255,97,50));
顶:=HHV(J,21),COLORRED,LINETHICK1;
底:=LLV(J,21),COLORGREEN ;
转下:IF(REF(顶,1)=REF(J,1) AND 顶>J,顶,DRAWNULL),COLORGREEN,POINTDOT,LINETHICK6;
转上:IF(REF(底,1)=REF(J,1) AND 底<J,底,DRAWNULL),COLORRED ,POINTDOT,LINETHICK6;
加仓:IF(J>D,J,DRAWNULL),COLORRED,LINETHICK1;
减仓:IF(J<D,J,DRAWNULL),COLORGREEN,LINETHICK1;
STICKLINE(J<=0,0,5,5,0),COLORYELLOW;
VAR1:=1;
VAR2:=1/WINNER(CLOSE);
VAR3:=MA(CLOSE,13);
VAR4:=100-ABS((CLOSE-VAR3)/VAR3*100);
庄:=IF(VAR2>5,IF(VAR2<100,VAR2,VAR4-10),0);
STICKLINE(庄,0,2,1,0),COLORRED;
金叉:IF(SUM(CROSS(K,D)AND D<23,15)>=2 AND CROSS(K,D)AND C>O,10,0),COLORFFFF00;
{DRAWBAND(K,RGB(155,50,50),D,RGB(0,100,50));}
STICKLINE((J>100 AND K>=60),100,J,1,1),COLORYELLOW;
STICKLINE(K>92,100,K,1,1),COLORGREEN;
STICKLINE((J<=0 AND K<=30),0,J,1,1),COLORYELLOW;
STICKLINE(K<=9,0,K,1,1),COLORRED;
A1:=BARSLAST(REF(CROSS(J,K),1));
底背:=REF(CLOSE,A1+1)>CLOSE AND J>REF(J,A1+1) AND CROSS(J,K);
DRAWLINE(A1=0,D,底背,D,0),COLORRED,POINTDOT;
DRAWTEXT(底背,D,'底B'),COLORRED;
A2:=BARSLAST(REF(CROSS(K,J),1));
顶背:=REF(CLOSE,A2+1)<CLOSE AND REF(J,A2+1)>J AND CROSS(K,J);
DRAWLINE(A2=0,D,顶背,D,0),COLORBLUE,POINTDOT;
DRAWTEXT(顶背,D,'顶B'),COLORBLUE;
压力线:DRAWLINE(D>=HHV(D,21),D,D<=LLV(D,21),D,1),COLORBLUE;
DRAWTEXT(CURRBARSCOUNT=60,60,'弱势建仓莫着急'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=55,45,'看到红了找背离'),COLORRED;
DRAWTEXT(CURRBARSCOUNT=50,30,'强势变黄不要卖'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=45,15,'黄走绿来才走开'),COLORBLUE;
DRAWICON(CROSS(J,1),5,1);
DRAWICON(K>80 AND D>80 AND CROSS(D,K),95,2);
{ WWW.88GS.COM}
Y2:=(((CLOSE/COST(10))<=0.85)*10);
{短期:=((CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100)<6;
中期:=((CLOSE-LLV(LOW,10))/(HHV(HIGH,10)-LLV(LOW,10))*100)<6;
中长期:=((CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100)<6;
长期:=((CLOSE-LLV(LOW,30))/(HHV(HIGH,30)-LLV(LOW,30))*100)<6;
四剑归零:DRAWTEXT(短期=0 AND 中期=0 AND 长期=0,(20),'0'),COLORFFFF00;}
XG:=Y2{ AND 短期 AND 中期 AND 中长期 AND 长期;};
STICKLINE(XG,100,95,1,1),COLORRED;