VAR1:=IF(CLOSE>EMA(C,5) AND LOW<EMA(C,5),1,0);
VAR2:=IF(CLOSE>EMA(C,8) AND LOW<EMA(C,8),1,0);
VAR3:=IF(CLOSE>EMA(C,10) AND LOW<EMA(C,10),1,0);
VAR4:=IF(CLOSE>EMA(C,12) AND LOW<EMA(C,12),1,0);
VAR5:=IF(CLOSE>EMA(C,15) AND LOW<EMA(C,15),1,0);
VAR6:=IF(CLOSE>EMA(C,60) AND LOW<EMA(C,60),1,0);
VAR7:=IF(CLOSE>EMA(C,65) AND LOW<EMA(C,65),1,0);
VAR8:=IF(CLOSE>EMA(C,70) AND LOW<EMA(C,70),1,0);
VAR9:=IF(CLOSE>EMA(C,75) AND LOW<EMA(C,75),1,0);
VAR10:=IF(C>EMA(C,80) AND LOW<EMA(C,80),1,0);
VAR11:=VAR1+VAR2+VAR3+VAR4+VAR5;
VAR12:=VAR6+VAR7+VAR8+VAR9+VAR10;
VAR13:=MIN(MIN(MIN(MIN(EMA(C,5),EMA(C,8)),EMA(C,10)),EMA(C,12)),EMA(C,15));
VAR14:=MAX(MAX(MAX(MAX(EMA(C,60),EMA(C,65)),EMA(C,70)),EMA(C,75)),EMA(C,80));
VAR28:=(CLOSE/REF(CLOSE,1)-1)*100;
VAR29:=EVERY(VAR13>VAR14,5) AND VAR11=5 AND VAR28>0;
XG:VAR11+VAR12>=8 AND VAR28>0 AND REF(HIGH,1)>EMA(C,80) AND NOT(VAR29);