VAR44:=10;
VAR45:=10;
VAR46:=3;
VAR47:=10;
VAR48:=2.5;
VAR49:=MAX(MAX(HIGH-LOW,Abs(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));
VAR50:=(HIGH+LOW)/2+MA(VAR49,VAR47)*VAR48;
VAR51:=(HIGH+LOW)/2-MA(VAR49,VAR47)*VAR48;
VAR52:=REF(VAR50,BARSLAST(VAR50<=REF(VAR50,1)));
VAR53:=LLV(VAR50,VAR45*1.5);
VAR54:=IF(VAR53!=REF(VAR53,1) AND VAR52< REF(VAR52,1),VAR52,IF(VAR52=VAR53,VAR52,VAR53));
VAR55:=BARSLAST(crOSS(0.5,VAR50=VAR54))+1;
VAR56:=CROSS(COUNT(CROSS(CLOSE,VAR54) OR CROSS(CLOSE,REF(VAR54,2)) AND VAR50>VAR54,VAR55),0.5);
VAR57:=BARSLAST(VAR56);
VAR58:=BARSLAST(CROSS(HHV(VAR51,VAR57+1),CLOSE));
XG:CROSS(VAR58,VAR57);