N:=50;
Var1:=IF(YEAR>2015 AND MONTH>7, 0, 1);
Var2:=(CLOSE-LLV(LOW, 9))/(HHV(HIGH, 9)-LLV(LOW, 9))*100;
Var3:=SMA(Var2, 3, 1);
Var4:=SMA(Var3, 3, 1);
Var5:=MA(CLOSE, 1)-MA(CLOSE, 50);
Var6:=(EMA(CLOSE, 1)/EMA(CLOSE, 50)-1)*100;
Var7:=(Var5-MA(Var5, 1))*10;
ENTERLONG:(CROSS(Var3, Var4) AND Var4>35 OR CROSS(Var6, Var7)) AND Var1=1;
EXITLONG:(CROSS(78, Var3) OR CROSS(Var4, Var3) AND Var4>N OR CROSS(10, Var6)) AND Var1=1;