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: boolType series bool.
Example
const v = barstate.isconfirmedSince ChartScript 1
#barstate.isfirstvariable
true on the first bar.
barstate.isfirst: boolType series bool.
Example
const v = barstate.isfirstSince ChartScript 1
#barstate.ishistoryvariable
true on closed bars of the history.
barstate.ishistory: boolType series bool.
Example
const v = barstate.ishistorySince ChartScript 1
#barstate.islastvariable
true on the last bar.
barstate.islast: boolType series bool.
Example
const v = barstate.islastSince ChartScript 1
#barstate.islastconfirmedhistoryvariable
true on the last closed bar of the history.
barstate.islastconfirmedhistory: boolType series bool.
Example
const v = barstate.islastconfirmedhistorySince ChartScript 1
#barstate.isnewvariable
true on the first run of a live bar.
barstate.isnew: boolType series bool.
Example
const v = barstate.isnewSince ChartScript 1
#barstate.isrealtimevariable
true on the live bar.
barstate.isrealtime: boolType series bool.
Example
const v = barstate.isrealtimeSince ChartScript 1