N:=27;
M0:=5;
M1:=3;
M2:=2;
top=100;
DOWN=0;
HV=HHV(HIGH,N);
LV=LLV(LOW,N);
RSV=SMA((CLOSE-LV)/(HV-LV)*100,M0,1);
K=SMA(RSV,M1,1);
D=SMA(K,M2,1);
J: RSV*5-K*3-D,LINETHICK1,colorred;
JM: EMA(MA(J,M0),M1),LINETHICK1,colorcyan;
STICKLINE(J>=JM,J,JM,1,0),COLOR7F52AF;
STICKLINE(J
STICKLINE(JM>TOP AND J
V1:= MA(CLOSE,5)=HHV(MA(CLOSE,5),20);
V2:= MA(CLOSE,5)>MA(CLOSE,20);
V3:= COUNT(MA(CLOSE,1)>REF(CLOSE,1),3)=3;
风险1级: IF(V1 AND V2 AND V3,18,0),colorgreen;
V11:= MA(CLOSE,5)=HHV(MA(CLOSE,5),120);
V21:= MA(CLOSE,5)>MA(CLOSE,120);
V31:= COUNT(MA(CLOSE,1)>REF(CLOSE,1),3)=3;
风险2级: IF(V11 AND V21 AND V31,20,0),colorcyan;
底部: DOWN,colorgreen;
STICKLINE(crOSS(J,底部),0,-18,2,0),COLOR00FF00;
DRAWTEXT(CROSS(J,底部),-8,'底'),COLOR0000FF;
顶部: TOP,coloryellow;
STICKLINE(CROSS(顶部,J),TOP+18,TOP,3,0),COLORFF9D00;
DRAWTEXT(CROSS(顶部,J),TOP+28,'顶'),COLORFF9D00;