MMTMMT Docs
Data Sources

Volume Delta

Volume delta OHLC candles.

Legacy Scripting v2

These docs remain available while the v2 engine is supported. For new scripts, use Scripting v3.

data.VD exposes volume delta candles where each bar tracks buy - sell.

data.VD supports aggregated exchange strings and trade-size buckets.

const vd = subscribe(data.VD, { bucket: 1 })

Functions

vd.open(offset?) -> number
vd.high(offset?) -> number
vd.low(offset?) -> number
vd.close(offset?) -> number
vd.unix(offset?) -> number
vd.bucket() -> number
vd.bucketInfo() -> { id: number, label: string, minValue: number, maxValue: number }
  • offset?: optional bar offset on the VD subscription clock

Bucket Selection

Use options.bucket or options.bucketGroup with subscribe(...) to choose the stored VD bucket.

const vdAll = subscribe(data.VD, { bucket: 1 })
const vdWhales = subscribe(data.VD, { bucket: 10 })

bucket() returns the active bucket id for the subscription.

bucketInfo() returns metadata for the selected bucket:

BucketLabelRange
1allall trades
21-1K1 to 1,000
31K-10K1,000 to 10,000
410K-25K10,000 to 25,000
525K-50K25,000 to 50,000
650K-100K50,000 to 100,000
7100K-250K100,000 to 250,000
8250K-500K250,000 to 500,000
9500K-1M500,000 to 1,000,000
101M-5M1,000,000 to 5,000,000
115M+5,000,000+

Example

//@version=2
indicator("Volume Delta", false)
const vd = subscribe(data.VD, {
  exchange: agg("bybitf", "binancef"),
  bucket: 3
})

function onBar(index) {
  const value = vd.close()
  plotHistogram("VD", value, {
    color: value >= 0 ? color.teal : color.orange
  })
}

On this page