signum x signum[x]
Where x (or its underlying value for temporals) is
-1i0i1iq)signum -2 0 1 3
-1 0 1 1i
q)signum (0n;0N;0Nt;0Nd;0Nz;0Nu;0Nv;0Nm;0Nh;0Nj;0Ne)
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1i
q)signum 1999.12.31
-1i
Find counts of price movements by direction:
select count i by signum deltas price from trade