# Vex reference: Bar values

| Name | What |
| --- | --- |
| [`open`](#open) | The bar's open. |
| [`high`](#high) | The bar's high. |
| [`low`](#low) | The bar's low. |
| [`close`](#close) | The bar's close (the latest price on the forming bar). |
| [`volume`](#volume) | The bar's volume (empty where the chart has none). |
| [`time`](#time) | When the bar opened, in seconds since 1970 (UTC). |
| [`bar`](#bar) | The bar number: 0 for the first bar loaded, then 1, 2, ... |
| [`hl2`](#hl2) | (high + low) / 2 |
| [`hlc3`](#hlc3) | (high + low + close) / 3 |
| [`ohlc4`](#ohlc4) | (open + high + low + close) / 4 |
| [`tr`](#tr) | True range: the bar's range including any gap from the previous close. |
| [`buy_volume`](#buy-volume) | Volume bought by takers in the bar (crypto; empty where the chart has none). |
| [`sell_volume`](#sell-volume) | Volume sold by takers in the bar (crypto; empty where the chart has none). |
| [`delta`](#delta) | buy_volume - sell_volume: the bar's taker delta. |
| [`cvd`](#cvd) | Cumulative volume delta: total(delta) from the first bar loaded. |
| [`obv`](#obv) | On-balance volume: running volume, added on up closes and taken off on down closes. |
| [`vwap`](#vwap) | Volume-weighted average price of the session (resets each UTC day), on hlc3. |
| [`hour`](#hour) | Hour of the bar's open, 0 to 23 (UTC). |
| [`minute`](#minute) | Minute of the bar's open, 0 to 59. |
| [`weekday`](#weekday) | Day of the week of the bar's open: 1 Monday to 7 Sunday (UTC). |
| [`new_day`](#new-day) | True on the first bar of each UTC day (and the first bar loaded). |
| [`closed`](#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**

```vex
plot(open)
```

## high

The bar's high.

**Returns:** a number per bar

**Example**

```vex
plot(high)
```

## low

The bar's low.

**Returns:** a number per bar

**Example**

```vex
plot(low)
```

## close

The bar's close (the latest price on the forming bar).

**Returns:** a number per bar

**Example**

```vex
plot(close)
```

## volume

The bar's volume (empty where the chart has none).

**Returns:** a number per bar

**Example**

```vex
plot(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**

```vex
plot(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**

```vex
plot(bar)
```

## hl2

(high + low) / 2

**Returns:** a number per bar

**Example**

```vex
plot(hl2)
```

## hlc3

(high + low + close) / 3

**Returns:** a number per bar

**Example**

```vex
plot(hlc3)
```

## ohlc4

(open + high + low + close) / 4

**Returns:** a number per bar

**Example**

```vex
plot(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**

```vex
plot(tr)
```

## buy_volume

Volume bought by takers in the bar (crypto; empty where the chart has none).

**Returns:** a number per bar

**Example**

```vex
plot(buy_volume)
```

## sell_volume

Volume sold by takers in the bar (crypto; empty where the chart has none).

**Returns:** a number per bar

**Example**

```vex
plot(sell_volume)
```

## delta

buy_volume - sell_volume: the bar's taker delta.

**Returns:** a number per bar

**Example**

```vex
plot(delta)
```

## cvd

Cumulative volume delta: total(delta) from the first bar loaded.

**Returns:** a number per bar

**Example**

```vex
plot(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**

```vex
plot(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**

```vex
plot(vwap)
```

## hour

Hour of the bar's open, 0 to 23 (UTC).

**Returns:** a number per bar

**In Pine Script:** `hour(time, "UTC")`

**Example**

```vex
background(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**

```vex
plot(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**

```vex
plot(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**

```vex
background(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**

```vex
fast = ema(close, 9)
slow = ema(close, 21)
plot(fast)
plot(slow)
mark(crosses_above(fast, slow) and closed, "B", where = below)
```

See also: [Marks, finished bars and alerts](/documentation/vex/marks-finished-bars-and-alerts)
