OPEN-SOURCE SCRIPT
Volume Delta Oscillator with Divergence

█ OVERVIEW
The Volume Delta Oscillator with Divergence is a technical indicator designed for the TradingView platform, helping traders identify potential trend reversal points and market momentum shifts through volume delta analysis and divergence detection. The indicator combines a smoothed volume delta oscillator with moving average-based signals, overbought/oversold levels, and divergence visualization, enhanced by configurable gradients and alerts for quick decision-making.
█ CONCEPT
The core idea of the indicator is to measure net buying or selling pressure through volume delta, smooth it for greater clarity, and detect divergences between price action and the oscillator. The indicator does not use external data, making it a compromise but practical tool for analyzing market dynamics based on available price and volume data. It provides insights into market dynamics, overbought/oversold conditions, and potential reversal points, with an attractive visual presentation.
█ WHY USE IT?
- Divergence detection: Identifies bullish and bearish divergences between price and the oscillator, signaling potential reversals.
- Volume delta analysis: Measures cumulative volume delta to assess buying/selling pressure, expressed as a percentage for cross-market comparability.
- Signal generation: Creates buy/sell signals based on overbought/oversold level crossovers, zero line crossovers, and moving average zero line crossovers.
- Visual clarity: Uses gradients, fills, and dynamic colors for intuitive chart analysis.
- Flexibility: Numerous settings allow adaptation to various markets (e.g., forex, crypto, stocks) and trading strategies.
█ HOW IT WORKS?
- Volume delta calculation: Computes net buying/selling pressure per candle as volume * (close - open) / (high - low), aggregated over a specified period (Cumulative Delta Length).
- Smoothing: Applies an EMA (Smoothing Length) to the cumulative delta percentage, creating a smoother oscillator (Delta Oscillator).
- Moving Average: Calculates an SMA (Moving Average Length) of the smoothed delta for trend confirmation (Moving Average (SMA)).
- Divergence detection: Identifies bullish and bearish divergences by comparing price and oscillator pivot highs/lows within a specified range (Pivot Length).
- Normalization: Delta is expressed as a percentage of total volume, ensuring consistency across instruments and timeframes.
- Signals: Generates signals for:
Crossing the oversold level upward (buy) or overbought level downward (sell).
Crossing the zero line by the oscillator or moving average (buy/sell).
Bullish/bearish divergences, marked with labels.
- Visualization: Draws the oscillator and moving average with dynamic colors, gradient fills, and transparent bands and labels, with configurable overbought/oversold levels.
- Alerts: Built-in alerts for divergence detection, overbought/oversold crossovers, and zero line crossovers (both oscillator and moving average).
█ SETTINGS AND CUSTOMIZATION
- Cumulative Delta Length: Period for aggregating volume delta (default: 14).
- Smoothing Length (EMA): EMA length for smoothing the delta oscillator (default: 2). Higher values smooth the signal but reduce the number of generated signals.
- Moving Average Length (SMA): SMA length for the moving average line (default: 40). Higher values allow SMA to be analyzed as a trend indicator, but require adjusting overbought/oversold levels for MA, as longer MA oscillates less.
- Pivot Length (Left/Right): Number of candles for detecting pivot highs/lows in divergence calculations (default: 2). Higher values can reduce noise but introduce a delay equal to the set value.
- Overbought/Oversold Levels: Thresholds for the oscillator (default: 18/-18) and for the moving average (default: 10/-10). For the moving average, no arrows appear; instead, the band changes color from gray to green (oversold) or red (overbought), which can strengthen entry signals for delta.
- Signal Type: Select signals to display: "Overbought/Oversold", "Zero Line", "MA Zero Line", "All", or "None" (default: Overbought/Oversold).
- Colors and gradients: Customize colors for bullish/bearish oscillator, moving average, zero line, overbought/oversold levels, and divergence labels.
- Transparency: Adjust gradient fill transparency (default: 70) and band/label transparency (default: 40) for consistent appearance.
- Visualizations: Enable/disable the moving average, gradients for zero/overbought/oversold levels, and gradient fills.
█ USAGE EXAMPLES
- Momentum analysis: Observe the delta oscillator above 0 for bullish momentum or below 0 for bearish momentum. The moving average (SMA), being smoothed, reacts more slowly and can confirm trend direction as a noise filter.
- Reversal signals: Look for buy triangles when the oscillator crosses the oversold level upward, especially when the moving average is below the MA oversold threshold. Similarly, look for sell triangles when crossing the overbought level downward, with the moving average above the MA overbought threshold. Divergence labels (bullish/bearish) indicate potential reversals.
- Divergence trading: Use bullish divergence labels (green) for potential buy opportunities and bearish labels (red) for sell opportunities, especially when confirmed by price action or other indicators.
- Customization: Adjust the cumulative delta length, smoothing, and moving average length to specific instruments and timeframes to minimize false signals.
█ NOTES FOR USERS
- Combine the indicator with other tools, such as Fibonacci levels, RSI, or pivot points, to increase accuracy.
- Test different settings for cumulative delta length, smoothing, and moving average length on your chosen instrument and timeframe to find optimal values.
The Volume Delta Oscillator with Divergence is a technical indicator designed for the TradingView platform, helping traders identify potential trend reversal points and market momentum shifts through volume delta analysis and divergence detection. The indicator combines a smoothed volume delta oscillator with moving average-based signals, overbought/oversold levels, and divergence visualization, enhanced by configurable gradients and alerts for quick decision-making.
█ CONCEPT
The core idea of the indicator is to measure net buying or selling pressure through volume delta, smooth it for greater clarity, and detect divergences between price action and the oscillator. The indicator does not use external data, making it a compromise but practical tool for analyzing market dynamics based on available price and volume data. It provides insights into market dynamics, overbought/oversold conditions, and potential reversal points, with an attractive visual presentation.
█ WHY USE IT?
- Divergence detection: Identifies bullish and bearish divergences between price and the oscillator, signaling potential reversals.
- Volume delta analysis: Measures cumulative volume delta to assess buying/selling pressure, expressed as a percentage for cross-market comparability.
- Signal generation: Creates buy/sell signals based on overbought/oversold level crossovers, zero line crossovers, and moving average zero line crossovers.
- Visual clarity: Uses gradients, fills, and dynamic colors for intuitive chart analysis.
- Flexibility: Numerous settings allow adaptation to various markets (e.g., forex, crypto, stocks) and trading strategies.
█ HOW IT WORKS?
- Volume delta calculation: Computes net buying/selling pressure per candle as volume * (close - open) / (high - low), aggregated over a specified period (Cumulative Delta Length).
- Smoothing: Applies an EMA (Smoothing Length) to the cumulative delta percentage, creating a smoother oscillator (Delta Oscillator).
- Moving Average: Calculates an SMA (Moving Average Length) of the smoothed delta for trend confirmation (Moving Average (SMA)).
- Divergence detection: Identifies bullish and bearish divergences by comparing price and oscillator pivot highs/lows within a specified range (Pivot Length).
- Normalization: Delta is expressed as a percentage of total volume, ensuring consistency across instruments and timeframes.
- Signals: Generates signals for:
Crossing the oversold level upward (buy) or overbought level downward (sell).
Crossing the zero line by the oscillator or moving average (buy/sell).
Bullish/bearish divergences, marked with labels.
- Visualization: Draws the oscillator and moving average with dynamic colors, gradient fills, and transparent bands and labels, with configurable overbought/oversold levels.
- Alerts: Built-in alerts for divergence detection, overbought/oversold crossovers, and zero line crossovers (both oscillator and moving average).
█ SETTINGS AND CUSTOMIZATION
- Cumulative Delta Length: Period for aggregating volume delta (default: 14).
- Smoothing Length (EMA): EMA length for smoothing the delta oscillator (default: 2). Higher values smooth the signal but reduce the number of generated signals.
- Moving Average Length (SMA): SMA length for the moving average line (default: 40). Higher values allow SMA to be analyzed as a trend indicator, but require adjusting overbought/oversold levels for MA, as longer MA oscillates less.
- Pivot Length (Left/Right): Number of candles for detecting pivot highs/lows in divergence calculations (default: 2). Higher values can reduce noise but introduce a delay equal to the set value.
- Overbought/Oversold Levels: Thresholds for the oscillator (default: 18/-18) and for the moving average (default: 10/-10). For the moving average, no arrows appear; instead, the band changes color from gray to green (oversold) or red (overbought), which can strengthen entry signals for delta.
- Signal Type: Select signals to display: "Overbought/Oversold", "Zero Line", "MA Zero Line", "All", or "None" (default: Overbought/Oversold).
- Colors and gradients: Customize colors for bullish/bearish oscillator, moving average, zero line, overbought/oversold levels, and divergence labels.
- Transparency: Adjust gradient fill transparency (default: 70) and band/label transparency (default: 40) for consistent appearance.
- Visualizations: Enable/disable the moving average, gradients for zero/overbought/oversold levels, and gradient fills.
█ USAGE EXAMPLES
- Momentum analysis: Observe the delta oscillator above 0 for bullish momentum or below 0 for bearish momentum. The moving average (SMA), being smoothed, reacts more slowly and can confirm trend direction as a noise filter.
- Reversal signals: Look for buy triangles when the oscillator crosses the oversold level upward, especially when the moving average is below the MA oversold threshold. Similarly, look for sell triangles when crossing the overbought level downward, with the moving average above the MA overbought threshold. Divergence labels (bullish/bearish) indicate potential reversals.
- Divergence trading: Use bullish divergence labels (green) for potential buy opportunities and bearish labels (red) for sell opportunities, especially when confirmed by price action or other indicators.
- Customization: Adjust the cumulative delta length, smoothing, and moving average length to specific instruments and timeframes to minimize false signals.
█ NOTES FOR USERS
- Combine the indicator with other tools, such as Fibonacci levels, RSI, or pivot points, to increase accuracy.
- Test different settings for cumulative delta length, smoothing, and moving average length on your chosen instrument and timeframe to find optimal values.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.