Skip to content


Syntax: signum x, signum[x]

Where x (or its underlying value for temporals) is

  • null or negative, returns -1i
  • zero, returns 0i
  • positive, returns 1i
q)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

An atomic function.

Find counts of price movements by direction:

q)select count i by signum deltas price from trade

Domain and range

domain b g x h i j e f c s p m d z n u v t
range  i . i i i i i i i . i i i i i i i i

Range: i