Skip to content
ChartDeck ChartScript docs Account Open the terminal

barstate

The state of the current bar.

#Variables

#barstate.isconfirmedvariable

true when the bar is closed (and on the final run of a closing bar).

barstate.isconfirmed: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.isconfirmed

Since ChartScript 1

#barstate.isfirstvariable

true on the first bar.

barstate.isfirst: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.isfirst

Since ChartScript 1

#barstate.ishistoryvariable

true on closed bars of the history.

barstate.ishistory: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.ishistory

Since ChartScript 1

#barstate.islastvariable

true on the last bar.

barstate.islast: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.islast

Since ChartScript 1

#barstate.islastconfirmedhistoryvariable

true on the last closed bar of the history.

barstate.islastconfirmedhistory: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.islastconfirmedhistory

Since ChartScript 1

#barstate.isnewvariable

true on the first run of a live bar.

barstate.isnew: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.isnew

Since ChartScript 1

#barstate.isrealtimevariable

true on the live bar.

barstate.isrealtime: bool

Type series bool.

Example

ChartScriptFragmentOpen in editor
const v = barstate.isrealtime

Since ChartScript 1

The ChartScript documentation is in English for now; translations will follow.