Functions

Volume Profile Functions

Accessor functions for the volume_profile source — extract buy/sell volume, delta, point of control, and price range from each bar's price-level ladder.

The volume_profile source carries a variable number of price-level buckets per bar — each bucket is [priceLow, priceHigh, buyVol, sellVol]. Because the bucket count changes from bar to bar, the source has no scalar properties; you can't read .buy / .sell off it directly. Instead, use these accessor functions to pull scalar timeseries out of the profile.

Open the source first, then pass it to any accessor:

Opening a volume_profile source
timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
var totalBuy  = vpBuy(vpa);
var totalSell = vpSell(vpa);
var poc       = vpPoc(vpa);
FunctionDescription
vpBuyTotal buy volume across all price buckets at the bar
vpSellTotal sell volume across all price buckets at the bar
vpDeltaNet buy/sell delta (vpBuy − vpSell) at the bar
vpTotalCombined buy + sell volume across all buckets at the bar
vpPocPoint of Control — price of the highest-volume bucket
vpPocVolumeCombined volume at the POC bucket
vpBucketCountNumber of price-level buckets at the bar
vpPriceHighHighest price covered by the profile at the bar
vpPriceLowLowest price covered by the profile at the bar

vpBuy

vpBuy(source: TimeSeries): number — total buy volume summed across all price-level buckets at the current bar.

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — total buy volume at this bar.

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries totalBuy = vpBuy(vpa);
plotLine(value=totalBuy, colors=["#26a69a"], width=2, label=["Total Buy"], desc=["Sum of buy volume per bar"]);

vpSell

vpSell(source: TimeSeries): number — total sell volume summed across all price-level buckets at the current bar.

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — total sell volume at this bar.

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries totalSell = vpSell(vpa);
plotLine(value=totalSell, colors=["#ef5350"], width=2, label=["Total Sell"], desc=["Sum of sell volume per bar"]);

vpDelta

vpDelta(source: TimeSeries): number — net buy/sell delta at the current bar (vpBuy − vpSell). Positive = buy dominant, negative = sell dominant.

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — buy minus sell volume at this bar.

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries delta = vpDelta(vpa);
plotBar(value=delta, colors=["#26a69a", "#ef5350"], label=["Delta"], desc=["Net buy/sell pressure"]);

vpTotal

vpTotal(source: TimeSeries): number — total volume (buy + sell) summed across all buckets at the current bar.

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — combined buy + sell volume at this bar.

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries total = vpTotal(vpa);
plotLine(value=total, colors=["#9e9e9e"], width=2, label=["Total"], desc=["Combined volume"]);

vpPoc

vpPoc(source: TimeSeries): number — Point of Control: the midprice of the bucket with the highest combined buy + sell volume at the current bar.

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — POC price (NaN if no buckets at this bar).

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries poc = vpPoc(vpa);
plotLine(value=poc, colors=["#ff9800"], width=2, label=["POC"], desc=["Point of Control"]);

vpPocVolume

vpPocVolume(source: TimeSeries): number — combined buy + sell volume at the POC bucket (the bucket with the highest combined volume).

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — volume at the POC bucket.

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries pocVol = vpPocVolume(vpa);

vpBucketCount

vpBucketCount(source: TimeSeries): number — number of price-level buckets present at the current bar.

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — count of price buckets at this bar.

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries depth = vpBucketCount(vpa);

vpPriceHigh

vpPriceHigh(source: TimeSeries): number — highest priceHigh across all buckets at the current bar (top of the volume-profile range).

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — highest price covered by the profile (NaN if empty).

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries top = vpPriceHigh(vpa);

vpPriceLow

vpPriceLow(source: TimeSeries): number — lowest priceLow across all buckets at the current bar (bottom of the volume-profile range).

ParameterTypeDescription
sourceTimeSeriesA volume_profile timeseries

Returns: number — lowest price covered by the profile (NaN if empty).

timeseries vpa = volume_profile(symbol=currentSymbol, exchange=currentExchange);
timeseries bottom = vpPriceLow(vpa);

Best Practices

Always Use Accessors
The volume_profile source has no scalar properties — reading .buy / .sell directly will not work. Pull every value through the vp* accessors.
Watch the POC
The Point of Control marks the price with the most traded volume and often acts as a magnet for price. Pair vpPoc with vpPocVolume to gauge how dominant that level is.
Read Delta for Pressure
vpDelta summarizes net aggressor flow per bar. Sustained positive delta signals buy-side control; sustained negative delta signals sell-side control.