NexuScript 1.5
Bar values
The prices, volume and time of the bar being run, and where it sits in the chart.
The bar's opening price.
Syntax
open::NumberDetails
A series: open is this bar's value and open[1] the bar before. Only inside on bar and the functions it calls.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has. open[n] before the first bar is missing.
Live and historical bars
On the forming bar it is the value so far and changes with every update until the bar closes.
Errors
- NS230read in setup (before
on bar)
Example
plot("Value", open)See also
The bar's highest price.
Syntax
high::NumberDetails
A series: high is this bar's value and high[1] the bar before. Only inside on bar and the functions it calls.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has. high[n] before the first bar is missing.
Live and historical bars
On the forming bar it is the value so far and changes with every update until the bar closes.
Errors
- NS230read in setup (before
on bar)
Example
plot("Value", high)See also
The bar's lowest price.
Syntax
low::NumberDetails
A series: low is this bar's value and low[1] the bar before. Only inside on bar and the functions it calls.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has. low[n] before the first bar is missing.
Live and historical bars
On the forming bar it is the value so far and changes with every update until the bar closes.
Errors
- NS230read in setup (before
on bar)
Example
plot("Value", low)See also
The bar's closing price (the last price on the forming bar).
Syntax
close::NumberDetails
A series: close is this bar's value and close[1] the bar before. Only inside on bar and the functions it calls.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has. close[n] before the first bar is missing.
Live and historical bars
On the forming bar it is the value so far and changes with every update until the bar closes.
Errors
- NS230read in setup (before
on bar)
Example
plot("Value", close)See also
The number of contracts traded in the bar.
Syntax
volume::NumberDetails
A series with history.
Units and time zones
Contracts, or coins on a perpetual.
Missing values
missing when the data has no volume.
Live and historical bars
Grows during the forming bar.
Example
plot("Volume", coalesce(volume, 0), style = "columns")See also
When the bar opened.
Syntax
time::NumberDetails
A series with history: time[1] is the bar before's opening time. Use it to place lines, boxes and markers.
Units and time zones
Missing values
Never missing on a bar the chart has.
Live and historical bars
Fixed for the bar; the forming bar keeps its opening time.
Example
if bar.last
line(time[20], close[20], time, close, color = color.orange)
endSee also
A typical price of the bar: (high + low) / 2.
Syntax
hl2::NumberDetails
A series with history, like close. Handy as a price source for averages.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has.
Live and historical bars
On the forming bar it moves with the prices so far.
Example
plot("Average of hl2", ta.sma(hl2, 20))See also
A typical price of the bar: (high + low + close) / 3.
Syntax
hlc3::NumberDetails
A series with history, like close. Handy as a price source for averages.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has.
Live and historical bars
On the forming bar it moves with the prices so far.
Example
plot("Average of hlc3", ta.sma(hlc3, 20))See also
A typical price of the bar: (open + high + low + close) / 4.
Syntax
ohlc4::NumberDetails
A series with history, like close. Handy as a price source for averages.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has.
Live and historical bars
On the forming bar it moves with the prices so far.
Example
plot("Average of ohlc4", ta.sma(ohlc4, 20))See also
A typical price of the bar: (high + low + close + close) / 4.
Syntax
hlcc4::NumberDetails
A series with history, like close. Handy as a price source for averages.
Units and time zones
A price in the symbol's quote currency.
Missing values
Never missing on a bar the chart has.
Live and historical bars
On the forming bar it moves with the prices so far.
Example
plot("Average of hlcc4", ta.sma(hlcc4, 20))See also
The number of the bar: 0 for the oldest bar the script sees.
Syntax
bar.index::NumberMissing values
Never missing.
Live and historical bars
The forming bar keeps its number through every update.
Example
plot("Bar number", bar.index)See also
True on the oldest bar the script sees.
Syntax
bar.first::BoolDetails
Useful to set things up once.
Missing values
Never missing.
Live and historical bars
The same live and historical.
Example
if bar.first
marker("Start")
endSee also
True on the newest bar.
Syntax
bar.last::BoolDetails
On a live chart this is the forming bar.
Missing values
Never missing.
Live and historical bars
True on the forming bar while the chart is live.
Example
if bar.last
marker("Now", position = "below")
endSee also
True when the bar is closed and will not change.
Syntax
bar.confirmed::BoolDetails
False on the newest bar. Use it to act once per bar instead of on every update.
Missing values
Never missing.
Live and historical bars
False on the forming bar until it closes; true on every closed bar.
Example
let crossed = ta.crossover(close, ta.sma(close, 20))
if bar.confirmed && crossed
marker("Closed above")
endSee also
True when the bar had already closed when the script started.
Syntax
bar.history::BoolDetails
The opposite of bar.realtime.
Missing values
Never missing.
Live and historical bars
True for the bars loaded at the start; bars that form while the chart is open are not history.
Example
if bar.history
background(color.fade(color.gray, 95))
endSee also
True on bars that formed while the chart was open.
Syntax
bar.realtime::BoolDetails
The opposite of bar.history.
Missing values
Never missing.
Live and historical bars
False for every bar loaded at the start, true for bars that form live.
Example
if bar.realtime
background(color.fade(color.yellow, 92))
end