Where the last bar stands, so a study can act once per bar rather than once per tick, or refuse to signal off a bar that is still moving.
The last bar has closed: its interval has elapsed on the chart clock.
The most recent update appended a bar rather than replacing one.
A live feed is driving updates, rather than a one-off history load.
Index of the last bar, bars.length - 1 (-1 when there are none).
OptionalintervalThe timeframe ('5m', '1d'), on the same terms as symbol.
OptionalsymbolThe instrument, when the host knows one. See IndicatorAttachContext.
OptionaltickThe instrument's tick size, from the price pane's minMove.
The price pane and not the indicator's own, because calc runs on the
instrument's bars whichever pane the plot lands in, and a study pane is not
quoted in the instrument's tick: an RSI is a dimensionless 0..100 band, so
its scale carries no tick at all to read.
undefined when the host has not told the chart what it is, which is the
honest answer rather than a guessed 0.01: an indicator sizing a range in
ticks has to tell "one paisa" apart from "nobody said".
The chart's IANA zone, the calendar its axis is labelled in.
The fourth, optional argument to
calc(and the sixth tocalcTail): what the calculation cannot read off the bars themselves.It is optional so that every descriptor written against
calc(bars, settings, store)keeps its exact signature and its exact behaviour, which is the whole point: a calculation that ignores the context computes what it always did.