Sidechair

chart.right_visible_bar_time

Browse the reference

The timestamp, in milliseconds, of the rightmost bar on screen right now.

Try it in the editor

It moves when the chart is scrolled or zoomed, and the script runs again with the new value. Like time it counts milliseconds, and as an input value it is the same on every bar of a run.

Comparing time with it picks out the last bar in view, which is where a label that summarises the visible window belongs.

Type

input int

Remarks

  • On Sidechair: chart.right_visible_bar_time is not supported yet, and a script that names it stops with an error before it runs.

Example

Pine ScriptClose printed on the last visible barOpen in editor
//@version=6
indicator("chart.right_visible_bar_time: edge label", overlay = true)
if time == chart.right_visible_bar_time
    label.new(bar_index, high, str.tostring(close, "#.##"), style = label.style_label_down)
plot(close)

See also

Not on Sidechair yet