# Bar variables reference

> All 17 bar variables in AlgoBarsX, each with its parameters, defaults, ranges and an example: open, high, low, close, volume, time, hl2, hlc3, ohlc4, bar.index and 7 more.

Source: https://algobarsx.com/docs/ref-var-bars/

### `open` → series<price>

Open of the bar.

```algobarsx
first_price = open
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `high` → series<price>

High of the bar.

```algobarsx
top_price = high
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `low` → series<price>

Low of the bar.

```algobarsx
bottom_price = low
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `close` → series<price>

Close of the bar (final on confirmed bars).

```algobarsx
last_price = close
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `volume` → series<number>

Volume, or tick count on range, x-ray and renko bars where recorded.

```algobarsx
activity = volume
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `time` → series<time>

Bar time (completion time on range, x-ray and renko bars).

```algobarsx
stamp = time
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `hl2` → series<price>

(high + low) / 2.

```algobarsx
midpoint = hl2
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `hlc3` → series<price>

(high + low + close) / 3.

```algobarsx
typical = hlc3
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `ohlc4` → series<price>

(open + high + low + close) / 4.

```algobarsx
average_price = ohlc4
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.index` → int

Index of the bar from the start of history.

```algobarsx
n = bar.index
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.confirmed` → bool

True once the bar has closed.

```algobarsx
closed = bar.confirmed
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.is_first` → bool

True on the first evaluated bar.

```algobarsx
starting = bar.is_first
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.is_last` → bool

True on the last historical bar.

```algobarsx
caught_up = bar.is_last
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.range` → distance

high - low.

```algobarsx
span = bar.range
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.body` → distance

Absolute distance between open and close.

```algobarsx
body_now = bar.body
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.direction` → int

1 up, -1 down, 0 flat.

```algobarsx
dir = bar.direction
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `bar.type` → bartype

The script's bar type.

```algobarsx
current_bars = bar.type
```

Works in: strategy, indicator, alert, library. Since 1.0.
