N1:=1.8;
N2:=1.8;
X_1:=MAX(MAX(HIGH-LOW,Abs(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
X_2:=CLOSE/REF(CLOSE,1)<=0.929 AND REF(CLOSE,1)>=REF(MA(CLOSE,22),1);
X_3:=CLOSE/HIGH<=0.911 AND VOL>=REF(HHV(VOL,21),1)*1.5 AND REF(CLOSE,1)>=REF(MA(CLOSE,22),1);
X_4:=CLOSE>=HHV(CLOSE,22) AND CLOSE>=MA(CLOSE,63);
X_5:=BArslAst(X_4>=1);
X_6:=COUNT(CLOSE/MA(CLOSE,63)>=1.4,22);
X_7:=IF(X_6>=1,2/3,1);
X_8:=CLOSE<REF(CLOSE,X_5)-REF(ATR,1)*N1*REF(X_7,1) OR X_2>=1 OR X_3>=1;
X_9:=BARSLAST(X_8>=1);
BUY1:X_4>=1 AND X_9<=REF(X_5,1);