N:=5;
M1:=3;
M2:=3;
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;
金叉:=crOSS(K,D);
死叉:=CROSS(D,K);
STICKLINE(金叉=1 AND D<30 AND K<30,0,20,1,0),COLORRED;
DRAWTEXT(金叉=1 AND D<30 AND K<30,0,' 金叉'),COLORRED;
STICKLINE(死叉=1 AND D>70 AND K>70,80,100,1,0),COLORGREEN;
DRAWTEXT(死叉=1 AND D>70 AND K>70,90,' 死叉'),COLORGREEN;