MarketLab Docs
ScriptingSources

Open Interest

Open interest source configuration for Market Lab scripts.

Open Interest Source

The oi source provides open interest OHLC candles for futures and perpetual markets.

Manifest

export const script = {
  name: "oi-script",
  version: "1",
  sources: ["oi"],
  params: {}
}

Backtest

mlab script backtest ./scripts/oi-script.js \
  --provider mmt \
  --exchange binancef \
  --symbol BTC/USDT \
  --from 1704067200000 \
  --to 1704070800000 \
  --source oi:timeframe=60

Backtest input shape:

input.mode === "window"
input.oi.candles
input.oi.timeframe_sec

Live Run

mlab script run ./scripts/oi-script.js \
  --provider mmt \
  --exchange binancef \
  --symbol BTC/USDT \
  --source oi:timeframe=60

Live input shape:

input.mode === "stream"
input.source === "oi"
input.oi.candle
input.oi.timeframe_sec

Config

KeyRequiredDescription
timeframeYesOI candle timeframe in seconds. Example: 60, 300, 3600.

See Open Interest Data Type for the candle fields.

On this page