chart.stepSize#
Minimum size increment for the active symbol on the active venue.
SYNTAX#
ctx.stepSize: number | nullRETURNS#
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 ...
}