OPEN-SOURCE SCRIPT

Divergence Confirmation System [JOAT]

1 733
Divergence Confirmation System [JOAT]

Introduction

The Divergence Confirmation System (DCS) is an advanced open-source multi-oscillator divergence detection indicator that combines RSI, MFI, Stochastic, MACD, CCI, and Stochastic RSI analysis to identify high-probability divergence setups through systematic pivot comparison and multi-oscillator confirmation. This indicator reveals when price action diverges from underlying momentum across six independent oscillators, providing traders with early warning signals of potential trend reversals or continuations through rigorous confirmation requirements.

Unlike basic divergence indicators that rely on a single oscillator, DCS employs a sophisticated 6-oscillator confirmation system that detects both regular divergences (trend reversal signals) and hidden divergences (trend continuation signals) across multiple momentum indicators. The indicator requires minimum oscillator confirmation (default 2/6) to filter false signals and provides divergence strength scoring based on oscillator count, volume confirmation, and price momentum.

스냅샷

Why This Indicator Exists

This indicator addresses the challenge of identifying reliable divergence signals in noisy market conditions. Single-oscillator divergences often produce false signals, but when multiple independent oscillators confirm the same divergence pattern, probability of successful reversal increases significantly. DCS systematically reveals:

  • 6-Oscillator Analysis: RSI, MFI, Stochastic, MACD, CCI, Stochastic RSI for comprehensive momentum assessment
  • Regular Divergence Detection: Price makes new high/low but oscillators don't confirm (reversal signal)
  • Hidden Divergence Detection: Price makes higher low/lower high but oscillators show opposite (continuation signal)
  • Multi-Oscillator Confirmation: Requires 2+ oscillators to agree before generating signal
  • Divergence Strength Scoring: 0-100% score based on oscillator count, volume, and momentum
  • Multi-Timeframe Divergence: Confirms divergences on higher timeframe for added conviction
  • Divergence Clustering: Detects multiple divergences in short period indicating strong reversal potential


Each component provides unique intelligence. Multiple oscillators reduce false signals, regular divergences show reversals, hidden divergences show continuations, strength scoring quantifies quality, MTF confirmation adds conviction, and clustering shows intensity.

Core Components Explained

1. Multi-Oscillator Divergence Detection System

DCS calculates six independent oscillators and detects divergences on each:

Pine Script®


Each oscillator provides independent momentum perspective. RSI shows price momentum, MFI adds volume weighting, Stochastic shows position in range, MACD shows trend momentum, CCI shows deviation from mean, and Stochastic RSI shows RSI momentum.

2. Regular Divergence Detection (Reversal Signals)

Regular bullish divergence occurs when price makes lower low but oscillator makes higher low:

Pine Script®


Regular bearish divergence occurs when price makes higher high but oscillator makes lower high. These signal potential trend reversals.

스냅샷

3. Hidden Divergence Detection (Continuation Signals)

Hidden bullish divergence occurs when price makes higher low but oscillator makes lower low:

Pine Script®


Hidden bearish divergence occurs when price makes lower high but oscillator makes higher high. These signal trend continuation after pullback.

4. Multi-Oscillator Confirmation Aggregation

DCS counts how many oscillators confirm each divergence type:

Pine Script®


Minimum oscillator requirement (default 2/6) filters false signals. Volume confirmation adds additional filter.

5. Divergence Strength Scoring System

Strength score (0-100%) calculated from multiple factors:

Pine Script®


Strength classification:
- 75-100%: Very Strong (highest probability)
- 60-74%: Strong (high probability)
- 40-59%: Moderate (medium probability)
- 0-39%: Weak (low probability)

6. Multi-Timeframe Divergence Confirmation

DCS checks for divergences on higher timeframe (default 15m):

Pine Script®


MTF confirmation significantly increases signal reliability.

스냅샷

7. Divergence Clustering Detection

Clustering identifies multiple divergences in short period:

Pine Script®


Clusters indicate strong reversal pressure building.

Visual Elements

  • Primary Oscillator Display: User-selectable (RSI/MFI/Stochastic/MACD) with gradient shadow effect
  • Reference Lines: 70 (overbought), 50 (midline), 30 (oversold)
  • Oscillator Histogram: Gradient-colored bars showing oscillator deviation from 50
  • Background Zones: Cyan for bullish divergence, red for bearish divergence
  • Divergence Labels: "BULL DIV" or "BEAR DIV" with oscillator count (e.g., "4/6")
  • Hidden Divergence Markers: Small "H" circles for hidden divergences
  • Elite Signals: Large labels for 4+ oscillator confirmation with strength >75%
  • MTF Confirmation: Triangle markers when higher timeframe confirms
  • Multi-Oscillator Confirmation: Labels showing oscillator count (e.g., "3/6 CONF")
  • Institutional Flow: "INST BUY/SELL" labels when delta confirms divergence


Input Parameters

Oscillator Settings:
  • RSI Period: RSI calculation period (default: 14)
  • MFI Period: MFI calculation period (default: 14)
  • Stochastic Period: Stochastic calculation period (default: 14)
  • MACD Fast: MACD fast EMA (default: 12)
  • MACD Slow: MACD slow EMA (default: 26)
  • MACD Signal: MACD signal line (default: 9)


Divergence Detection:
  • Pivot Left Bars: Bars to left of pivot (default: 5)
  • Pivot Right Bars: Bars to right of pivot (default: 2)
  • Detect Hidden Divergences: Toggle hidden divergence detection (default: true)
  • Max Pivot Distance: Maximum bars between pivots (default: 60)


Confirmation Rules:
  • Minimum Oscillator Confirmation: Required oscillators (default: 2/6)
  • Require Volume Confirmation: Toggle volume filter (default: false)


Visualization:
  • Show Divergence Lines: Toggle divergence line drawing (default: true)
  • Show Labels: Toggle divergence labels (default: true)
  • Primary Display: Select oscillator to display (RSI/MFI/Stochastic/MACD)


How to Use This Indicator

Step 1: Monitor Primary Oscillator
Watch selected oscillator (default RSI) for overbought/oversold conditions.

Step 2: Wait for Divergence Labels
"BULL DIV" or "BEAR DIV" labels appear when 2+ oscillators confirm divergence.

Step 3: Check Oscillator Count
Higher count = higher probability. 4/6 or better is ideal.

Step 4: Assess Divergence Strength
Tooltip shows strength percentage. >75% is very strong, >60% is strong.

Step 5: Confirm with MTF
Triangle markers indicate higher timeframe confirmation - highest probability setups.

Step 6: Watch for Elite Signals
Large "BULL DIV" or "BEAR DIV" labels with 4+ oscillators and >75% strength are highest conviction.

Best Practices

  • Focus on divergences with 3+ oscillator confirmation for best results
  • Regular divergences work best at price extremes (support/resistance)
  • Hidden divergences confirm trend continuation - trade with trend
  • MTF confirmation adds significant edge - wait when possible
  • Divergence clustering indicates strong reversal pressure
  • Volume confirmation reduces false signals but adds lag
  • Elite signals (4+ oscillators, >75% strength) have highest win rate
  • Use cooldown system (15 bars minimum) to avoid overtrading
  • Combine with price action - divergence shows momentum, price shows structure


스냅샷

Indicator Limitations

  • Divergence detection requires clear pivot formation - lags by pivot_right bars
  • Multiple oscillators can produce conflicting signals during choppy markets
  • Hidden divergences are less reliable than regular divergences
  • Strength scoring is probabilistic, not deterministic
  • MTF confirmation adds lag but increases reliability
  • Clustering detection has fixed lookback - may miss longer-term patterns
  • Volume confirmation may not work well on illiquid instruments
  • Extreme market conditions can invalidate divergence signals


Technical Implementation

Built with Pine Script v6 using:
  • 6-oscillator system (RSI, MFI, Stochastic, MACD, CCI, Stochastic RSI)
  • Pivot-based divergence detection with array tracking
  • Regular and hidden divergence algorithms
  • Multi-oscillator confirmation aggregation
  • Divergence strength scoring (oscillator count + volume + momentum)
  • Multi-timeframe security requests for HTF confirmation
  • Divergence clustering detection (50-bar lookback)
  • Signal cooldown system (15 bars minimum)
  • Gradient visualization with dynamic coloring
  • Institutional flow integration (CVD delta analysis)
  • Elite signal filtering (4+ oscillators, >75% strength)


The code is fully open-source and can be modified to suit individual trading styles.

Originality Statement

This indicator is original in its comprehensive multi-oscillator divergence confirmation approach. While individual oscillator divergences are established concepts, this indicator is justified because:

  • It combines 6 independent oscillators (RSI, MFI, Stochastic, MACD, CCI, Stochastic RSI) for robust confirmation
  • The multi-oscillator confirmation system (2-6 required) significantly reduces false signals
  • Divergence strength scoring quantifies setup quality through multi-factor analysis
  • Multi-timeframe divergence confirmation adds conviction layer
  • Divergence clustering detection identifies high-probability reversal zones
  • Integration of institutional flow (CVD delta) with divergence analysis is unique
  • Elite signal filtering (4+ oscillators, >75% strength) isolates highest probability setups
  • Signal cooldown system prevents overtrading while maintaining signal quality


Each component contributes unique information: multiple oscillators reduce false signals, regular divergences show reversals, hidden divergences show continuations, strength scoring quantifies quality, MTF confirmation adds conviction, clustering shows intensity, and institutional flow confirms with volume. The indicator's value lies in presenting these complementary perspectives simultaneously with rigorous confirmation requirements.

Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice. Divergence signals do not guarantee reversals. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.

-Made with passion by officialjackofalltrades

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.