N:=26;
X1:=EMA(HHV(H,500),21);
X2:=EMA(HHV(H,250),21);
X3:=EMA(HHV(H,90),21);
X4:=EMA(LLV(L,500),21);
X5:=EMA(LLV(L,250),21);
X6:=EMA(LLV(L,90),21);
X7:=EMA((X1*0.558+X2*0.558+X3*0.558+X4*0.96+X5*0.96+X6*0.96)/6,21);
X8:=EMA((X1*0.55 +X2*0.55+ X3*0.65+ X4*1.25+X5*1.23+X6*1.2 )/6,21);
X9:=EMA((X1*0.68+ X2*0.68+ X3*0.68+ X4*1.3 +X5*1.3+ X6*1.3 )/6,21);
VARA:=EMA((X7*3+X8*2+X9)/6*1.738,21);
VARB:=REF(LOW,1);
VARC:=SMA(Abs(LOW-VARB),3,1)/SMA(MAX(LOW-VARB,0),3,1)*100;
VARD:=EMA(IF(C*1.35<=VARA,VARC*10,VARC/10),3);
VARE:=LLV(L,30);
VARF:=HHV(VARD,30);
VAR10:=IF(MA(C,58),1,0);
VAR11:=EMA(IF(LOW<=VARE,(VARD+VARF*2)/2,0),3)/618*VAR10;
MID:=REF(H+L,1)/2;
cr:=SUM(MAX(0,H-MID),N)/SUM(MAX(0,MID-L),N)*100;
出击:=IF(CR<60 AND VAR11>10,35,0),COLORGREEN;
攻击:=IF (VAR11>20,30,0),COLORYELLOW;
XC1:=(MA(C,80)-MA(C,13)/3);
XC2:= MA((C-XC1)/XC1,1);
XC3:=EMA(XC2,12)*0.7;
XC4:=EMA(XC2,3);
XC5:=IF(LLV(XC4-XC3,12)>0,0,-10);
XC6:=EMA(C,12)-EMA(C,26);
XC7:=EMA(XC6,9);
XC8:=2*(XC6-XC7);
加仓:=IF(XC5<0 AND CROSS(XC8,0),50,0),LINETHICK1,COLORBLUE;
出击加仓:(出击=35 OR 攻击=30 OR 加仓=50);