X_1:=EMA(CLOSE,5);
X_2:=EMA(CLOSE,30);
X_3:=EMA(CLOSE,10);
X_4:=EMA(CLOSE,20);
X_5:=EMA(CLOSE,40);
X_6:=CLOSE>X_1 AND CLOSE>X_3 AND CLOSE>X_4 AND CLOSE>X_2 AND CLOSE>X_5;
X_7:=CLOSE
XG:LAST(NOT(X_6),20,1) AND X_6 OR (LAST(NOT(X_8),20,1) AND X_8);