VAR2:=LLV(LOW,33);
VAR3:=HHV(HIGH,21);
VAR4:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*100,10)*-1+100;
安全线:100-EMA(0.191*REF(VAR4,1)+0.809*VAR4,1),COLORGREEN,LINETHICK8;
B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
分水岭:=IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORFF00FF,LINETHICK8;
操作线:=分水岭-(EMA(C,3)-分水岭),COLOR00FFFF,LINETHICK8;
PM:=MA(C,5),COLORWHITE,LINETHICK2;
S:=(PM> 操作线);
DD:=分水岭<REF(分水岭,1);
IF(S,安全线,DRAWNULL),COLORRED,LINETHICK8;
IF(PM>=REF(PM,1),安全线,DRAWNULL),COLORYELLOW,POINTDOT,LINETHICK8;
IF(PM<REF(PM,1),安全线,DRAWNULL),COLORBLUE,POINTDOT,LINETHICK8;
DRAWTEXT(安全线>76 AND ISLASTBAR,75,'*请注意风险*'),COLORGREEN;
DRAWTEXT(安全线<20 AND ISLASTBAR,75,'*近底安全*'),COLORGREEN;
DRAWTEXT(安全线>20 AND 安全线<75 AND ISLASTBAR,75,'*中等风险*'),COLORGREEN;
V1:=1;
V2:=((((2*CLOSE)+HIGH)+LOW) / 4);
V4:=LLV(LOW,5);
V5:=HHV(HIGH,4);
C1:=(EMA((((V2-V4)/(V5-V4))*100),4)*V1),COLORFF00FF,LINETHICK2;
C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*V1),COLORFFFFFF,LINETHICK2;
买:IF(CROSS(C1,C2) AND C1<40,25,15),COLORRED,LINETHICK2;
TJ1:=CROSS(C1,C2);
TJ2:=CROSS(C2,C1);
TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;
卖:IF(CROSS(C2,C1) AND REF(C1,1)>80,80,85),COLORGREEN,LINETHICK2;
DRAWTEXT(CROSS(C1,75),90,'警'),COLORRED;