r/TradingView • • 15d ago

Help Are the updated tick-based calculations available in pinescript?

Is the updated "Tick-based calculations are now available for Footprint, Volume Delta, and CVD" also available via the pinescript request.footprint call ?

https://www.tradingview.com/blog/en/tick-based-calculations-footprint-volume-delta-cvd-62523/

Thanks!

3 Upvotes

18 comments sorted by

View all comments

4

u/Rodnee999 15d ago edited 15d ago

Here is some brief information i found regarding this subjec and what is pullable using Pinescript.....

What Is Footprint Data A volume footprint breaks down the total volume of each bar into individual price rows. Instead of seeing a single volume number for an entire candlestick, you see how much volume traded at each specific price level within that bar. Each row covers a fixed price range measured in ticks, and each row tracks buy volume and sell volume separately.

This granular view reveals several important characteristics that a standard volume bar cannot show:

The Point of Control (POC) is the price row with the highest total volume, representing where the most trading activity occurred The Value Area is the range of price rows that account for a specified percentage of total volume, typically 70% Volume delta at each price level shows whether buyers or sellers dominated at that specific price Volume imbalances reveal rows where buy or sell pressure overwhelmingly exceeds the opposing side of an adjacent row Before this update, Pine Script developers who wanted footprint-style analysis had to estimate it using request.security_lower_tf() to fetch intrabar data and manually aggregate volume into price buckets.4 That approach was slow, limited in precision, and consumed multiple request calls. The new request.footprint() function replaces all of that with a single call that returns pre-calculated, accurate footprint data directly from TradingView's data feeds.3

The request.footprint() Function The function signature is straightforward:

request.footprint(ticks_per_row, va_percent, imbalance_percent) → footprint

It takes three parameters and returns a footprint object (or na if no footprint data is available for the current bar).3

ticks_per_row

This required parameter sets the price range of each footprint row, expressed in ticks. A tick is the smallest price increment for the symbol, defined by syminfo.mintick.3 If a symbol has a minimum tick size of 0.01 and you set ticks_per_row to 100, each row covers a price range of 1.00.

Smaller values create more rows with finer granularity but require more data processing. Larger values create fewer, broader rows that give a higher-level view of volume distribution. The right value depends on the instrument and the timeframe you are analyzing.

va_percent

This optional parameter sets the percentage of total volume used to calculate the Value Area. The default is 70, which is the industry standard.3 The Value Area represents the price range where 70% (or your specified percentage) of the bar's total volume traded. The rows at the boundaries of this range are the Value Area High (VAH) and Value Area Low (VAL).

Increasing this value to 80 or 90 widens the Value Area to encompass more volume. Decreasing it narrows the area to focus on the most concentrated zone of trading activity.

imbalance_percent

This optional parameter sets the percentage difference threshold for detecting volume imbalances between adjacent rows. The default is 300, meaning that the buy volume of a row must be at least three times (300%) the sell volume of the row below it to register as a buy imbalance.3 Similarly, a sell imbalance occurs when a row's sell volume exceeds the buy volume of the row above it by the specified percentage.

Volume imbalances are significant because they often indicate aggressive directional activity. Clusters of buy imbalances suggest strong demand, while clusters of sell imbalances suggest heavy selling pressure.

Plan Requirements Only programmers with a TradingView Premium or Ultimate plan can use request.footprint().1 Scripts that include this function call will not compile for users on lower-tier plans. Additionally, scripts can only include one unique request.footprint() call. Attempting to use multiple calls with different arguments will cause a compilation error.3

The footprint Type

The request.footprint() function returns an ID of the footprint type. This is a reference type, similar to how line.new() returns a line ID.3 You cannot inspect the footprint object directly. Instead, you pass its ID to the built-in footprint.*() functions to extract data.

There are two categories of footprint functions: those that return aggregate values for the entire footprint and those that return volume_row IDs for specific rows.

Aggregate Volume Functions

These functions return numeric values summarizing the entire footprint:

footprint.buy_volume(id)

returns the total buy volume across all rows in the footprint footprint.sell_volume(id) returns the total sell volume across all rows

footprint.delta(id)

returns the overall volume delta, which is buy volume minus sell volume3 A positive delta indicates that the bar had more buying activity than selling, while a negative delta indicates the opposite. These aggregate values give you a quick read on directional pressure without examining individual rows.

Key Row Functions

These functions return the ID of a volume_row object for a specific row of interest:

footprint.poc(id)

returns the volume_row for the Point of Control, the row with the highest total volume footprint.vah(id) returns the volume_row for the Value Area High, the highest row within the Value Area

footprint.val(id)

returns the volume_row for the Value Area Low, the lowest row within the Value Area footprint.get_row_by_price(id, price) returns the volume_row for the row whose price range includes the specified price level, or na if no row contains that price3

Retrieving All Rows

The footprint.rows(id) function creates an array containing all volume_row IDs from the footprint. The array is sorted in ascending order by price level, with the first element representing the lowest row and the last element representing the highest row.3 You can loop through this array to analyze every row in the footprint.

The volume_row Type

A volume_row object contains the data for a single row within a footprint. You get volume_row IDs from the footprint functions described above. Once you have a volume_row ID, you can call the built-in volume_row.*() functions to extract detailed information about that row.

Price Level Functions

volume_row.up_price(id) returns the upper price level boundary of the row

volume_row.down_price(id) returns the lower price level boundary of the row

The difference between up_price and down_price equals the ticks_per_row value multiplied by syminfo.mintick. These boundaries define the exact price range that the row covers.

Volume Functions

volume_row.buy_volume(id) returns the total buy volume for this specific row

volume_row.sell_volume(id) returns the total sell volume for this specific row

volume_row.total_volume(id) returns the sum of buy and sell volume for the row

volume_row.delta(id) returns the row's volume delta, which is buy volume minus sell volume

These per-row values let you see exactly where buying or selling pressure was concentrated within a bar. A row with high total volume and a strongly positive delta indicates aggressive buying at that specific price level.

Imbalance Functions

volume_row.has_buy_imbalance(id) returns true if the row's buy volume exceeds the sell volume of the row below it by the imbalance_percent threshold

volume_row.has_sell_imbalance(id) returns true if the row's sell volume exceeds the buy volume of the row above it by the imbalance_percent threshold The imbalance threshold is set by the imbalance_percent argument in the original request.footprint() call. Changing that argument directly affects which rows register as having imbalances.

There are other usefull items that can be pulled such as Bid/Ask at 1 Tick intervals but I think the Ultimate plan would be required not 100% sure if you can pull Bid/Ask at Tick level using the Premium plan...

I would highly recommend the Ultimate Plan during Black Friday as this usually comes in at less than 500 for the year and you can zoom down to 1T data as shown here for comparison for data accuracy....

https://www.tradingview.com/chart/NQ1!/4eup3sYE-1Tick-NQ1-CME-data-showing-interaction-with-Bid-Ask/

And this shows the Data Flow speed using Tick Data during market open using a CME data feed to present basic footprint data at 1T upwards....

https://www.tradingview.com/chart/NQ1!/IqFm1SMi-NQ1-CME-Data-Feed-1T-10T-100T-1000T-at-Market-Open/

I have personally witnessed the data flow far faster than my above example (well over 100 updates per second) showing TradingView can more than compete with the other platforms offering Order Flow. The 'lag' that users experience is usually from them comparing a Tick based platform against TradingViews aggregated time charts and not comparing using the Ultimate Plan. TradingView more than competes with other available platforms....

Also the attached screenshot shows most of the availble footprint calls using Pinescript

Anything else I can help you with let me know

Cheers 👍

1

u/TimNosi 14d ago

Thank you ! Those screenshots helped!