VAR1:=(EMA(CLOSE,1));
VAR2:=(EMA(CLOSE,5));
VAR3:=(EMA(CLOSE,10));
VAR4:=(EMA(CLOSE,20));
VAR5:=(EMA(CLOSE,30));
VAR6:=(EMA(CLOSE,60));
VAR7:=(IF(VAR1-VAR2>=0,1,0));
VAR8:=(IF(VAR1-VAR3>=0,1,0));
VAR9:=(IF(VAR1-VAR4>=0,1,0));
VAR10:=(IF(VAR1-VAR5>=0,1,0));
VAR11:=(IF(VAR1-VAR6>=0,1,0));
VAR13:=(VAR7+VAR8+VAR9+VAR10+VAR11);
XG:crOSS(VAR1,VAR6) AND NOT(REF(VAR13=5,1)) AND VAR13=5;