Skip to main content

chart.tickSize#

Minimum price increment for the active symbol on the active venue.

SYNTAX#

ctx.tickSize: number | null

RETURNS#

number | null — e.g. 0.10 for BTCUSDT/binance, 0.01 for ETHUSDT/binance.

REMARKS#

Hyperliquid additionally enforces a 5-significant-figures rule on prices that's finer than tickSize at high prices. Consumers handling HL prices may need to apply 5sf rounding for valid quotes.

EXAMPLE#

function onBar(i, ctx) {
  if (ctx.tickSize === null) return;
  // Round a level to a valid quote price.
  const raw = candles[i].close * 1.01;
  const rounded = Math.round(raw / ctx.tickSize) * ctx.tickSize;
  plot('target', rounded);
}

SEE ALSO#

chart.stepSize, chart.symbol