In this study, rather than using for the calculation, the Dual Divergence Index oscillator is utilized.
First, the DVDI oscillator is calculated by taking the difference between PVI and its , and and its , then taking the difference between the two results.
Optional parameters for DVDI calculation are included within this script:
- An option to use tick rather than real for the source
- An option to use cumulative data, which sums the movements of the oscillator from the beginning to the end of TradingView's maximum window to give a more broad picture of market sentiment
Next, two trailing levels are calculated using the of the oscillator. The levels are then used to determine wave direction.
Lastly, rather than using 0 as the center line, it is instead calculated by taking a cumulative average of the oscillator.
Custom bar colors are included.
Note: For charts that have no real component, use tick as the source.
Migrated from pine v2 to v3. Adjusted the equations accordingly.
Changed default smoothing period to 6.