feature

Price and bar data

When an indicator or definition runs, each bar hands you open, high, low, close, volume, and time on ctx — the raw market data your logic reads.

You need this page whenever you calculate from price or volume, or when you switch to volume-candle / tape data via dataSource. Studies do not use this same bar ctx; they use candle helpers instead.

Quick reference

Field

Indicator

Definition

Notes

open / high / low / close

yes

yes

OHLC

volume

yes

yes

volumeBid / volumeAsk

yes

When dataSource supports it

priceLevels

yes

yes

Tape / volume-candle levels

time

yes

yes

Bar time

barIndex

yes

yes

Index in series

params

yes

yes

Resolved settings

dataSource

Set on meta:

meta({
  shortName: "VWAP",
  kind: "overlay", // indicator
  dataSource: { type: "candles" },
});

Use { type: "volume-candles", settings: { purgeStrategy: "floor-aware" } } (or equivalent) when you need tape / priceLevels. Default is ordinary candles.

Studies

Studies do not expose the same bar ctx on onEvent. Use ctx.candles.forward / window / timeOf — see Results and stats.

Next

  1. Remembering values across bars

  2. Drawing on the chart