chart.isLast#
True on the last bar of the current call (i === N - 1).
SYNTAX#
ctx.isLast: booleanRETURNS#
boolean — true on the rightmost bar of the call.
REMARKS#
Common pattern: gate entity.* emissions to ctx.isLast so persistent overlays (support lines, target labels) only render after the warmup pass settles.
EXAMPLE#
function onBar(i, ctx) {
if (!ctx.isLast) return;
// Draw a target line only on the latest bar.
entity.line({
key: 'target', x1: candles[0].time, y1: 50000,
x2: candles[i].time, y2: 50000, color: '#26a69a'
});
}