Dual Volume Divergence Line (DVD/Line)

Dual Volume Divergence Line (DVD/Line)

1. Introduction

The Dual Volume Divergence Line (DVD/Line) is a sophisticated technical analysis tool designed to detect divergences between price and volume using two complementary volume indexes: the Positive Volume Index (PVI) and the Negative Volume Index (NVI). Its main goal is to provide early signals of potential trend reversals by analyzing volume behavior.

In addition to plotting a combined divergence line (DVD), the indicator also draws dynamic bands and labels bullish and bearish divergences — both regular and hidden — directly on the chart. This makes it a powerful visual aid for identifying trading opportunities.

2. Indicator Foundation

The calculation starts with a typical price, obtained as the average of the high, low, and close for each bar. Based on this input, two indices are constructed:

  • PVI (Positive Volume Index): Accumulates the typical price increase when the current bar closes higher than the previous one.
  • NVI (Negative Volume Index): Accumulates the typical price decrease when the current bar closes lower than the previous one.

Both indexes are smoothed using a weighted average, and their divergence from price is calculated. The difference between the PVI and NVI divergences forms the basis of the DVD Line, which reflects the directional pressure of volume.

This DVD Line is further compared to a linear regression to visually detect potential momentum shifts.

3. Calculation and Components

Customizable Parameters

  • zaman: Sampling period for smoothing PVI/NVI (default: 17).
  • genislik: Width for smoothing and band projection (default: 12).
  • takip: Length for linear regression (default: 3).
  • carpan: Multiplier to adjust indicator sensitivity.
  • gosterBand: Toggle band visualization.
  • gosterNormal: Show regular divergences (on/off).
  • gosterGizli: Show hidden divergences (on/off).
  • Ir: Divergence detection range.
  • Ntype: Choose raw (Dvdi) or smoothed (DVD) data for divergence detection.

Main Calculations

  • PVI & NVI Divergences: Computed by subtracting their respective weighted averages from the current value.
  • DVD Line (Dvdi): The difference between PVI and NVI divergences, multiplied by a factor.
  • Smoothed DVD (DVD): Weighted average of Dvdi added to the typical price.
  • Regression Line (DVD2): A linear regression of the DVD, used for conditional coloring.

Dynamic Bands

Upper and lower bands are calculated using the Root Mean Square (RMS) of the highest and lowest DVD values over the smoothing window. These bands act as dynamic zones to evaluate extreme conditions and are rescaled to highlight outliers.

4. Divergence Detection

The indicator identifies two main types of divergences:

  • Regular Divergences: Price makes a new high/low, but the oscillator does not confirm it.
  • Hidden Divergences: Price does not make a new high/low, but the oscillator does.

Divergences are detected by locating pivot points in both price and the selected oscillator (IrGo). When a new pivot is formed, it is compared to the previous one, and if a divergence condition is met, the appropriate label is drawn:

  • "Bull" for regular bullish divergence.
  • "hid.Bull" for hidden bullish divergence.
  • "Bear" for regular bearish divergence.
  • "hid.Bear" for hidden bearish divergence.

All labels are offset using ATR to avoid overlapping with price bars.

5. How to Interpret the Indicator

  • DVD Line: Represents volume directional strength. Rising above its regression line (DVD2) suggests bullish pressure, while falling below it indicates bearish momentum.
  • Bands: Function as dynamic overbought and oversold levels. Crosses or rejections around these levels can signal potential reversals.
  • Divergences: Serve as advanced warning signals, especially effective near key support or resistance zones.

The indicator works well across different timeframes, making it suitable for scalpers, intraday traders, and swing traders alike.

6. Indicator Settings

Here’s a breakdown of each adjustable parameter:

  • zaman (Sampling Period): Controls signal sensitivity. Lower values yield more signals but may be noisier.
  • genislik (Band Width): Affects smoothing degree. Higher values result in smoother lines.
  • takip (Trailing Length): Number of bars for linear regression, used for coloring the DVD Line.
  • carpan (Multiplier): Adjusts how strongly PVI and NVI divergences influence the DVD Line.
  • gosterBand: Enables/disables band visualization.
  • gosterNormal and gosterGizli: Toggle the display of regular and hidden divergences.
  • Ir: Sets the pivot detection range; higher values result in fewer but stronger signals.
  • Ntype: Allows switching between raw (Dvdi) and smoothed (DVD) divergence sources.

It is recommended to test different configurations based on the asset and timeframe to optimize the indicator’s performance.

7. Indicator Code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or

Likes

avatar avatar
Related users ' posts
Iván
4 months ago
foufurieux
7 months ago
ANTS indicator
ANTS indicator
3
Indicators
atlante good morning the indicatordoes not display the photo you postes only upload nessages appear ...
foufurieux Please find a new image of the indicator
foufurieux Sorry impossible adding a new image
oliTR Very good Iván ! However what would be the modification to add to the code in order to dis...
MARTINALA CARTINA grazie mille magnifico,si in effetti se ci fosse la possibilta di impostare orai predefiniti...
effegi Very good! A nice job
Iván
1 year ago
oliTR Yes, I am sure it should work perfectly, but I found very strange vehavior like this one: ...
oliTR well, it seems that the issue came from my backTest period which was not long enough. sorry
oliTR Dear Ivan, why, in line 86, there is "currentsuperTrend[i]" and not "currentsuperTrend" only?
Razz Bonjour Je pense que votre indicateur est très bon. Serait-il possible d'afficher la heatma...
philippe59139 if marketEtHeamap=1 then drawtext("#touch#",barindex+10,checkprice,SansSerif,Standard,10) c...
philippe59139 voici pour toi RAZZ il te faut simplement ajouter les drawtext https://www.prorealcode.com...
JS
2 years ago
luxrun
2 years ago
steffen_burat Hello Nicolas, I have a cumulative histogram update problem, the indicator often updates ...
taklause Hello Nicolas, if I try to use your indicator in a trading system, the error on prc pops up ...
Gio56 Bonjour Nicolas J'ai le meme souci que steffen , l'indicateur ne cumule qu'après avoir redé...
Rafa Hi Nicolas! I can´t install this indicator. it installs in a separate window not as an av...
Nicolas Add it on the price, see how: https://www.prorealcode.com/blog/video-tutorials/how-to-add-an...
Frankyslo1 No consigo instalarlo en el precio en PRL-version 10
Khaled As this section of the forum is in English, I'll reply in English. I'm using PRT v11, so I d...
sal157011 Don't understand where it says: "Volume Pressure Histogram: Columns plotted in positive are ...
Khaled Not sure to understand the question. However, the columns (Histogram) represent the variable...
Alai-n Cela fonctionne très bien !!! Super Merci
andreabarbuscia Ciao Nicolas, molto bello questo indicatore, l'ho apprezzato molto. Lo sto testando insieme...
Alai-n Je poste ici un lien afin de mieux appréhender le CVD-Cumulative Volume Delta : https://www....
Nicolas
3 years ago
DELBERT Bonsoir , Nicolas , j'ai transféré votre indicateur sur ma PRT 10,3 et j'ai un méssage d'ére...
Nicolas Vous pouvez essayer en remplacant la ligne avec: vwapsd = sqrt(average[lengthz](square(clo...
DELBERT Bonsoir , merci Nicolas , a bientôt .
robertogozzi An updated version can be found here https://www.prorealcode.com/topic/conversion-of-pine-sc...
jissey Bonjour Robertogozzi, cet indicateur est interessant mais serait-il possible de marquer la ...
robertogozzi Sure, but you should start a new topic on the Probuilder support forum. Thank you :)
ChemaGeek Bonjour Nicolas, j'ai récemment découvert cet indicateur (Regularized Momentum 2017) et je l...
YvesRobert Bonjour, nouveau sur PRT (qq jours), j'essaie un peu de voir quel type d'indicateur me convi...
Ichimoku Reading I don't know in this case, I just downloaded it again and no problem for me. Try to downloa...
Ichimoku Reading What's the error that appears ?
Suzu Yuk Yes, it worked with 1Tick with 200 K . Thank you very much.

Top