Functions

Data

13 names in this group.
Each comes with its signature and an example.

open

Open price per bar

signature
const open: Series

high

High price per bar

signature
const high: Series

low

Low price per bar

signature
const low: Series

close

Close per bar (the current bar: the latest price)

signature
const close: Series

volume

Volume per bar

signature
const volume: Series

time

Bar open time (UTC milliseconds)

signature
const time: Series

hl2

(high + low) / 2

signature
const hl2: Series

hlc3

(high + low + close) / 3

signature
const hlc3: Series

ohlc4

(open + high + low + close) / 4

signature
const ohlc4: Series

hlcc4

(high + low + 2 × close) / 4

signature
const hlcc4: Series

turnover

Value traded per bar (where the exchange gives it, else NaN)

signature
const turnover: Series

request.bars

Bars of another timeframe or symbol, lined up with this chart’s bars. A bar is seen only once it has closed by the chart bar’s close (no look-ahead): on an hourly chart, the daily value changes after the day ends. To calculate on those bars use compute: d.compute((b) => b.ta.ema(b.close, 20)) is the daily 20 EMA. Up to 4

signature
bars(o: { symbol?: string; timeframe?: Timeframe }): { open: Series; high: Series; low: Series; close: Series; volume: Series; time: Series; compute<T extends Series | Record<string, Series>>(fn: (b: RequestedBars) => T): T }
example
const d = request.bars({ timeframe: '1D' })

request.data

Market data lined up with this chart’s bars: funding (%), openInterest ($M), longShortRatio / topLongShortRatio, kimchiPremium (%), cvd, fearGreed (0–100), coinbasePremium (%), dvol, stablecoins ($B). Mostly for Binance futures symbols. Up to 8

signature
data(name: DataName, o?: { symbol?: string }): Series
example
const f = request.data('funding')

npm · GitHub