OPEN-SOURCE SCRIPT

Trailing Cumulative Volume Delta

146
Short Description:
A dynamic volume delta indicator that calculates a trailing sum of net buying/selling pressure over a user-defined number of recent bars, offering a more adaptive view of order flow momentum compared to fixed-anchor CVD.

Overview:

The Trailing Cumulative Volume Delta (TCVD) indicator provides a powerful way to analyze market sentiment by tracking the net difference between buying and selling volume. Unlike traditional Cumulative Volume Delta (CVD) indicators that typically reset at fixed intervals (e.g., daily, weekly), the TCVD calculates a rolling sum of volume delta over a specified number of recent bars. This "trailing" approach offers a more fluid and responsive measure of recent order flow dynamics.

How it Works:

Per-Bar Delta Calculation: For each bar on your chart, the indicator first calculates the net Volume Delta. This is done by looking at a finer, user-configurable Lower Timeframe (e.g., 1-minute data for a 15-minute chart bar) to determine the aggressive buying vs. selling volume within that bar.

Trailing Sum: The indicator then sums these individual per-bar net deltas over a user-defined Trailing Bars lookback period. For example, if "Trailing Bars" is set to 20, the TCVD value will represent the cumulative net delta of the last 20 bars.

Visualization:

The TCVD is plotted in a "MACD-Columns-Style" in a separate pane.

Teal: When the TCVD value is increasing (suggesting growing net buying pressure or diminishing net selling pressure over the trailing period).

Red: When the TCVD value is decreasing (suggesting growing net selling pressure or diminishing net buying pressure over the trailing period).

White: When it is returning to the mean.


How to Interpret and Use TCVD:

Trend Strength & Momentum:

A rising TCVD suggests that, on average over the trailing period, buying pressure is dominant or strengthening. This can confirm bullish price action or indicate underlying strength.

A falling TCVD suggests that selling pressure is dominant or strengthening, potentially confirming bearish price action or indicating weakness.

Divergences:

Unlike other Divergences, the CVD has two different types of Divergences: a) Absorption and b) Exhaustion. You only want to trade the Absorption pattern.

Zero Line Crossovers:

TCVD crossing above the zero line can indicate a shift towards net positive buying pressure over the lookback period.

TCVD crossing below the zero line can indicate a shift towards net positive selling pressure.

Confirmation: Use TCVD to confirm breakouts or breakdowns. A price breakout accompanied by a strongly rising TCVD is generally more reliable.

Key Settings:

Trailing Bars: (Default: 10)

Determines the number of recent bars to include in the cumulative delta sum.

Shorter periods make the TCVD more responsive to immediate changes.

Longer periods provide a smoother, longer-term view of order flow.

Use custom timeframe: (Checkbox, Default: false)

Allows you to override the automatic selection of the lower timeframe for delta calculation.

Timeframe for Delta Calculation: (Default: "1" - 1 minute)

Specifies the lower timeframe data used to calculate the volume delta for each individual chart bar.

Choosing a very fine timeframe (e.g., seconds) can provide high precision but may be limited by data availability or processing load.

If "Use custom timeframe" is unchecked, the script attempts to choose a sensible default based on your chart's timeframe (e.g., "1S" for second charts, "1" for intraday, "5" for daily, "60" for weekly+).

Examples:

Confirming Breakout Strength:

Price breaks out above a significant resistance level.

If the TCVD is also sharply rising and has perhaps crossed above its zero line, it provides confirmation that strong buying interest is fueling the breakout, increasing confidence in its validity.

Important Notes:

This indicator requires reliable volume data from your broker/data feed to function correctly. If your chart does not have volume, or if the volume data is unreliable, the TCVD will not be accurate.

Like all indicators, TCVD is best used as part of a comprehensive trading strategy, in conjunction with price action analysis and other indicators or tools.

Experiment with the Trailing Bars and Timeframe for Delta Calculation settings to find what best suits your trading style, the asset you are analyzing, and the chart timeframe you are using.

Feel free to modify this, add your personal touch, or include specific screenshots when you publish!

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.