Skip to content
Nexus Prop LLC

NexuScript 1.5

Bar values

The prices, volume and time of the bar being run, and where it sits in the chart.

open

valueNexuScript 1.0

The bar's opening price.

Syntax

open::Number

Details

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

closehighlow

high

valueNexuScript 1.0

The bar's highest price.

Syntax

high::Number

Details

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

lowta.highest

low

valueNexuScript 1.0

The bar's lowest price.

Syntax

low::Number

Details

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

highta.lowest

close

valueNexuScript 1.0

The bar's closing price (the last price on the forming bar).

Syntax

close::Number

Details

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

openhl2

volume

valueNexuScript 1.0

The number of contracts traded in the bar.

Syntax

volume::Number

Details

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

ta.vwmaclose

time

valueNexuScript 1.0

When the bar opened.

Syntax

time::Number

Details

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

Milliseconds since 1970-01-01 UTC. Read it as a wall-clock time with hour, minute and the other time functions.

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)
end

See also

hourbar.index

hl2

valueNexuScript 1.0

A typical price of the bar: (high + low) / 2.

Syntax

hl2::Number

Details

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

hlc3ohlc4hlcc4close

hlc3

valueNexuScript 1.0

A typical price of the bar: (high + low + close) / 3.

Syntax

hlc3::Number

Details

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

hl2ohlc4hlcc4close

ohlc4

valueNexuScript 1.0

A typical price of the bar: (open + high + low + close) / 4.

Syntax

ohlc4::Number

Details

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

hl2hlc3hlcc4close

hlcc4

valueNexuScript 1.0

A typical price of the bar: (high + low + close + close) / 4.

Syntax

hlcc4::Number

Details

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

hl2hlc3ohlc4close

bar.index

valueNexuScript 1.0

The number of the bar: 0 for the oldest bar the script sees.

Syntax

bar.index::Number

Missing values

Never missing.

Live and historical bars

The forming bar keeps its number through every update.

Example

plot("Bar number", bar.index)

See also

bar.firstbar.lasttime

bar.first

valueNexuScript 1.0

True on the oldest bar the script sees.

Syntax

bar.first::Bool

Details

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")
end

See also

bar.lastbar.index

bar.last

valueNexuScript 1.0

True on the newest bar.

Syntax

bar.last::Bool

Details

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")
end

See also

bar.firstbar.confirmed

bar.confirmed

valueNexuScript 1.0

True when the bar is closed and will not change.

Syntax

bar.confirmed::Bool

Details

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")
end

See also

bar.realtimebar.lastalert

bar.history

valueNexuScript 1.0

True when the bar had already closed when the script started.

Syntax

bar.history::Bool

Details

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))
end

See also

bar.realtimebar.confirmed

bar.realtime

valueNexuScript 1.0

True on bars that formed while the chart was open.

Syntax

bar.realtime::Bool

Details

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

See also

bar.historybar.confirmed