OPEN-SOURCE SCRIPT
Tidal Divergence [JOAT]

Tidal Divergence [JOAT]
Tidal Divergence is a composite divergence detector that lives in a sub-pane and projects high-conviction divergence visuals onto the price chart. The composite blends three volume-based oscillators — Money Flow Index, percentile-ranked Cumulative Volume Delta, and z-scored OBV rate-of-change — into a single normalized stream. Both regular and hidden divergences are detected. Persistent zones are drawn at divergence pivots, and zone mitigation is tracked with body / wick / rejection modes.

What makes it different
How it works
Reading the chart
Signals
All gated on barstate.isconfirmed or barstate.ishistory. No future references. No lookahead_on.
Inputs
How traders use this
Limitations
Compatibility
Pine Script v6 open-source indicator (pane plus cross-pane). Any symbol with volume data. Cross-pane elements use force_overlay=true. No request.security calls.
Defaults
14-bar MFI, 14-left / 5-right pivot, body mitigation, FVG confluence off by default, mint / red palette, top-right medium dashboard. Enable FVG confluence to filter for higher-quality setups.
Tidal Divergence is a composite divergence detector that lives in a sub-pane and projects high-conviction divergence visuals onto the price chart. The composite blends three volume-based oscillators — Money Flow Index, percentile-ranked Cumulative Volume Delta, and z-scored OBV rate-of-change — into a single normalized stream. Both regular and hidden divergences are detected. Persistent zones are drawn at divergence pivots, and zone mitigation is tracked with body / wick / rejection modes.
What makes it different
- Single-oscillator divergence indicators give a single perspective. Tidal Divergence's composite triangulates three independent volume-derived oscillators so a divergence in the composite is supported by three volume readings instead of one.
- Hidden divergences (continuation pattern: price higher low plus oscillator lower low for bull) are detected separately from regular divergences (reversal pattern), with distinct line styles on the price chart.
- Each detected divergence creates a persistent demand or supply zone with optional FVG-confluence gating, dynamic alpha-by-age (zones fade as they age), and explicit mitigation logic (body / wick / two-close rejection variants).
- A composite percentile envelope (5th to 95th percentile of the last 200 bars) is drawn behind the oscillator so absolute readings are easy to interpret in context.
How it works
- MFI(14), daily-reset CVD then ta.percentrank(cvd, 100), OBV ROC z-score over a 20-bar mean / stdev. Three legs, each normalized to roughly the same scale.
- Composite equals 0.40 times the normalized MFI plus 0.35 times the normalized CVD percentile plus 0.25 times the clamped OBV ROC z. Hull-smoothed and scaled to centi-percent.
- Pivots are detected on the composite stream. A regular bull divergence requires a price lower low paired with a composite higher low within a 5-to-60-bar window. Hidden bull requires a price higher low plus composite lower low. Bear variants invert the conditions.
- At each divergence pivot, two horizontal lines are drawn (edge equals lowest wick / highest wick. base equals lowest body / highest body), with a linefill between them, on the price chart via force_overlay=true.
- Zone mitigation: body mode (close beyond edge) or wick mode (high/low beyond edge), optionally with two-close rejection requirement.
- Optional FVG confluence requires a recent 3-bar Fair Value Gap before firing the divergence-final alert.
Reading the chart
- In-pane: composite line tinted by direction with a smoothed signal line, gradient ribbon between them, breath-modulated zero midline, plus and minus 70 overbought / oversold thresholds, and the percentile envelope as an atmospheric backdrop.
- In-pane divergence markers: regular divergences as solid connector plots, hidden divergences as broken (dashed-equivalent) connectors.
- Cross-pane: price-to-price divergence connector lines on the price chart (regular solid, hidden dashed). Each line has a small REG BULL DIV 4520.50 or HID BEAR DIV label at the current pivot.
- Cross-pane zone fills with age-graded transparency.
- Zone edge price labels follow the right edge of each active zone.
- Mitigation flash labels print at the bar where a zone is broken.
- A cross-pane composite tint paints a soft mint / red background when the composite is clearly above or below plus or minus 30.
Signals
- Regular bullish / bearish divergence
- Hidden bullish / bearish divergence (continuation)
- Bull / bear zone touch
- Bull / bear zone mitigated
- Bull / bear stack (three or more active zones plus a fresh regular divergence)
- Bull / bear streak (composite above / below zero for N consecutive bars)
All gated on barstate.isconfirmed or barstate.ishistory. No future references. No lookahead_on.
Inputs
- MFI: MFI length.
- Divergence: pivot lookback left / right, detect hidden divergences toggle.
- Zones: zone extreme length, max zone age, mitigation mode, allow-rejection toggle.
- FVG Confluence: require FVG, FVG lookback bars.
- Visual: bullish / bearish colors.
- Cross-pane Visuals: divergence lines, divergence labels, zone edge labels, composite tint.
- Dashboard: position, size.
How traders use this
- Reversal entries: a regular bull divergence with the composite leaving an oversold extreme is a high-quality long setup, especially when accompanied by an FVG below the divergence price.
- Continuation entries: a hidden bull divergence during a clearly trending bull regime is a structurally supported add-on entry on a pullback.
- Zone trades: after a divergence prints, treat its zone as an active demand or supply level. Reactions to the zone (touch with rejection candles) are tradable. Mitigation invalidates the level.
- Composite filter: only trade with the composite in agreement (composite above 0 for longs). The cross-pane tint helps you stay aligned without checking the pane.
Limitations
- Divergence detection inherently lags the actual extreme by the right-pivot window.
- Composite values are smoothed and need warm-up bars before they stabilize.
- Cumulative Volume Delta is a tick-volume proxy, not true level-2 order flow.
- A divergence is a probability, not a guarantee. Many divergences fail before completing their implied reversal.
Compatibility
Pine Script v6 open-source indicator (pane plus cross-pane). Any symbol with volume data. Cross-pane elements use force_overlay=true. No request.security calls.
Defaults
14-bar MFI, 14-left / 5-right pivot, body mitigation, FVG confluence off by default, mint / red palette, top-right medium dashboard. Enable FVG confluence to filter for higher-quality setups.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.