last_bar_time - Pine Script Variable
last_bar_time
Section titled “last_bar_time”Overview
Section titled “Overview”Time in UNIX format of the last chart bar. It is the number of milliseconds that have elapsed since 00:00:00 UTC, 1 January 1970.
intQualifier
Section titled “Qualifier”series
Remarks
Section titled “Remarks”- Because the value can update on realtime bars, it may repaint when used for forward-looking logic.
- Please note that using this variable/function can cause indicator repainting.
Example
Section titled “Example”//@version=6indicator("Last bar timestamp", overlay=true, max_labels_count=1)
if barstate.islast label.new(bar_index, high, str.format_time(last_bar_time, "yyyy-MM-dd HH:mm"), style=label.style_label_left)