N:=5;M1:=3;M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,LINETHICK2;
K:SMA(RSV,M1,1),COLORWHITE;
D:SMA(K,M2,1),COLORYELLOW;
J:3*K-2*D,COLORMAGENTA;
IF(J<0,J,DRAWNULL),COLORMAGENTA;
IF(K>90,K,DRAWNULL),COLORWHITE;
IF(D>85,D,DRAWNULL),COLORYELLOW;
0,COLORRED,LINETHICK2;20,COLORLIMAGENTA;{50,COLORWHITE;}
80,COLORBLUE;100,COLORGREEN,LINETHICK2;
DRAWTEXT(ISLASTBAR,0,'高安全区'),COLORRED;
DRAWTEXT(ISLASTBAR,20,'安 全 区'),COLORLIMAGENTA;
DRAWTEXT(ISLASTBAR,80,'风 险 区'),COLORBLUE;
DRAWTEXT(ISLASTBAR,100,'高风险区'),COLORGREEN;
DRAWICON(crOSS(J,0)AND K>=REF(K,1),J,1);
DRAWICON(CROSS(J,20)AND K>=REF(K,1),J,1);
DRAWICON(CROSS(100,J)AND K<=REF(K,1),J,2);
DRAWICON(CROSS(80,J)AND K<=REF(K,1)<100,J,2);
DRAWICON(CROSS(K,D),K,25);
DRAWICON(CROSS(D,K),D,27);