Market LabDocs
ScriptingSources

Open Interest

Open interest source configuration for Market Lab scripts.

Open Interest Source

Open interest cannot be reconstructed from public trades, so it does not inherit the arbitrary live intervals supported by candles.

MMT supplies OI candles and requires a provider-supported timeframe in seconds:

--source oi@binancef@mmt:timeframe=60

Open interest is futures-only. The installed market snapshot classifies MMT exchanges such as binance and bybit as spot, and binancef and bybitf as futures. Spot OI selectors are rejected locally.

This works in live runs and backtests. BULK supplies live ticker snapshots instead:

--source oi@bulk

Do not pass a timeframe to BULK live OI. BULK OI is not available for script backtests.

Read either normalized form through history:

const current = history.source('oi@binancef@mmt', 0)
const previous = history.source('oi@binancef@mmt', 1)
const series = history.source('oi@binancef@mmt')

MMT records contain OI OHLC and sample count. BULK snapshots normalize one observed value into o, h, l, and c and also expose mark price and notional when available.

See Open Interest Data Type.

On this page