Skip to content

Data series ​

candle.* series advance once per bar, block.* series once per block. Read the current value with .value and older values with .at(k).

NameDescription
candle.openPrice of the bar's first block.
candle.highHighest block price in the bar.
candle.lowLowest block price in the bar.
candle.closePrice of the bar's last block so far.
candle.volumeAlpha traded through the pool in the bar.
candle.turnoverTAO traded through the pool in the bar.
candle.tradesNumber of pool trades in the bar.
candle.timeBar open time, ms since epoch (UTC).
candle.movingPriceprotocol moving price at the bar's first block (bar-aligned; block.movingPrice is per block)
block.numberBlock height.
block.timeBlock timestamp, ms since epoch (UTC).
block.pricePool price after the block, TAO per alpha.
block.taoInTAO in the pool.
block.alphaInAlpha in the pool.
block.alphaOutAlpha outstanding (staked outside the pool).
block.movingPriceThe protocol's moving (smoothed) price.
block.tradesPool trades in the block.
block.volumealpha traded through the pool per block; in quick mode sampled per bar like the other block.* series
block.turnoverTAO traded through the pool per block; in quick mode sampled per bar like the other block.* series

candle ​

candle.open ​

ts
candle.open: Series

Price of the bar's first block.

Types: Series

candle.high ​

ts
candle.high: Series

Highest block price in the bar.

Types: Series

candle.low ​

ts
candle.low: Series

Lowest block price in the bar.

Types: Series

candle.close ​

ts
candle.close: Series

Price of the bar's last block so far.

Types: Series

candle.volume ​

ts
candle.volume: Series

Alpha traded through the pool in the bar.

Types: Series

candle.turnover ​

ts
candle.turnover: Series

TAO traded through the pool in the bar.

Types: Series

candle.trades ​

ts
candle.trades: Series

Number of pool trades in the bar.

Types: Series

candle.time ​

ts
candle.time: Series

Bar open time, ms since epoch (UTC).

Types: Series

candle.movingPrice ​

ts
candle.movingPrice: Series

protocol moving price at the bar's first block (bar-aligned; block.movingPrice is per block)

Types: Series

block ​

block.number ​

ts
block.number: Series

Block height. Block series advance once per block in precise, 1B and live runs, and once per bar in quick backtests.

Types: Series

block.time ​

ts
block.time: Series

Block timestamp, ms since epoch (UTC).

Types: Series

block.price ​

ts
block.price: Series

Pool price after the block, TAO per alpha.

Types: Series

block.taoIn ​

ts
block.taoIn: Series

TAO in the pool.

Types: Series

block.alphaIn ​

ts
block.alphaIn: Series

Alpha in the pool.

Types: Series

block.alphaOut ​

ts
block.alphaOut: Series

Alpha outstanding (staked outside the pool).

Types: Series

block.movingPrice ​

ts
block.movingPrice: Series

The protocol's moving (smoothed) price.

Types: Series

block.trades ​

ts
block.trades: Series

Pool trades in the block.

Types: Series

block.volume ​

ts
block.volume: Series

alpha traded through the pool per block; in quick mode sampled per bar like the other block.* series

Types: Series

block.turnover ​

ts
block.turnover: Series

TAO traded through the pool per block; in quick mode sampled per bar like the other block.* series

Types: Series

Types ​

Series ​

A numeric time series aligned to bars (candle., ta.) or blocks (block.*).

FieldTypeDescription
valuenumberCurrent value; NaN before the series has history. (read-only)
at(k: number): numberValue k steps ago (k = 0 is the current value). NaN beyond history.
lengthnumberNumber of values available so far. (read-only)
firstValidnumberIndex of the first non-NaN value, or -1. (read-only)
alignment"bar" | "block"Alignment of this series. (read-only)
valueOf(): numberLets +fast and fast - slow work in plain JS; comparisons should use .value.

BoolSeries ​

Boolean-valued series (ta.crossover etc.). .value is 0/1; .at(k) likewise.

BoolSeries extends Series

SeriesLike ​

A series, or a constant number used as a flat series (e.g. ta.crossover(rsi, 30)).

ts
type SeriesLike = Series | number

AlphaScript language v0.1 · runtime 0.2.0