ScriptingSources
Orderbook
Orderbook source configuration for Market Lab scripts.
Orderbook Source
The orderbook source provides live orderbook snapshots and historical snapshots from MMT heatmap data.
Manifest
export const script = {
name: "orderbook-script",
version: "1",
sources: ["orderbook"],
params: {}
}Backtest
mlab script backtest ./scripts/orderbook-script.js \
--provider mmt \
--exchange bybitf \
--symbol BTC/USDT \
--from 1780307559000 \
--to 1780311159000 \
--source orderbook:timeframe=60 \
--source orderbook:depth=100Input shape:
input.mode === "window"
input.orderbook.booksLive Run
mlab script run ./scripts/orderbook-script.js \
--provider mmt \
--exchange bybitf \
--symbol BTC/USDT \
--source orderbook:depth=100Live input shape:
input.mode === "stream"
input.source === "orderbook"
input.orderbook.snapshotConfig
| Key | Required | Description |
|---|---|---|
timeframe | Backtest only | Historical bucket timeframe in seconds. |
depth | No | Number of book levels to request. Defaults to 100. |
MMT historical orderbook data is binned from flat_heatmap_hd, so it is useful for liquidity and execution-condition analysis, not exact raw order replay.
See Orderbook Data Type for the book fields.