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
mangiaragni Buongiorno io non riesco a visualizzare nessun tipo di volume , mi torna sempre una linea dr...
Nicolas Assicurati che lo strumento che stai guardando abbia dei volumi! È il caso?
Carlos Garcia If price tags the lower BBand, look for IIIX has positive values to enter a trade. Converse...
Thally Thanks for the quick response Nicholas. Would you have any idea how to resolve. Manually ref...
Thally Do you think adjusting the below code might help? newperiod = minuteminute[1] if newperi...
Nicolas There is no "second" instruction.
YvesRobert Merci beaucoup Nicolas. Existe t'il un petit programme qui permet de tracer sur la graphe en...
Nicolas Oui il y a celui ci: https://market.prorealcode.com/product/prt-renko/?lang=fr
YvesRobert Bonjour Nicolas, j'ai une question technique à te poser. Je visualise souvent le cours en RE...
GenesisEX Thank you all for your contributions this is a great submission. Thanks for your inputs.
tino Bonjour nicolas. Je ne parviens pas à recopier le screener de l'indicateur. Auriez vous la g...
Nicolas Quel screener svp? C'est dans un des sujets du forum? Merci de fournir le lien.
gabri Ha ragione in computer, ho sbagliato io BullAD = summation[period](ADvolbull*((Close-Low) –...
marcov66 Perfetto! Funziona. Grazie di tutto!
SkrHugo Bonjour, J'essaye d'utiliser le script avec le graphique renko mais sa ne marche pas, quelq...
Tonicejudo Hola Nicolas, a ver si me puedes ayudar. Hay un indicador que se llama volumen stop de bolsa...
Nicolas Utilice los foros para hacer preguntas no relacionadas con la página actual ...
Alai-n I also have the same problem that I can not solve especially on LowVolume (Yellow) ... Sorry
Mert No need to apologise, my friend. It is great code. I hope you find a solution soon. Regards.
gabri I think it's because the lookback period changes at every new bar and that means that many c...
MaoRai54 Hi, first of all Happy New Year. Well, I've inserted your indicator in DAX 1h but I cann...
Vinks_o_7 Hi Mao Happy New Year ! This is just an improved RSI where you plot a standard price momen...
Giuseppe68 ciao, ho provato l'indicatore e mi sembra interessante, ma in fase di backtest non riesco ad...
poldoposta veramente bello.....complimenti
rb-72 Thank you, area of twist by dilatacion of the price, missing part of the code that is not pu...
Thomas007 after reading your blog now I understand why there is only a part of your code here. I'm try...
Juanjo Hola¡¡ la estrategia se podria aplicar sobre acciones con marco temporal diario?? gracias.
rb-72 5 Minutes, 15 Minutes, The most effective 1 Hour below 0 or above 0 as a turn signal in the ...
Andraxx Interpretación de el indicador??? Gracias
TAC Bolsa Oscilador que hace una medición ponderara basado en la distancia entre precio y una media Mó...
Nicolas Better to download the file from the page and import it into your platform in order to not c...
marcov66 Hi Nicolas, thanks for sharing the VWAP Date Indicator. It is really powerful. Nevertheless,...
Nicolas Are you sure you are using the same exact date, hours, minutes, seconds for anchor?
julien1978 changing the trendDetectionLength setting does not seem to have any effect on the wave calcu...
arran i can't seem to get this indicator to work on forex pairs. it works great on indices etc. An...
Nicolas Indicator needs Volume, and there are no volumes with forex pairs with IG.
Trading_En_El_Ibex35 El screener no busca acciones que estén en máximos absolutos , busca acciones en las que el...
Andraxx lo de volumen aceptable, lo dices en relación al Ibex 35 supongo. Porque se margen de volume...
Juanjo Hola Queria preguntarte si la idea de maximos anuales es tuya, o bien está basada en el sis...
BERTJES82 Hi Nicolas, is it possible to adjust the starting date of the VWAP on the charts? Thanks in ...
Nicolas Yes, have a look there: https://www.prorealcode.com/prorealtime-indicators/vwap-date-anchored/
Dadoo Merci Nicolas!
Thomas007 Is there any way to build something similar for FX? I wonder what would be the replacement f...

Top