OPEN-SOURCE SCRIPT

Cumulative Volume Profile Delta

145
This indicator calculates the Cumulative Volume Profile Delta (CVPD). It constructs a high-resolution volume profile for each bar using intra-bar data, then derives and accumulates the delta from that profile to show net buying/selling pressure.

Key Features:

Statistical Volume Profile Engine: For each bar, the indicator builds a high-resolution volume profile on a lower 'Intra-Bar Timeframe'. Instead of simple tick counting, it uses statistical models ('PDF' allocation) to distribute volume across price levels and advanced classifiers ('Dynamic' split) to determine the buy/sell pressure before accumulation.

Periodic Accumulation: The CVPD accumulation is anchored to a user-defined 'Anchor Timeframe' (e.g., daily, weekly). This cyclical reset allows to analyze the build-up of pressure within specific trading periods.

"Delta Candle" Visualization: The periodic CVPD is shown as a candle, where:

Open: The CVPD value at the start of the period (or zero).

High/Low: Represent the peak buying (CVD High) and selling (CVD Low) pressure within that period's profile.

Close: The final net delta value (CVD) for the period.

Dual CVD & Divergence Engine: The indicator calculates two CVPDs: a Periodic one (for plotting) and a Continuous one (non-resetting). The continuous line is used as a stable source for the built-in divergence engine (detecting Regular, Hidden, and Exaggerated).

Dynamic Divergence Plotting: Divergence markers are plotted relative to the periodic (candle) CVPD. They automatically adjust their vertical position after a reset to remain visually aligned with the plotted candles.

Note on Confirmation (Lag): Divergence signals rely on a pivot confirmation method to ensure they do not repaint.

The Start of a- divergence is only detected after the confirming pivot is fully formed (a delay based on Pivot Right Bars).

The End of a divergence is detected either instantly (if the signal is invalidated by price action) or with a delay (when a new, non-divergent pivot is confirmed).

Multi-Timeframe (MTF) Capability:

MTF Output: The entire analysis (Delta Candles, Divergences) can be calculated on a higher timeframe (using the Timeframe input), with standard options to handle gaps (Fill Gaps) and prevent repainting (Wait for...).

Limitation: The Divergence detection engine (pivDiv) is disabled if a Higher Timeframe (HTF) is selected.

Integrated Alerts: Includes 18 comprehensive alerts for:

The start and end of all 6 divergence types.

The periodic CVPD crossing the zero line.

Conditions of agreement or disagreement between the delta and the main bar's direction.

Caution: Real-Time Data Behavior (Intra-Bar Repainting) This indicator uses high-resolution intra-bar data. As a result, the values on the current, unclosed bar (the real-time bar) will update dynamically as new intra-bar data arrives. This behavior is normal and necessary for this type of analysis. Signals should only be considered final after the main chart bar has closed.

DISCLAIMER

For Informational/Educational Use Only: This indicator is provided for informational and educational purposes only. It does not constitute financial, investment, or trading advice, nor is it a recommendation to buy or sell any asset.

Use at Your Own Risk: All trading decisions you make based on the information or signals generated by this indicator are made solely at your own risk.

No Guarantee of Performance: Past performance is not an indicator of future results. The author makes no guarantee regarding the accuracy of the signals or future profitability.

No Liability: The author shall not be held liable for any financial losses or damages incurred directly or indirectly from the use of this indicator.

Signals Are Not Recommendations: The alerts and visual signals (e.Example: crossovers) generated by this tool are not direct recommendations to buy or sell. They are technical observations for your own analysis and consideration.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน