Skip to content

barstate

Properties

is_confirmed

Type: series bool

Returns true if the script is calculating the last (closing) update of the current bar.

The next script calculation will be on the new bar data.


is_first

Type: series bool

Returns true if current bar is first bar in barset.


is_history

Type: series bool

Returns true if current bar is a historical bar.


is_last

Type: series bool

Returns true if current bar is the last bar in barset, false otherwise.

This condition is true for all real-time bars in barset.


is_last_confirmed_history

Type: series bool

Returns true if script is executing on the dataset's last bar when market is closed, or script is executing on the bar immediately preceding the real-time bar, if market is open.


is_new

Type: series bool

Returns true if script is currently calculating on new bar.

This variable is true when calculating on historical bars or on first update of a newly generated real-time bar.


is_realtime

Type: series bool

Returns true if the script is calculating on a real-time bar.

Released under the MIT License.