Skip to content
StatePath
All data types

bar

A position on the chart, counted in bars (candles).

  • BUFFER
  • SCALAR

What is it

'How many bars ago' rather than a price or a time.

A bar index (SCALAR int64, or BUFFER broadcast). Deliberately distinct from num — mixing bar indices with plain numerics is unsafe (time_domain rule).

  • SCALARtime.barint64
  • BUFFERtime.bar
  • BUFFERtime.barint64

What is it a kind of

Any tool that accepts time accepts this.

Who makes it

Who takes it

Exactly this
Through time
28 tools take any time

How do I turn it into something else

Fromtime.bar
Becomes a flat series
SCALAR → BUFFER
Needs a tool

Clock

time.epochseconds since 1970 (UTC)EPOCH_SECONDSwhen did it happen
time.bara bar index on the chartBAR_INDEXhow many bars ago
time.durationa span in secondsDURATION_SECONDShow long

These never mix: a bar index is not a time, and a duration is not a date. The validator refuses a wire between two clock domains, and nothing converts between them — compute the other one with a time tool.