Var1:=IF(YEAR>2011 AND MONTH>7, 0, 1);
Var2:=VOL/CAPITAL*100;
Var3:=MA(Var2, 4);
Var4:=(CLOSE-OPEN)/OPEN*100;
Var5:=BARSLAST(Var2>0.900 AND REF(Var2, 1)>0.900 AND REF(Var2, 2)<0.900 AND
REF(Var2, 3)<0.900 AND MA(REF(Var2, 2), 60)<0.900);
Var6:=(CLOSE-REF(OPEN, Var5))/REF(OPEN, Var5)*100;
Var7:=IF(Var5=0, HHVBARS(CLOSE, 0), Var5);
Var8:=HHVBARS(CLOSE, Var7);
ENTERLONG:Var1=1 AND Var2>0.900 AND REF(Var2, 1)>0.900 AND REF(Var2, 2)<0.900 AND
REF(Var2, 3)<0.900 AND MA(REF(Var2, 2), 60)<0.900 AND Var8>80;
EXITLONG:Var1=1 AND Var3>5 AND MA(Var4, 4)<2 AND Var6>100 AND
CROSS(MA(CLOSE, 6), MA(CLOSE, 3));