Reference: Bar values
Vex reference: bar values.
For AI tools: this page as Markdown · the whole language in one file
| Name | What |
|---|---|
open | The bar's open. |
high | The bar's high. |
low | The bar's low. |
close | The bar's close (the latest price on the forming bar). |
volume | The bar's volume (empty where the chart has none). |
time | When the bar opened, in seconds since 1970 (UTC). |
bar | The bar number: 0 for the first bar loaded, then 1, 2, ... |
hl2 | (high + low) / 2 |
hlc3 | (high + low + close) / 3 |
ohlc4 | (open + high + low + close) / 4 |
tr | True range: the bar's range including any gap from the previous close. |
buy_volume | Volume bought by takers in the bar (crypto; empty where the chart has none). |
sell_volume | Volume sold by takers in the bar (crypto; empty where the chart has none). |
delta | buy_volume - sell_volume: the bar's taker delta. |
cvd | Cumulative volume delta: total(delta) from the first bar loaded. |
obv | On-balance volume: running volume, added on up closes and taken off on down closes. |
vwap | Volume-weighted average price of the session (resets each UTC day), on hlc3. |
hour | Hour of the bar's open, 0 to 23 (UTC). |
minute | Minute of the bar's open, 0 to 59. |
weekday | Day of the week of the bar's open: 1 Monday to 7 Sunday (UTC). |
new_day | True on the first bar of each UTC day (and the first bar loaded). |
closed | True once the bar is final; false on the bar still forming. Use "and closed" so a mark or alert only fires on finished bars (no repainting). |
open
The bar's open.
Returns: a number per bar
Example
1plot(open)high
The bar's high.
Returns: a number per bar
Example
1plot(high)low
The bar's low.
Returns: a number per bar
Example
1plot(low)close
The bar's close (the latest price on the forming bar).
Returns: a number per bar
Example
1plot(close)volume
The bar's volume (empty where the chart has none).
Returns: a number per bar
Example
1plot(volume)time
When the bar opened, in seconds since 1970 (UTC).
Pine's time is in milliseconds; Vex's is in seconds.
Returns: a number per bar
In Pine Script: time / 1000
Example
1plot(time)bar
The bar number: 0 for the first bar loaded, then 1, 2, ...
Returns: a number per bar
In Pine Script: bar_index
Example
1plot(bar)hl2
(high + low) / 2
Returns: a number per bar
Example
1plot(hl2)hlc3
(high + low + close) / 3
Returns: a number per bar
Example
1plot(hlc3)ohlc4
(open + high + low + close) / 4
Returns: a number per bar
Example
1plot(ohlc4)tr
True range: the bar's range including any gap from the previous close.
Returns: a number per bar
In Pine Script: ta.tr
Example
1plot(tr)buy_volume
Volume bought by takers in the bar (crypto; empty where the chart has none).
Returns: a number per bar
Example
1plot(buy_volume)sell_volume
Volume sold by takers in the bar (crypto; empty where the chart has none).
Returns: a number per bar
Example
1plot(sell_volume)delta
buy_volume - sell_volume: the bar's taker delta.
Returns: a number per bar
Example
1plot(delta)cvd
Cumulative volume delta: total(delta) from the first bar loaded.
Returns: a number per bar
Example
1plot(cvd)obv
On-balance volume: running volume, added on up closes and taken off on down closes.
Returns: a number per bar
In Pine Script: ta.obv
Example
1plot(obv)vwap
Volume-weighted average price of the session (resets each UTC day), on hlc3.
Returns: a number per bar
In Pine Script: ta.vwap
Example
1plot(vwap)hour
Hour of the bar's open, 0 to 23 (UTC).
Returns: a number per bar
In Pine Script: hour(time, "UTC")
Example
1background(hour >= 13 and hour < 21 ? #3b82f615 : none)minute
Minute of the bar's open, 0 to 59.
Returns: a number per bar
In Pine Script: minute(time, "UTC")
Example
1plot(minute)weekday
Day of the week of the bar's open: 1 Monday to 7 Sunday (UTC).
Pine counts Sunday as 1; Vex counts Monday as 1 and Sunday as 7.
Returns: a number per bar
In Pine Script: dayofweek
Example
1plot(weekday)new_day
True on the first bar of each UTC day (and the first bar loaded).
Returns: a yes/no per bar
In Pine Script: ta.change(time("D")) != 0
Example
1background(new_day ? #3b82f630 : none)closed
True once the bar is final; false on the bar still forming. Use "and closed" so a mark or alert only fires on finished bars (no repainting).
Returns: a yes/no per bar
In Pine Script: barstate.isconfirmed
Example
1fast = ema(close, 9)2slow = ema(close, 21)3plot(fast)4plot(slow)5mark(crosses_above(fast, slow) and closed, "B", where = below)See also: Marks, finished bars and alerts


