VAR111:=(HHV(HIGH,9)-CLOSE)/(HHV(HIGH,9)-LLV(LOW,9))*100;
VAR11:=1;
VAR21:=((((2*CLOSE)+HIGH)+LOW) / 4);
VAR4:=LLV(LOW,5);
VAR5:=HHV(HIGH,4);
C1:(EMA((((VAR21-VAR4)/(VAR5-VAR4))*100),4)*VAR11),COLORFF00FF;
C2:(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*VAR11),COLORFFFFFF;
DRAWTEXT(CROSS(C1,C2),REF(C2,1),'买'),COLORRED;
DRAWTEXT(CROSS(C2,C1),REF(C1,1),'卖'),COLORGREEN;
DRAWICON(CROSS(C1,C2) AND C2 0,MIN(C1,C2),1);
DRAWICON(CROSS(C1,C2) AND C2 0,MIN(C1,C2),1);
DRAWICON(CROSS(C2,C1) AND C2 -100,MAX(C1,C2)*1.2,2);
DRAWICON(CROSS(C2,C1) AND C2 -100,MAX(C1,C2)*1.2,2);
N:=9; P1:=3; P2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:SMA(RSV,P1,1);
D:SMA(K,P2,1);
J:3*K-2*D;
IF(J REF(J,1),J,DRAWNULL),COLORRED,LINETHICK3;
周K:= KDJ.K#WEEK (9,3,3);
周D:= KDJ.D#WEEK (9,3,3);
周J:= KDJ.J#WEEK (9,3,3);
月K:= KDJ.K#MONTH (9,3,3);
月D:= KDJ.D#MONTH (9,3,3);
月J:= KDJ.J#MONTH (9,3,3);
月金叉:=CROSS(月K,月D);
周金叉:=CROSS(周K,周D);
日金叉:=FILTER(CROSS(K,D) AND K 20,4);
DRAWTEXT(月金叉,月D-2,'★'),COLOR0022EE;
DRAWTEXT(月金叉,月D-2,'KD月金叉'),COLORYELLOW;
DRAWTEXT(周金叉,周D,'★'),COLOR0022EE;
DRAWTEXT(周金叉,周D, 'KD周金叉'),COLORGREEN;
DRAWICON(日金叉,K,1);
DRAWTEXT(日金叉,D-6,'低位金叉'),COLOR00CCCC;
DRAWTEXT(CROSS(周D,周K),周D*1.2,'KD周死叉'),COLOR00DDBB;
DRAWTEXT(CROSS(月D,月K),月D,'KD月死叉'),COLORFFFFFF;
KDB:=BARSLAST(REF(CROSS(K,D),1));
KDDB:=REF(CLOSE,KDB+1) CLOSE AND REF(K,KDB+1) K AND CROSS(K,D);
K底背:=IF(FILTER(KDDB 0,5),1,0);
DRAWTEXT(K底背=1,D*0.98,'底背离'),COLORDDDDDD;
KDD:=BARSLAST(REF(CROSS(D,K),1));
K顶背:=REF(CLOSE,KDD+1) CLOSE AND REF(K,KDD+1) K AND CROSS(D,K);
DRAWTEXT(FILTER(K顶背 0,5),D+8,'顶背离'),COLORFFAA22;
DRAWICON(CROSS(J,1),J,1);
DRAWICON(K 80 AND D 80 AND CROSS(D,K),D,2);
IF(J 0,J,DRAWNULL),COLORGREEN,LINETHICK2;
IF(J 90,J,DRAWNULL),COLORWHITE,LINETHICK2.5;
IF(K 90,K,DRAWNULL),COLOR0000FF,LINETHICK2;
IF(D 85,D,DRAWNULL),COLORFFFF11,LINETHICK2;
公式模块:
N:=9; P1:=3; P2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,P1,1);
D:=SMA(K,P2,1);
KDB:=BARSLAST(REF(CROSS(K,D),1));
KDDB:=REF(CLOSE,KDB+1) CLOSE AND REF(K,KDB+1) K AND CROSS(K,D);
K底背:IF(FILTER(KDDB 0,5),1,0);