N:=6;
Q2:=PAV.MCV2;
DIF:=PAV.DIFF;
CZ:=(DIF - Q2);
DD:=CZ < REF(CZ,1);
TD:=BARSLAST(DD);
TD10:=(BARSLASTCOUNT(CZ < REF(CZ,1))) >= 10;
TDXG:=(BARSLASTCOUNT(CZ < REF(CZ,1)));
HDY:=EMA (100*(C-LLV(LOW,34))/(HHV(H,34)-LLV(LOW,34)),3);
COUNT(HDY< 10,3) AND ((REF((BARSLASTCOUNT(CZ < REF(CZ,1))) >= N,1)) AND (CZ > REF(CZ,1))) AND (CZ < 5);