VAR1:=MAX(MAX(HIGH-LOW,Abs(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
VAR2:=(HIGH+LOW)/2+MA(VAR1,2);
VAR3:=(HIGH+LOW)/2-MA(VAR1,2);
VAR4:=REF(VAR2,BArslAST(VAR2<=REF(VAR2,1)));
VAR5:=LLV(VAR2,2*1.5);
VAR6:=IF(VAR5!=REF(VAR5,1) AND VAR4<REF(VAR4,1),VAR4,IF(VAR4=VAR5,VAR4,VAR5));
VAR7:=BARSLAST(crOSS(0.5,VAR2=VAR6))+1;
VAR8:=CROSS(COUNT(CROSS(CLOSE,VAR6) OR CROSS(CLOSE,REF(VAR6,2)) AND VAR2>VAR6,VAR7),0.5);
VAR9:=BARSLAST(VAR8);
VAR10:=BARSLAST(CROSS(HHV(VAR3,VAR9+1),CLOSE));
VAR11:=MA(CLOSE,18);
VAR12:=CLOSE>=VAR11*1.004;
VAR13:=VAR11>=REF(VAR11,1);
VAR14:=VAR12 AND VAR13;
VAR15:=IF(CLOSE<OPEN,(CLOSE-LOW)/(HIGH-LOW),0);
X:CROSS(VAR9,VAR10) AND CLOSE/REF(LLV(LOW,3),1)<1 AND CLOSE<OPEN AND CLOSE!=LOW AND VAR14 AND VAR15>0.03 AND VAR15<0.3 AND (C-REF(C,1))/REF(C,1)*100<(0-4) AND CLOSE<expma(CLOSE,14) AND CLOSE>EXPMA(CLOSE,21) AND REF(DOWNNDAY(C,1),1);