Market LabDocs

Trades

Normalized live trade records available inside Market Lab scripts.

A live trade record contains only price and size:

type Trade = {
  price: number
  size: number
}

Example:

{
  price: 1927.5,
  size: 0.25,
}

Read trade records with the exact configured selector:

const trades = history.source('btc@trades@bulkf')
const latest = history.source('btc@trades@bulkf', 0)

The list is ordered from oldest to newest. Index 0 returns the newest trade.

The record does not repeat the symbol, exchange, or provider because the selector already defines them. Timestamp and aggressor side are internal and are not exposed to the script.

Trade records are available only in live scripts. They are not available in script backtests.

See Trades Source for setup and provider selectors.