N:=22;N2:=5;N3:=3;N4:=-30;
Var2:=CLOSE<0.98*REF(CLOSE,1);
Var3:=OPEN<REF(CLOSE,1);
Var4:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
Var5:=(CLOSE-REF(OPEN,29))/REF(OPEN,29)*100;
Var6:=MA(COST(N)/LOW,N3);
Var7:=Var6>1.5 AND Var4>N2 AND Var5<N4;
Q: Var7 AND (COUNT(Var7,10) AND Var2 OR COUNT(Var7,20));