Skip to content

barstate and runtime ​

Where the script is in the data, and how it was started.

NameDescription
barstate.isConfirmedThe current bar has closed.
barstate.isFinalThe current bar's last block is finalized.
barstate.isFirstThe current bar is the first bar of the run.
barstate.isLastThe current bar is the newest the runtime has received (true while each bar is processed).
barstate.isRealtimefalse while the runtime replays history; true for bars and blocks that arrive live after the replay.
barstate.indexIndex of the current bar, from 0.
runtime.modeHow the script is being run.
runtime.marketThe market the script runs on.
runtime.resolutionThe bar size the script runs at.
runtime.blockTimeMsTarget block time of the chain in ms (12,000 on Bittensor).
runtime.versionThe runtime's version, e.g.

barstate ​

barstate.isConfirmed ​

ts
barstate.isConfirmed: boolean

The current bar has closed.

barstate.isFinal ​

ts
barstate.isFinal: boolean

The current bar's last block is finalized.

barstate.isFirst ​

ts
barstate.isFirst: boolean

The current bar is the first bar of the run.

barstate.isLast ​

ts
barstate.isLast: boolean

The current bar is the newest the runtime has received (true while each bar is processed).

barstate.isRealtime ​

ts
barstate.isRealtime: boolean

false while the runtime replays history; true for bars and blocks that arrive live after the replay. Always false in a backtest.

barstate.index ​

ts
barstate.index: number

Index of the current bar, from 0.

runtime ​

runtime.mode ​

ts
runtime.mode: Mode

How the script is being run.

Types: Mode

runtime.market ​

ts
runtime.market: Market

The market the script runs on.

Types: Market

runtime.resolution ​

ts
runtime.resolution: Resolution

The bar size the script runs at.

Types: Resolution

runtime.blockTimeMs ​

ts
runtime.blockTimeMs: number

Target block time of the chain in ms (12,000 on Bittensor).

runtime.version ​

ts
runtime.version: string

The runtime's version, e.g. "0.2.0".

AlphaScript language v0.1 · runtime 0.2.0