VAR2:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
VAR3:=SMA(SMA(VAR2,3,1),3,1)/30;
VAR4:=EMA(VAR3,5);
VAR5:=3*VAR3-2*VAR4;
AA:=crOSS(VAR5,VAR3) AND VAR3<2.1 AND C>O;
VAR6:=(2*CLOSE+HIGH+LOW)/4;
VAR7:=LLV(LOW,13);
VAR8:=HHV(HIGH,13);
VAR9:=EMA((VAR6-VAR7)/(VAR8-VAR7)*100,13);
VARA:=EMA(0.667*REF(VAR9,1)+0.333*VAR9,2);
STICKLINE(VAR9>VARA,VAR9,VARA,8/3,0), COLORMAGENTA;
STICKLINE(VAR9<=VARA,VAR9,VARA,8/3,0), COLORGREEN;
STICKLINE(AA,0,10,10/3,0),COLORBLUE;
LC := REF(CLOSE,1);
rsi1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(Abs(CLOSE-LC),3,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),5,1)/SMA(ABS(CLOSE-LC),5,1)*100;
RSI3:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(ABS(CLOSE-LC),8,1)*100;
相对强弱:=0.5*RSI1+0.31*RSI2+0.19*RSI3;
WAVE1:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),3,1);
WAVE2:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),5,1);
WAVE3:=SMA(100*(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8)),8,1);
短线波段:=0.5*WAVE1+0.31*WAVE2+0.19*WAVE3;
机会区:20,POINTDOT,COLORRED;
风险区:80,POINTDOT,COLORGREEN;
风险系数:0.5*相对强弱+0.5*短线波段,COLORYELLOW;
R:=1;
CD1:=IF(风险系数<20 AND CLOSE>OPEN,1,0);{//波段小于20,股价翻红;}
CD2:=IF(风险系数<20 AND LOW>=REF(LOW,1) AND CLOSE>LOW AND R>0,1,0);{//波段小于20,股价未翻红,但未创新低;}
CD3:=IF(REF(风险系数,1)<20 AND 风险系数>REF(风险系数,1),1,0);{//前一日波段小于20,今日转向;}
短趋势线:MA(CLOSE,13),COLORRED,LINETHICK2;
涨:IF(短趋势线>REF(短趋势线,1),短趋势线,DRAWNULL),COLORRED,LINETHICK2;
平:=IF(短趋势线=REF(短趋势线,1),短趋势线,DRAWNULL),COLOR00FFFF,LINETHICK2;
跌:IF(短趋势线<REF(短趋势线,1),短趋势线,DRAWNULL),COLOR80FF00,LINETHICK2;