N:=5;
M:=10;
Z:=20;
GD:=REF(H,3)=HHV(H,7);
GLXQ:=FILTERX(GD,3);
FZ:=BACKSET(GLXQ,4);
GL:=FILTER(FZ,3) AND H=HHV(H,4);
JL1:=BARSLAST(GL);
JL2:=REF(JL1,JL1+1)+JL1+1;
DD:=REF(L,3)=LLV(L,7);
DLXQ:=FILTERX(DD,3);
FZ1:=BACKSET(DLXQ,4);
DL:=FILTER(FZ1,3) AND L=LLV(L,4);
JL3:=BARSLAST(DL);
JL4:=REF(JL3,JL3+1)+JL3+1;
ZTP:=IF(FINANCE(3)=1,0.1,IF(FINANCE(3)=2,0.3,0.2));
ZT:=C>=ZTPRICE(REF(C,1),ZTP);
XT1:=JL1<JL3 AND REF(H,JL1)/REF(L,JL3)*100-100>N AND COUNT(ZT,JL3) ;
XT2:=CROSS(XT1,0.5);
JL11:=BARSLAST(XT2);
JL12:=JL11+REF(JL3,JL11);
WR1:=(C-REF(L,JL12))/(REF((C+O+L+H)/4,JL11)-REF(L,JL12))*100;
TJ1:=EVERY(C/REF(H,JL11)<1.03 AND H/REF(H,JL11)<1.05 ,JL11);
TJ2:=(HHV((C+O+L+H)/4,JL11-1)-LLV((C+O+L+H)/4,JL11-1))/(HHV(H,JL11)-LLV(L,JL12))*100<M;
TJ3:=COUNT(C>REF(C,1),JL11)>JL11*0.25;
XG:EVERY(WR1>Z,JL11-1) AND JL11>=4 AND TJ1 AND TJ2 AND TJ3;