Skip to main content

chart.stepSize#

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

SYNTAX#

ctx.stepSize: number | null

RETURNS#

number | null — e.g. 0.001 for BTCUSDT/binance.

REMARKS#

Use when computing simulated position sizes or rounding suggested order quantities to a valid increment.

EXAMPLE#

function onBar(i, ctx) {
  if (ctx.stepSize === null) return;
  const rawQty = 100 / candles[i].close;
  const qty = Math.floor(rawQty / ctx.stepSize) * ctx.stepSize;
  // ... use qty in a labeled annotation ...
}

SEE ALSO#

chart.tickSize, chart.symbol