N:=4;
Var1:=IF(YEAR>2011 AND MONTH>7, 0, 1);
Var2:=(HIGH-MAX(CLOSE, OPEN))/(HIGH-LOW);
Var3:=VOL/CAPITAL*100;
Var2>0.667 AND Var3>N AND HIGH>REF(HIGH, 1);
N:=4;
Var1:=IF(YEAR>2011 AND MONTH>7, 0, 1);
Var2:=(HIGH-MAX(CLOSE, OPEN))/(HIGH-LOW);
Var3:=VOL/CAPITAL*100;
Var2>0.667 AND Var3>N AND HIGH>REF(HIGH, 1);