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=60Backtest input shape:
input.mode === "window"
input.oi.candles
input.oi.timeframe_secLive Run
mlab script run ./scripts/oi-script.js \
--provider mmt \
--exchange binancef \
--symbol BTC/USDT \
--source oi:timeframe=60Live input shape:
input.mode === "stream"
input.source === "oi"
input.oi.candle
input.oi.timeframe_secConfig
| Key | Required | Description |
|---|---|---|
timeframe | Yes | OI candle timeframe in seconds. Example: 60, 300, 3600. |
See Open Interest Data Type for the candle fields.