N:=9;M1:=3;M2:=3;P:=9;
AA:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
BB:=Sma(AA,M1,1);
ELIA:=SMA(BB,M2,1);
ELIB:=IF(BArslAST(crOSS(BB,ELIA))<P AND CROSS(BB,ELIA) AND BB<20,90,0);
LC:=REF(CLOSE,1);
rsi:=SMA(MAX(CLOSE-LC,0),4.1,1)/SMA(Abs(CLOSE-LC),4.1,1)*100;
CC:=CROSS(RSI,11)*80;
XG:CC OR ELIB;