Data Sources
Open Interest
Open interest OHLC candles.
Legacy Scripting v2
These docs remain available while the v2 engine is supported. For new scripts, use Scripting v3.
data.OI exposes open interest candles with open, high, low, close, and unix timestamp.
data.OI supports aggregated exchange strings such as "binancef:bybitf".
const oi = subscribe(data.OI)Functions
oi.open(offset?) -> number
oi.high(offset?) -> number
oi.low(offset?) -> number
oi.close(offset?) -> number
oi.unix(offset?) -> numberoffset?: optional bar offset on the OI subscription clock
Example
//@version=2
indicator("Open Interest", false)
const oi = subscribe(data.OI)
function onBar(index) {
plot("OI Close", oi.close(), { color: color.blue })
}