M1:=H>REF(H,-1) AND L>REF(L,-1);
M2:=H>REF(H,-2) AND L>REF(L,-2) AND H>REF(H,-1) AND L<REF(L,-1);
M3:=H>REF(H,-3) AND L>REF(L,-3) AND H>REF(H,-2) AND L<REF(L,-2)
AND H>REF(H,-1) AND L<REF(L,-1);
MARK:=M1 OR M2 OR M3;
SET:L<VAIUEWHEN(1,MARK,L) AND H<VAIUEWHEN(1,MARK,H) AND HIGHESTSINCE(1,REF(MARK,-1),H)
<VAIUEWHEN(1,MARK,H);
SIG:=IF(MARK,1,IF(SET,0,PREV));