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.

open high low close volume time hl2 hlc3 ohlc4 bar.index bar.confirmed bar.is_first bar.is_last bar.range bar.body bar.direction bar.type

open→ series<price>#

Open of the bar.

Example
first_price = open
strategyindicatoralertlibrarysince 1.0

high→ series<price>#

High of the bar.

Example
top_price = high
strategyindicatoralertlibrarysince 1.0

low→ series<price>#

Low of the bar.

Example
bottom_price = low
strategyindicatoralertlibrarysince 1.0

close→ series<price>#

Close of the bar (final on confirmed bars).

Example
last_price = close
strategyindicatoralertlibrarysince 1.0

volume→ series<number>#

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

Example
activity = volume
strategyindicatoralertlibrarysince 1.0

time→ series<time>#

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

Example
stamp = time
strategyindicatoralertlibrarysince 1.0

hl2→ series<price>#

(high + low) / 2.

Example
midpoint = hl2
strategyindicatoralertlibrarysince 1.0

hlc3→ series<price>#

(high + low + close) / 3.

Example
typical = hlc3
strategyindicatoralertlibrarysince 1.0

ohlc4→ series<price>#

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

Example
average_price = ohlc4
strategyindicatoralertlibrarysince 1.0

bar.index→ int#

Index of the bar from the start of history.

Example
n = bar.index
strategyindicatoralertlibrarysince 1.0

bar.confirmed→ bool#

True once the bar has closed.

Example
closed = bar.confirmed
strategyindicatoralertlibrarysince 1.0

bar.is_first→ bool#

True on the first evaluated bar.

Example
starting = bar.is_first
strategyindicatoralertlibrarysince 1.0

bar.is_last→ bool#

True on the last historical bar.

Example
caught_up = bar.is_last
strategyindicatoralertlibrarysince 1.0

bar.range→ distance#

high - low.

Example
span = bar.range
strategyindicatoralertlibrarysince 1.0

bar.body→ distance#

Absolute distance between open and close.

Example
body_now = bar.body
strategyindicatoralertlibrarysince 1.0

bar.direction→ int#

1 up, -1 down, 0 flat.

Example
dir = bar.direction
strategyindicatoralertlibrarysince 1.0

bar.type→ bartype#

The script's bar type.

Example
current_bars = bar.type
strategyindicatoralertlibrarysince 1.0

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account