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 avatar
Related users ' posts
Jean-Pierre Poulain When I buy and when I sell ?
Nicolas The featured image of the post do not deserve the indicator you are right, I attached other ...
Nicolas It is described in the post already :) The BUY/SELL signals are quite similar of what you ca...
Nicolas
8 years ago
jiminykricket Hi Nicolas, Its fair to say i'm a relative novice with ProRealtime and as such i am not sur...
Nicolas You can use assisted creation in probacktest, you'll get a quick overview on how to call a p...
jiminykricket Thanks Nicolas, i'll take a look
bolsatrilera
8 years ago
Volume Stops
v10.3
Volume Stops
6
Indicators
Aragorna Hello, ask for a help, please. why the indicator in my PRT is in a different area and not in...
Nicolas Add it on the price chart: https://www.prorealcode.com/blog/video-tutorials/how-to-add-an-in...
Infanta Congratulations. Of all the indicators that I have been able to examine, in my opinion and f...
Nicolas
8 years ago
Voluminator
Voluminator
0
Indicators
Nicolas
9 years ago
Nicolas Sure, please open a new topic in the probuilder forum with all specifications needed.
toni1750 Hola, funciona en P11? lo he puesto y no me sale como en la imagen. gracias.
GustavoLoboOrenstein Hello Nicolas, I have a cumulative histogram update problem, the indicator often updates ...
Nicolas That's right, in ProScreener we can't have a lookback more than 254 days. There is nothing w...
cjdevasia Hi, Nicolas,     please guide me how can i scan following conditions in pro real time  S...
Nicolas For everyone benefit, I prefer to answer coding request in the forum. Please open a new topi...
Nicolas Thanks for contributing to the "ichimoku section" of the prorealtime code library Don't he...
sourberry Thank you , this is a great indicator works beautifully. Could you kindly modify to scr...
pp_playaflamenca Excuse me,... reading your code about spanB: [ SenkouSpanBFutureW = (Highest[SenkouSpanPerio...
Nicolas
9 years ago
Better Volume
Better Volume
39
Indicators
Keyeming Hello Nicolas; not sure to undersntad line 167, and in the video I d'ont remember that the a...
Nicolas I don't know, this code is 6 years old and I made a 1:1 translation of the provided code by ...
Alai-n https://emini-watch.com/free-stuff/volume-indicator/
Nicolas
9 years ago
Nicolas You will find the VWAP code from PRT here: https://www.prorealcode.com/topic/is-there-any-wo...
keks Thanks for sharing this wonderful code. Is there a way to draw a horizontal line to plot pre...
taklause Hello, just one question, can it be that this indicator does not work on ProRealTime v12? T...
Nicolas
10 years ago
Up on Big Volume
Up on Big Volume
0
Screeners
Nicolas
10 years ago
Nicolas
10 years ago
Nicolas
10 years ago
Nicolas Just replace the last line with this : RETURN dm as "Volume Weighted MACD", masignal as "Si...
thomas2004ch I happen to read this article. I would say the formel 'd = maslow - mafast' could be inverse...
Nicolas You are right! but still the picture is looking good. The formula is inverted! dunno why :) ...

Top