Multi-Oscillator Divergence Scanner [Quantum Algo]Multi-Oscillator Divergence Scanner
====================================================
🔶 OVERVIEW
Multi-Oscillator Divergence Scanner is a confluence-based divergence indicator that scans up to seven classic oscillators simultaneously — Relative Strength Index, Moving Average Convergence Divergence, Stochastic Oscillator, Commodity Channel Index, On Balance Volume, Money Flow Index, and Momentum — and displays the result on two synchronized canvases at once. Divergence lines, graded labels, and reaction zones are drawn directly on the price chart, while a dedicated pane below plots a Composite Oscillator built from every enabled engine, with the same divergence lines mirrored onto the composite itself. You see both slopes of every divergence — price disagreeing with momentum — in one glance.
The problem this script solves is selective divergence trading. Any single oscillator produces frequent divergences, and most of them fail. Requiring multiple mathematically independent engines — momentum-based, volume-based, and volatility-normalized — to diverge at the same confirmed swing filters the noise down to setups where disagreement between price and participation is broad, not incidental.
🔶 WHAT IS A DIVERGENCE?
A divergence occurs when price prints a new extreme but an oscillator refuses to confirm it. A regular bullish divergence forms when price makes a lower low while the oscillator makes a higher low — a classic reversal condition. A regular bearish divergence forms when price makes a higher high while the oscillator makes a lower high. Hidden divergences are the continuation counterparts: price makes a higher low while the oscillator makes a lower low (hidden bullish), or price makes a lower high while the oscillator makes a higher high (hidden bearish). This scanner detects all four types on confirmed swing pivots.
🔶 WHAT IS THE COMPOSITE OSCILLATOR?
The Composite Oscillator is the consensus reading of every engine you enable. Bounded oscillators (Relative Strength Index, Stochastic, Money Flow Index) contribute their native zero-to-one-hundred values; unbounded engines (Moving Average Convergence Divergence histogram, On Balance Volume, Momentum) are range-normalized over a configurable lookback; the Commodity Channel Index is rescaled onto the same axis. The average of all enabled engines plots as a single gradient line with overbought and oversold guides, a midline fill, and divergence lines drawn directly on it — so the pane shows aggregate momentum from the same engines that vote on every signal, not a separate calculation.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. True multi-engine confluence. Divergences are not detected on one oscillator and decorated with others. All seven engines are evaluated independently at every confirmed pivot, and a signal only exists when the minimum confluence count you set is reached.
2. Dual-canvas mirroring. Every qualified divergence is drawn twice: on price, and on the Composite Oscillator in the pane, connected at the same two pivots. Both slopes of the disagreement are visible simultaneously — the visual proof that defines a divergence.
3. Consensus composite pane. The pane line is not one more oscillator; it is the averaged, normalized voice of the exact engines doing the scanning, colored by a gradient between the oversold and overbought guides.
4. Full transparency on every label. Each signal prints its strength as a diamond meter and lists the exact oscillators that diverged (for example: RSI · OBV · MFI). You always know why a signal exists — nothing is a black box.
5. Strength-scaled visuals. Divergence lines thicken with confluence on both canvases, and signals reaching the Strong threshold upgrade to the accent color, so chart hierarchy communicates quality instantly.
6. Reaction zones with a life cycle. Every regular divergence projects a volatility-sized zone around its pivot (measured in Average True Range). Zones gray out automatically the moment price invalidates them, so the chart always distinguishes live zones from dead ones.
7. Divergence pressure gauge. A decaying pressure model accumulates bullish and bearish divergence weight over time, giving a one-glance read on which side has been stacking disagreement with price.
🔶 HOW IT WORKS
Pivot scanning: Swing highs and swing lows are confirmed with a symmetric pivot lookback. All divergence checks are evaluated on closed bars at pivot confirmation, so historical signals do not repaint. Confirmation lag equals the right-side pivot length by design.
Confluence evaluation: At each confirmed pivot, every enabled oscillator's value at that pivot is compared against its value at the previous same-side pivot. The four divergence types are tested independently per oscillator, and contributions are counted.
Signal grading: Signals meeting the Minimum Oscillator Confluence print with strength diamonds (one per contributing oscillator). Signals reaching the Strong Signal Threshold upgrade to the accent color and thicker geometry on both the price chart and the composite pane.
Composite rendering: The pane plots the consensus line with a gradient fill to the midline, dashed overbought and oversold guides, tinted extreme bands, triangle marks at divergence bars, and the mirrored divergence lines.
Reaction zones: Each regular divergence projects a box around its pivot sized by Average True Range, extended a configurable number of bars. A bullish zone grays out when price closes below it; a bearish zone grays out when price closes above it.
Dashboard: A fully themeable panel on the price chart shows the last signal, a live divergence pressure meter, and one row per engine with its live value — color-coded for overbought, oversold, or directional state — plus each engine's most recent divergence side. Text size (four steps), position, and every color (title band, background, frame, grid, header, body, muted) are adjustable.
Chart hygiene: The number of divergences kept is capped by input, on both canvases. Older lines, labels, and zones are deleted automatically, keeping the chart readable and the auto-scale anchored to current price.
🔶 HOW TO USE IT
1. Works on any market — cryptocurrency, forex, gold, indices, stocks, futures — and any timeframe. Higher timeframes produce fewer, larger-structure signals.
2. Start with Minimum Oscillator Confluence at 2 and the Strong threshold at 4. Raise the minimum to 3 for a strict, low-frequency reversal tool; lower it to 1 to study single-oscillator behavior.
3. Read the pane and the chart together: a valid signal shows price sloping one way and the composite sloping the other, connected at the same pivots.
4. Regular divergences are reversal-oriented: treat them as exhaustion evidence at swing extremes, strongest when the composite is also inside an overbought or oversold band.
5. Hidden divergences are continuation-oriented: treat them as trend re-entry evidence during pullbacks, and do not read them like reversal signals.
6. Use the reaction zone as the decision area: a live zone holding on retest supports the signal; a grayed zone means the divergence failed.
7. The pressure meter is context, not a trigger — persistent one-sided pressure alongside fresh strong signals is the highest-quality condition.
🔶 SETTINGS
- Pivot Left / Right Length — swing size; larger values scan bigger structures.
- Independent toggles and lengths for all seven oscillator engines.
- Composite pane: normalization lookback, overbought and oversold levels, pane marks, and mirrored divergence lines toggle.
- Regular and hidden divergence toggles, minimum confluence, strong threshold.
- Reaction zone height (Average True Range ratio) and extension.
- Divergences To Keep — caps historical drawings on both canvases for chart cleanliness and stable auto-scale.
- Dashboard with adjustable text size, position, live oscillator values, and full color theming.
- Full color customization for all chart drawings and pivot markers.
🔶 ALERTS
- Bullish Divergence / Bearish Divergence — a regular divergence met the confluence minimum.
- Hidden Bullish Divergence / Hidden Bearish Divergence — a continuation divergence met the minimum.
- Strong Divergence — a regular divergence reached the strong threshold.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? No. Divergences are evaluated only on confirmed pivots at bar close. The trade-off is intentional confirmation lag equal to the right-side pivot length.
Why does a pane divergence line sometimes start slightly off the composite's visual peak? Divergence is measured at price structure points. The line connects the composite's values at the two confirmed price pivots, which is the correct comparison even when the composite made its own extreme a bar or two away.
Why do some obvious divergences not print? Either the confluence minimum was not reached, the oscillator involved is disabled, or the swing did not confirm as a pivot under the current lengths.
Which oscillators should I enable? The default set mixes momentum and volume perspectives, which is the point of confluence: independent evidence, not seven copies of the same math.
Is a Strong signal a guaranteed reversal? No. Strength counts agreement between engines; it is a transparency measure, not a probability of profit.
🔶 CREDITS
This script builds its scanning and composite engine on classic, public-domain oscillators, and gratefully credits their creators: the Relative Strength Index by J. Welles Wilder Jr. (1978), Moving Average Convergence Divergence by Gerald Appel, the Stochastic Oscillator popularized by George C. Lane, the Commodity Channel Index by Donald Lambert (1980), On Balance Volume by Joseph Granville (1963), and the Money Flow Index by Gene Quong and Avrum Soudack. All oscillator calculations use standard built-in formulas. Drawing divergence lines on an oscillator is a long-established charting convention popularized by many community authors, acknowledged here as shared prior art. The multi-engine confluence scanner, the consensus Composite Oscillator, the dual-canvas mirroring, transparency labeling, strength grading, reaction zone life cycle, pressure model, and all code in this script are original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Divergence can persist or fail entirely during strong trends; regular divergences against a powerful trend are the weakest application. Volume-based engines (On Balance Volume, Money Flow Index) are less meaningful on symbols with unreliable volume reporting. The composite's normalized components depend on the normalization lookback. Pivot confirmation introduces intentional delay. No indicator replaces independent analysis.
🔶 DISCLAIMER
This script is provided strictly for educational and informational purposes. It is not financial advice, an investment recommendation, or a solicitation to buy or sell any financial instrument. Past behavior of any signal does not guarantee future results. Trading involves substantial risk. Always do your own research and manage risk independently.
Indicator

Divergence Indicator RSI, MACD,, Hidden Reversal Signals LunqFXDivergence Indicator is a multi-engine divergence scanner for PulseWire that reads RSI, MACD and OBV at every confirmed swing and only draws a divergence when the engines agree — so instead of the usual flood of weak one-oscillator signals, you get a few graded, high-conviction ones. Every divergence is rated by strength: ★★★ all three engines confirm (rare, strongest), ★★ two confirm, single-engine noise is filtered out by default. It detects regular divergences (price makes a new extreme, oscillators refuse — potential reversal) and hidden divergences (trend continuation), on any market — forex, crypto, stocks, indices, gold — and any timeframe. Built in Pine Script v6, fully non-repainting. Keywords: divergence indicator, RSI divergence, MACD divergence, OBV divergence, hidden divergence, regular divergence, reversal, momentum, exhaustion, multi oscillator scanner.
◆ WHY MULTI-ENGINE
Any single oscillator diverges constantly — that's why classic divergence tools feel random. Requiring independent confirmation from momentum (RSI), trend-momentum (MACD) and volume flow (OBV) removes most false positives: when all three refuse to follow price, the move is genuinely running out of fuel.
◆ WHAT IT DRAWS
Divergence lines on price — solid neon violet for bullish, neon amber for bearish; dashed for hidden divergences.
Star-graded labels — ★★ / ★★★ with tooltips explaining exactly what diverged.
Exhaustion candles — a unique display layer: candles glow at full neon while price and engines agree, and fade as engines stop confirming — you see a divergence brewing before it prints.
Status strip dashboard — a horizontal HUD along the bottom: last signal + strength, a live engine board (P / RSI / MACD / OBV direction arrows), a FUEL meter, and bull/bear counters.
◆ HOW IT WORKS
Swings are detected with confirmed pivots (N closed bars each side).
At each new confirmed pivot the scanner compares price and each engine against the previous pivot: price lower low + engine higher low = regular bull; price higher low + engine lower low = hidden bull (mirrored for highs).
The number of agreeing engines (1–3) becomes the star rating; signals below your minimum are skipped.
The live engine board and fuel meter track slope agreement in real time — display-only context that never alters signals.
◆ HOW TO USE IT
Treat ★★★ regular divergences as your primary reversal alerts — look for entries with your own structure/levels.
Use hidden divergences to join the trend on pullbacks.
Watch the FUEL meter: when it drains and candles fade, tighten stops on trend trades.
Raise Min strength to 3 for only the rarest, cleanest signals; lower pivot bars for faster (but noisier) detection.
◆ SETTINGS
Pivot left/right bars, max gap between swings, minimum strength, hidden divergences on/off, engine toggles (RSI/MACD/OBV), RSI length, exhaustion candles, label size, dashboard position/size.
◆ ALERTS
Bullish divergence · Bearish divergence (fire when a confirmed signal prints).
◆ LIMITATIONS
Signals confirm with a pivot delay (right bars) — that is the honest cost of zero repaint; lower it for speed, raise it for reliability.
On symbols without volume data the OBV engine adds no information — disable it there.
Divergence marks exhaustion, not timing — always combine with structure and risk management.
◆ ORIGINALITY & NON-REPAINTING
Original work: the three-engine agreement grading, the exhaustion-candle layer, the live engine board and the fuel meter are my own implementation — no third-party code. All divergences are built from confirmed pivots only; a drawn line or label never moves or disappears.
Educational analysis tool, not financial advice. © LunqFX. Indicator

Divergence Strength Analyzer-John HaydenHayden Momentum Regimes & Time-Decay Divergence Analyzer
Overview:
Most retail traders treat the Relative Strength Index (RSI) as a basic overbought/oversold oscillator—shorting above 70 and buying below 30. In *"RSI: The Complete Guide," John Hayden* completely flips this flawed conventional wisdom on its head. Hayden demonstrates that extreme RSI levels actually represent high-velocity structural momentum expansions rather than impending reversals.
This open-source Pine Script tool here maps Hayden's proprietary market regimes, isolates institutional *Hidden and Normal Divergences, and introduces a strict **Time-Decay Strength Matrix* to filter out low-velocity market noise.
Core Mechanics
1. The High-Velocity Regime Speedometer
Instead of looking for immediate trend reversals when the RSI enters extreme territories, this indicator uses these levels to categorize the macro trend structure:
*The Bull Market Regime (40/80 Range):* Initiated when the RSI breaks out above 70. Once confirmed, the RSI establishes a firm support floor around the *40* line during pullbacks, indicating heavy institutional backing.
*The Bear Market Regime (20/60 Range):* Initiated when the RSI drops below 30. Relief rallies consistently stall out and find a ceiling around the *60* line, proving persistent distribution.
2. The Power of Hayden's Hidden Divergence
While normal divergence frequently acts as a near-term counter-trend trap, Hayden highlights *Hidden Divergence* as the ultimate trend-continuation footprint.
* In a confirmed bullish regime, the price prints a structurally higher low while the RSI registers a deeply oversold lower low. This discrepancy indicates that while emotional momentum has fully cooled off, structural buying pressure remains completely intact, creating a coiled spring ready to unleash the next "superfast" leg up.
3. The Time-Decay Strength Matrix (%)
A primary reason traders fail with standard divergence indicators is that they fail to account for the element of time. Hayden explicitly teaches that the validity of a momentum discrepancy decays the longer it takes to form.
This script mathematically calculates the precise distance between structural peaks or troughs and scores the setup using Hayden’s time-based parameters:
* 🚀 *100% Strength (Ultra Condensed):* \le 4 bars between pivots. Highly explosive immediate velocity.
* 📈 *75% Strength (Standard Strong):* 5 to 8 bars between pivots. Highly reliable trend-joiner.
* ⚖️ *50% Strength (Moderate):* 9 to 12 bars between pivots. Average momentum reliability.
* ❌ *0% Strength (Decayed/Filtered):* > 16 bars between pivots. The setup is completely ignored and filtered off your chart to prevent slow, sideways chops.
How to Trade This Script
1. *Scan the Regime Background:* Look for a faint green chart overlay to confirm you are inside a valid Hayden Bull Regime.
2. *Locate the Footprint:* Wait for the indicator to map an *MDRP Hidden Bull* or *Normal Bull* label.
3. *Verify the Strength %:* Prioritize signals showcasing *75% to 100% Strength*. This ensures you are striking right at the inflection point of structural trend acceleration.
4. *Invalidation:* If the macro RSI breaks out of its trend bounds (e.g., dropping below the 40-floor buffer in a bull market), the regime shifts to neutral, and current long-bias expectations are discarded.
Features
*Pure Price & Momentum Geometry:* Zero volume filters are utilized, making this script ideal for clean execution across both highly liquid indexes and choppy small-cap resource scripts.
*Dynamic Chart Labels:* Eliminates chart confusion by printing the exact divergence type alongside its dynamic strength rating directly on the key pivot bar.
Indicator

CVD Delta Divergence [JOAT]CVD DELTA DIVERGENCE
A full-featured Cumulative Volume Delta engine with proper pivot-based divergence detection. CVD on its own is one of the cleanest reads of net flow you can produce without L2 data — but the value of CVD lives almost entirely in its divergence with price. CVD Delta Divergence builds the CVD properly (with footprint-API or reconstructed-tick options), then runs a strict pivot-vs-pivot divergence engine on top of it, with strength scoring and configurable cooldown.
Three data-source modes
CVD is only as good as the delta classification underneath it. Three modes are exposed:
Footprint API — uses PulseWire's Footprint dataset when the instrument supports it. The cleanest read, equivalent to professional delta feeds.
Reconstructed — when Footprint is unavailable, reconstructs buy/sell from a configurable lower-timeframe stream (1m / 3m / 5m / 15m / 30m) using the standard tick rule. Optional intrabar volume weighting.
Auto — picks Footprint when present, falls back to Reconstructed. The recommended default.
This is unusual — most public CVD scripts hardcode one method. Auto-mode means the script works correctly on any instrument that has either dataset, without per-instrument configuration.
Four CVD anchors
Cumulative deltas need an anchor — running a sum from inception of data is rarely meaningful. Four anchoring modes:
Cumulative — never resets. Maximum context, slowest divergence detection.
Session Reset (default) — anchors at the start of each trading session. The most useful read for day-trading reference.
Day Reset — anchors at midnight exchange time.
Week Reset — anchors at week boundary. Good for swing-frame divergences.
Pivot-based divergence engine (the headline)
Slope-comparison divergence is noisy. CVD Delta Divergence uses proper pivots :
ta.pivothigh / ta.pivotlow on price with a configurable lookback (default 5 bars left/right).
At each confirmed pivot, the corresponding CVD value is recorded.
A divergence is built only when two price pivots and their CVD readings disagree directionally.
A minimum-strength filter (default 15.0 on a 0–100 scale) suppresses weak signals — strength is the normalised disagreement magnitude between the price-pivot motion and the CVD-pivot motion.
A strict HL/LL toggle requires the second pivot to strictly exceed/undershoot the first by a small fraction so equal-pivot edge cases do not produce noise divergences.
A cooldown per divergence class (default 3 bars) prevents back-to-back fires of the same class.
Four divergence classes are detected:
Regular Bull — price lower-low, CVD higher-low. Reversal up.
Regular Bear — price higher-high, CVD lower-high. Reversal down.
Hidden Bull — price higher-low, CVD lower-low. Trend continuation up.
Hidden Bear — price lower-high, CVD higher-high. Trend continuation down.
Divergence markers can be force-overlaid onto the main chart pane (toggleable) so you see them on price without flipping panes.
Visual system
Slope-coloured CVD line — bull / bear gradient based on the CVD's own short-term slope (configurable window).
Smoothed CVD overlay — toggleable EMA-smoothed CVD on top of the raw line. Useful for cutting through noisy 1m reconstructions.
Delta histogram — bar-by-bar delta as columns behind the CVD line. Useful for seeing per-bar flow vs cumulative flow.
Zero line and crossover alerts.
Divergence connecting lines — when a divergence fires, a connector line is drawn between the two pivots for visual proof.
A locked Lava palette (gold bull / orange-red bear / oxblood mid on a deep lava-black ground) gives the pane a distinctive flow-read identity.
Dashboard
Monospaced table, positionable to any of eight corners, with:
Current CVD value with sign.
CVD slope direction (Rising / Falling / Flat).
Active anchor mode.
Last divergence class with bar age.
Source mode in use (Footprint / Reconstructed).
Zero-cross status with bars-ago.
Alerts
Six alert conditions, each independently controllable:
Regular Bull Divergence
Regular Bear Divergence
Hidden Bull Divergence
Hidden Bear Divergence
CVD Crosses Zero
CVD Slope Flips
How to read it
Three reads, in order of conviction:
Regular divergence — the classic reversal read. Price made a new extreme, CVD did not. The flow that was needed to extend the move did not show up. A regular divergence at a known structural level is one of the highest-conviction reversal setups in tape reading.
Hidden divergence — the trend-continuation read. Price retraced, but CVD did not. The flow is still committed in the original direction even though price wavered. Often produces clean re-entry signals in trends.
CVD zero-cross + slope flip — the regime change read. Cumulative flow has rotated sides — what was net-buying is now net-selling (or vice versa). Useful as a "the tape has flipped" notification.
Suggested settings
Defaults are tuned for 5m–1H charts on liquid markets in Session Reset mode. For lower timeframes, drop pivot lookback to 3 and divergence window to 30. For higher timeframes, raise pivot lookback to 7–10 and switch anchor to Day Reset. The minimum strength threshold (15) is intentionally loose; raise to 25–30 if you want only the strongest divergences.
Originality / what's reused
CVD (cumulative volume delta) is public-domain market-structure language; the tick rule is standard. The implementation — the Auto/Footprint/Reconstructed source switch, the four-anchor reset logic, the pivot-based divergence engine with strict HL/LL gating and minimum-strength filter, the slope-coloured CVD with histogram backdrop, the force-overlay divergence markers, and the cooldown-per-class state machine — is JOAT-original and tuned together. No third-party code reused.
Open source
Published open-source under the default Mozilla Public License 2.0. The source is sectioned, every input has a tooltip, every helper is documented inline. The CVD engine, the source-mode router, the pivot logic, and the divergence engine are independent modules — adapt any single piece without reading the whole file.
Limitations
Reconstructed CVD is a proxy — the tick rule is the accepted public-market inference but it is not a direct read of bid vs ask volume. Footprint mode requires the PulseWire Footprint dataset and is unavailable on some instruments. Pivot divergences are non-repainting once confirmed (they lag by the pivot's right-lookback) but the divergence between two pivots cannot fire until both are confirmed — so the second pivot's lag is the structural lag of the signal.
—
-made with passion by jackofalltrades
Indicator

Divergence Constellation [JOAT]Divergence Constellation
Introduction
The Divergence Constellation is an advanced open-source multi-oscillator divergence detection system that combines RSI, MACD, TSI, and Stochastic analysis with sophisticated pivot detection and confluence scoring. This indicator identifies both regular and hidden divergences across multiple oscillators simultaneously, creating a constellation of divergence signals that reveal potential reversals and trend continuations with high probability.
Unlike single-oscillator divergence tools, the Divergence Constellation provides multi-dimensional divergence analysis through composite oscillator calculation, four-oscillator confluence scoring, regular and hidden divergence detection, and chart projection. The indicator is designed for traders who understand that divergences confirmed across multiple oscillators provide significantly higher probability setups than single-oscillator divergences.
Why This Indicator Exists
This indicator addresses the need for systematic multi-oscillator divergence analysis. By combining four distinct oscillators with confluence scoring, it reveals:
Regular Bullish Divergence: Price makes lower low, oscillators make higher low (reversal up signal)
Regular Bearish Divergence: Price makes higher high, oscillators make lower high (reversal down signal)
Hidden Bullish Divergence: Price makes higher low, oscillators make lower low (trend continuation up)
Hidden Bearish Divergence: Price makes lower high, oscillators make higher high (trend continuation down)
Confluence Scoring: Counts how many oscillators confirm the divergence (1-4 score)
Composite Oscillator: Unified oscillator combining all four components
Chart Projection: Divergence lines drawn on both oscillator pane and main chart
Core Components Explained
1. Four-Oscillator System
The indicator calculates four distinct oscillators, each providing unique momentum perspective:
RSI (Relative Strength Index):
Measures momentum by comparing average gains to average losses
Zero-centered (subtracts 50) for composite integration
Sensitive to overbought/oversold conditions
Default period: 14
MACD (Moving Average Convergence Divergence):
Measures relationship between two exponential moving averages
Histogram shows momentum acceleration/deceleration
Responsive to trend changes
Default periods: 12, 26, 9
TSI (True Strength Index):
Double-smoothed momentum indicator
Filters noise while preserving trend direction
Excellent for divergence detection
Default periods: 25, 13
Stochastic:
Compares close to recent high-low range
Zero-centered (subtracts 50) for composite integration
Identifies overbought/oversold extremes
Default periods: 14, 3
2. Composite Oscillator Calculation
All four oscillators are combined into a unified composite:
Composite = (RSI + MACD + TSI + Stochastic) / 4
This composite oscillator provides a balanced view of momentum across all four methodologies. Divergences are detected on the composite, then confirmed by checking individual oscillators.
3. Pivot Detection System
The indicator uses sophisticated pivot detection to identify divergence points:
Pivot Left/Right: Number of bars on each side for pivot confirmation (default: 5)
Price Pivots: Identifies swing highs and lows in price
Oscillator Pivots: Identifies swing highs and lows in each oscillator
Lookback Range: Min (5) to Max (60) bars for comparing pivots
Pivots must be confirmed (bars on both sides) before divergence analysis begins.
4. Regular Divergence Detection
Regular divergences signal potential reversals:
Regular Bullish Divergence:
Price makes lower low (current pivot low < previous pivot low)
Composite oscillator makes higher low (current pivot low > previous pivot low)
Indicates weakening downward momentum - potential reversal up
Best at oversold levels (composite < -20)
Regular Bearish Divergence:
Price makes higher high (current pivot high > previous pivot high)
Composite oscillator makes lower high (current pivot high < previous pivot high)
Indicates weakening upward momentum - potential reversal down
Best at overbought levels (composite > 20)
5. Hidden Divergence Detection
Hidden divergences signal trend continuation:
Hidden Bullish Divergence:
Price makes higher low (current pivot low > previous pivot low)
Composite oscillator makes lower low (current pivot low < previous pivot low)
Indicates strong underlying bullish momentum - trend continuation up
Confirms uptrend strength
Hidden Bearish Divergence:
Price makes lower high (current pivot high < previous pivot high)
Composite oscillator makes higher high (current pivot high > previous pivot high)
Indicates strong underlying bearish momentum - trend continuation down
Confirms downtrend strength
6. Confluence Scoring System
When a divergence is detected on the composite, the indicator checks all four individual oscillators:
Score 1/4: Only one oscillator confirms - weak divergence
Score 2/4: Two oscillators confirm - moderate divergence (minimum for signals)
Score 3/4: Three oscillators confirm - strong divergence
Score 4/4: All four oscillators confirm - extreme divergence (highest probability)
The minimum confluence score (default 2) filters out weak divergences that lack multi-oscillator confirmation.
7. Signal Generation Logic
Signals are generated only at extreme oscillator levels with anti-overlap logic:
Bullish Signals:
Regular bullish divergence detected
Composite oscillator < -20 (oversold)
Confluence score >= minimum (default 2)
At least 20 bars since last bullish signal (anti-overlap)
Bearish Signals:
Regular bearish divergence detected
Composite oscillator > 20 (overbought)
Confluence score >= minimum (default 2)
At least 20 bars since last bearish signal (anti-overlap)
Extreme Signals:
Confluence score = 4/4 (all oscillators confirm)
Composite at extreme levels (< -30 or > 30)
Displayed as diamond shapes for emphasis
8. Visual Divergence Lines
Divergence lines are drawn connecting pivot points:
Regular Divergences: Solid lines (green = bullish, red = bearish)
Hidden Divergences: Dashed lines (cyan = bullish, orange = bearish)
Oscillator Pane: Lines drawn on composite oscillator
Chart Projection: Lines also drawn on main price chart (optional)
Lines provide visual confirmation of the divergence pattern and help identify the exact pivot points involved.
Visual Elements
Four Oscillator Lines: Thick colored lines showing RSI (cyan), MACD (magenta), TSI (yellow), and Stochastic (green)
Composite Line: White line showing unified oscillator
Zero Line: Gray horizontal line at zero
Overbought/Oversold Zones: Shaded areas at +30/-30 levels
Divergence Lines: Solid/dashed lines connecting pivot points
Signal Triangles: Small triangles at signal generation points
Extreme Diamonds: Larger diamonds for 4/4 confluence signals
Information Dashboard: Displays composite position, confluence score, RSI/MACD/TSI/Stochastic status, composite value, divergence types, signal strength, extreme events, and overall verdict
How to Use This Indicator
Step 1: Monitor Composite Position
Check if composite oscillator is at extreme levels (> 30 overbought, < -30 oversold). Divergences at extremes have highest probability.
Step 2: Check Confluence Score
Look for confluence scores of 3/4 or 4/4. Higher scores indicate stronger divergence confirmation across multiple oscillators.
Step 3: Identify Divergence Type
Regular divergences signal reversals, hidden divergences signal trend continuation. Trade accordingly.
Step 4: Wait for Signal Confirmation
Don't trade divergence lines alone. Wait for signal triangles that confirm divergence meets all criteria (extreme level, confluence, anti-overlap).
Step 5: Look for Extreme Events
Diamond shapes indicate 4/4 confluence at extreme levels - highest probability setups.
Step 6: Confirm with Price Action
Use divergence signals as alerts, then confirm with price action, support/resistance, or other indicators before entering.
Step 7: Check Individual Oscillators
Dashboard shows status of each oscillator. All four overbought/oversold provides additional confirmation.
Best Practices
Trade only divergences with confluence score >= 2 (default minimum)
Focus on regular divergences at extreme levels (< -30 or > 30) for reversals
Use hidden divergences to confirm trend continuation, not as standalone entries
Wait for signal triangles - don't front-run divergence lines
4/4 confluence signals (diamonds) offer highest probability setups
Combine with support/resistance levels for additional confirmation
Avoid divergences in middle range (-20 to +20) - wait for extremes
Use higher timeframe divergences for stronger significance
Input Parameters
Pivot Detection:
Pivot Left: Bars to left of pivot (default: 5)
Pivot Right: Bars to right of pivot (default: 5)
Max Lookback: Maximum bars to compare pivots (default: 60)
Min Lookback: Minimum bars to compare pivots (default: 5)
Oscillator Configuration:
RSI Length: Period for RSI (default: 14)
MACD Fast: Fast EMA period (default: 12)
MACD Slow: Slow EMA period (default: 26)
MACD Signal: Signal line period (default: 9)
TSI Long: Long smoothing period (default: 25)
TSI Short: Short smoothing period (default: 13)
Stochastic K: K period (default: 14)
Stochastic D: D smoothing (default: 3)
Divergence Rules:
Show Regular Divergence: Toggle regular divergence detection (default: enabled)
Show Hidden Divergence: Toggle hidden divergence detection (default: enabled)
Min Confluence Score: Minimum oscillators that must confirm (default: 2)
Project on Chart: Draw divergence lines on main chart (default: enabled)
Visual Configuration:
Bullish/Bearish Divergence Colors: Colors for regular divergences
Hidden Bullish/Bearish Colors: Colors for hidden divergences
Originality Statement
This indicator is original in its multi-oscillator confluence approach. While individual oscillators and divergence concepts are established, this indicator is justified because:
It combines four distinct oscillators into a unified composite system
The confluence scoring system measures divergence strength across multiple oscillators
Automatic detection of both regular and hidden divergences with pivot analysis
Signal generation includes extreme level filtering and anti-overlap logic
Chart projection allows divergence visualization on both oscillator and price chart
The comprehensive dashboard presents all oscillator states and divergence metrics simultaneously
Integration of multiple oscillator perspectives creates higher probability divergence signals
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Divergence analysis does not guarantee profitable trades or reversals. Past divergences do not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

3D Money Flow Index [UAlgo]3D Money Flow Index is a visual enhancement of the Money Flow Index that transforms a classic momentum oscillator into a pseudo 3D ribbon rendered inside its own pane. Instead of displaying MFI as only a single flat line, the script builds a front surface, a back surface, connecting edges, and shaded faces, then projects those elements through a camera style transformation using configurable yaw and pitch angles. The result is a depth based MFI visualization that makes momentum shifts, expansion, compression, and reversals much more expressive than a standard oscillator plot.
The indicator runs in a separate pane ( overlay=false ) and combines several components into one visual framework:
A custom MFI style calculation
A 3D ribbon built from projected historical MFI values
Optional dynamic ribbon depth based on volatility
Buy and sell markers when MFI crosses key threshold levels
Regular bullish and bearish divergence detection using MFI pivots versus price pivots
Projected guide levels for 80, 50, and 20
This makes the script useful for traders who want both analysis and presentation. It keeps the familiar MFI logic at the core, but wraps it in a more intuitive spatial display that can help visually separate trend persistence, reversal attempts, and divergence structures.
Educational tool only. Not financial advice.
🔹 Features
🔸 1) 3D Ribbon Style MFI Visualization
The core feature of the script is a pseudo 3D MFI ribbon. For each historical bar inside the selected history length, the indicator creates a front and back layer around the same MFI value, connects those layers with side edges, and fills the face between them. This gives the oscillator a ribbon like body rather than a single thin line.
The ribbon is projected into the pane using time for the horizontal axis and MFI value for the vertical axis, which creates a clean depth illusion without leaving the oscillator panel.
🔸 2) Adjustable Camera Style Projection
The script includes two visual controls that change how the ribbon appears in space:
Yaw Angle changes the left right visual rotation of the ribbon
Pitch Angle changes the vertical tilt of the ribbon
These controls allow the user to choose a flatter, more technical display or a more dramatic perspective oriented look.
🔸 3) Configurable Ribbon Depth
The Ribbon Depth setting controls how thick the 3D body appears along the synthetic Z axis. Lower values create a thinner ribbon, while higher values create a deeper and more dramatic structure.
This is especially useful when adapting the visualization for different screen sizes or preferred chart density.
🔸 4) Optional Dynamic Volatility Based Depth
When enabled, the script automatically scales ribbon depth using current ATR relative to its longer average. This means the visual thickness expands during higher volatility and compresses during quieter periods.
The result is a ribbon that can communicate both oscillator behavior and relative volatility regime at the same time.
🔸 5) Custom Money Flow Index Calculation
Instead of using the built in ta.mfi() , the script calculates its own MFI style series from positive and negative money flow sums derived from price change and volume. This gives the indicator full internal control over the oscillator values used by the 3D engine, divergence logic, and threshold signals.
🔸 6) Buy and Sell Threshold Markers
The script generates event markers when MFI crosses important momentum thresholds:
Buy style event when MFI crosses above 20
Sell style event when MFI crosses below 80
These events are rendered as small 3D boxes attached to the ribbon, which keeps the signal presentation consistent with the indicator’s depth based design.
🔸 7) Regular Divergence Detection
The indicator can detect regular divergence by comparing MFI pivots to price pivots:
Bearish divergence when price makes a higher high but MFI makes a lower high
Bullish divergence when price makes a lower low but MFI makes a higher low
Divergence is optional and can be turned on or off through the settings.
🔸 8) 3D Aligned Divergence Lines
When a divergence is detected, the script draws a thicker line between the two MFI pivot points, positioned on the ribbon’s front face so the divergence appears visually attached to the 3D structure instead of floating away from it.
It also draws dotted connector lines from the divergence line back to the ribbon body, reinforcing the spatial relationship.
🔸 9) Historical Ribbon Length Control
The History Length input limits how many bars of 3D ribbon are drawn. This helps balance visual richness with performance and keeps the pane from becoming overcrowded.
🔸 10) Gradient Color Mapping by MFI Level
The ribbon is colored dynamically using a gradient based on MFI value:
Lower readings lean bearish
Higher readings lean bullish
This means the ribbon itself functions as a live regime map, not just a structural shape.
🔸 11) Projected Guide Levels
The script draws perspective aligned guide levels for:
80
50
20
These are not flat horizontal pane lines. They are projected using the same camera logic as the ribbon, which keeps the entire display visually coherent.
🔸 12) Full Last Bar Redraw for Visual Consistency
All 3D objects are deleted and rebuilt on the last bar. This ensures that the current camera angles, ribbon depth, divergence set, and markers are always rendered consistently with the latest data.
🔸 13) Object Based Design for Maintainability
The script uses several custom types:
Point3D for synthetic 3D coordinates
Point2D for projected time / value coordinates
Camera for projection controls
DivLine for stored divergence events
This makes the visual engine and signal logic more structured and easier to extend.
🔹 Calculations
1) Custom MFI Style Calculation
The script computes money flow using separate positive and negative sums based on the change in the selected source:
float upper = math.sum(volume * (ta.change(src) <= 0 ? 0 : src), length)
float lower = math.sum(volume * (ta.change(src) >= 0 ? 0 : src), length)
Then it computes an MFI style output:
float ratio = lower == 0 ? 0 : upper / lower
100.0 - (100.0 / (1.0 + ratio))
Interpretation:
Positive source changes contribute to the upper flow sum.
Negative source changes contribute to the lower flow sum.
The resulting ratio is converted into an oscillator style value on a 0 to 100 scale.
Important implementation note:
This is a custom MFI style calculation, not the built in PulseWire MFI function. The script uses its own edge case handling when lower == 0 .
2) Volatility Based Depth Scaling
The dynamic depth option uses ATR relative to a longer ATR average:
float atr = ta.atr(14)
float avg_atr = ta.sma(atr, 100)
float depth_scaler = use_dynamic_depth ? math.max(0.5, math.min(2.5, atr / avg_atr)) : 1.0
Interpretation:
If current ATR is above its longer average, the ribbon becomes deeper.
If current ATR is below its longer average, the ribbon becomes thinner.
The multiplier is clamped between 0.5 and 2.5 for stability.
3) 3D Coordinate Model
Each ribbon segment uses synthetic 3D coordinates:
x represents bars back in history
y represents the MFI value
z represents the ribbon depth offset
For each bar, the ribbon creates:
A front point at z = -depth / 2
A back point at z = depth / 2
This creates the geometry needed for the front edge, back edge, side edge, and face fill.
4) Camera Projection Logic
The script projects each 3D point into 2D coordinates using yaw and pitch rotations:
float x1 = p.x * math.cos(rad_yaw) - p.z * math.sin(rad_yaw)
float z1 = p.x * math.sin(rad_yaw) + p.z * math.cos(rad_yaw)
float y1 = p.y * math.cos(rad_pitch) - z1 * math.sin(rad_pitch)
Then it converts the projected coordinates into chart coordinates:
int proj_time = int(ref_time - (x1 * time_step))
float proj_price = y1
Interpretation:
The script does not use true 3D rendering. It uses geometric projection math to simulate depth within normal chart objects.
5) Time Step Mapping
The horizontal spacing of projected points is derived from current chart time:
int dt = time - time
if bar_index == 0
dt := 60000
This lets the projected ribbon stay aligned with the current timeframe interval.
6) Ribbon Segment Construction
For each bar pair in the selected history window, the script creates:
Front line from point A front to point B front
Back line from point A back to point B back
Connector line from point A front to point A back
A filled face polygon between the front and back edges
This produces the actual ribbon body. The fill is created only for recent segments to stay within object limits:
if i < 90
...
polylines.push(polyline.new(points, ... fill_color=face_col ...))
7) Gradient Color Logic for the Ribbon
The ribbon color is mapped from current MFI value:
color base_col = color.from_gradient(val_a, 20, 80, col_bear, col_bull)
Interpretation:
Lower MFI values shift toward the bearish color.
Higher MFI values shift toward the bullish color.
Midrange values naturally blend between the two.
8) Buy and Sell Signal Logic
The script defines simple threshold crossing events:
bool sig_buy = ta.crossover(mfi_val, 20)
bool sig_sell = ta.crossunder(mfi_val, 80)
Interpretation:
Buy event means MFI rises back above the lower threshold, which can suggest recovery from oversold pressure.
Sell event means MFI falls back below the upper threshold, which can suggest rejection from overbought pressure.
These are event markers, not standalone entry guarantees.
9) 3D Marker Drawing
When a buy or sell signal occurs, the script draws a small 3D box marker using the same projection engine as the ribbon. The marker is built from four projected corners and connected with line segments so it appears attached to the ribbon structure.
This keeps the signal styling consistent with the rest of the indicator.
10) Pivot Detection for Divergence
The divergence engine finds pivot highs and lows on the MFI series:
float ph = ta.pivothigh(mfi_val, piv_len, piv_len)
float pl = ta.pivotlow(mfi_val, piv_len, piv_len)
Each pivot is aligned to its true pivot bar using:
int curr_piv_bar = bar_index - piv_len
This ensures divergence anchors are placed at the actual turning points, not the later confirmation bar.
11) Bearish Divergence Logic
When an MFI pivot high is confirmed, the script compares it with the prior MFI pivot high:
bool bear_div = (curr_price_high > last_price_ph) and (curr_piv_val < last_ph_val)
Interpretation:
Price makes a higher high
MFI makes a lower high
If true, a bearish divergence line is stored.
12) Bullish Divergence Logic
When an MFI pivot low is confirmed, the script compares it with the prior MFI pivot low:
bool bull_div = (curr_price_low < last_price_pl) and (curr_piv_val > last_pl_val)
Interpretation:
Price makes a lower low
MFI makes a higher low
If true, a bullish divergence line is stored.
13) Divergence Storage and Cleanup
Detected divergences are stored in an array of DivLine objects. Older divergence entries are removed once they fall too far outside the active visual window:
if (bar_index - divergences.get(0).start_bar) > (history_len + 100)
divergences.shift()
This prevents old divergence structures from accumulating forever.
14) 3D Aligned Divergence Rendering
When a divergence is drawn, the script places it on the front face of the ribbon by using:
float z_offset = -current_depth / 2.0
This is an important visual detail because it keeps the divergence line attached to the ribbon surface rather than offset in empty space.
The script also draws dotted connector lines from the divergence line endpoints back to the ribbon center plane, reinforcing the 3D attachment.
15) Projected Guide Level Rendering
The indicator draws projected guide levels at 80, 50, and 20 using the same projection method:
draw_grid_line(80, color.red)
draw_grid_line(50, color.gray)
draw_grid_line(20, color.green)
This keeps the threshold references visually aligned with the ribbon perspective instead of using flat horizontal lines that would break the illusion.
16) Full Last Bar Rebuild Process
On the last bar, the script:
Deletes all existing lines, polylines, and labels
Recreates the camera
Rebuilds the ribbon over the selected history length
Replots signal markers
Renders divergence lines
Draws guide levels
This full redraw approach ensures visual consistency whenever the latest bar changes, the camera angles change, or volatility depth changes. Indicator

3D RSI [UAlgo]3D RSI is a visual RSI enhancement indicator that transforms the standard RSI line into a dynamic 3D style ribbon inside a separate oscillator pane. Instead of plotting a single line only, the script builds an upper and lower envelope around RSI using a user defined thickness value, then connects and fills those layers bar by bar to create a depth effect. The result is a more expressive RSI display that highlights momentum shifts, overbought and oversold transitions, and local structure in a visually intuitive way.
In addition to the 3D ribbon, the script includes a built in divergence module labeled as 3D Divergence . It detects regular bullish and bearish divergence using RSI pivot highs and lows versus price pivot highs and lows, then draws a bridge style visual in the RSI pane to emphasize the divergence relationship in a depth themed format.
The indicator is designed for traders who want both functionality and presentation. It preserves the standard RSI context through a base RSI plot and common reference levels (70, 50, 30), while adding a layered ribbon, gradient coloring, background zones, live value labeling, and optional divergence annotations.
Educational tool only. Not financial advice.
🔹 Features
🔸 1) 3D RSI Ribbon Visualization
The core feature of the script is a 3D style RSI ribbon built from:
An upper RSI boundary
A lower RSI boundary
A vertical connector on each bar
A filled region between upper and lower boundaries
This creates a depth effect around RSI rather than a flat oscillator line, making momentum expansion and contraction easier to read visually.
🔸 2) User Defined 3D Thickness
The 3D Thickness input controls the distance between the upper and lower ribbon edges around the RSI value. Increasing thickness creates a broader ribbon and a stronger depth effect. Lower values produce a tighter, more precise band around the RSI curve.
🔸 3) Gradient Color Mapping by RSI Level
Ribbon colors are dynamically mapped using a gradient based on RSI value:
Lower RSI values lean toward the Oversold color
Higher RSI values lean toward the Overbought color
This makes the ribbon itself function as a regime heatmap, so you can visually assess oscillator state without reading exact numbers.
🔸 4) Real Time Ribbon Update with Efficient Segment Handling
The script draws new ribbon segments only when a new bar is formed and updates the latest segment while the current bar is still developing. This provides a smooth real time display while controlling object creation and performance.
It also includes cleanup logic that removes older ribbon objects once the stored segment count grows too large.
🔸 5) Built In 3D Divergence Detection (Regular Bullish and Bearish)
When enabled, the indicator detects regular divergence using RSI pivots and price pivots:
Bearish divergence when price makes a higher high while RSI makes a lower high
Bullish divergence when price makes a lower low while RSI makes a higher low
The script uses RSI pivot confirmation with configurable left and right lookback settings, then pairs each new pivot with the most recent prior pivot of the same type.
🔸 6) 3D Divergence Bridge Visualization
Instead of drawing a plain divergence line only, the script creates a bridge style divergence visual in the RSI pane:
An outer edge line (upper for bearish, lower for bullish)
A center line connecting RSI pivot values
Vertical pillar lines at both pivot points
A compact label marking Bull Div or Bear Div
This keeps the divergence presentation consistent with the 3D ribbon concept.
🔸 7) Live RSI Value Label
A dynamic label is placed near the latest RSI point and updates on every bar. The label displays the current RSI value and inherits the same gradient driven color logic as the ribbon, improving readability and quick decision support.
🔸 8) Standard RSI Base Plot Included
The script also plots a classic RSI line in the background with reduced opacity. This is useful for users who want the familiar RSI trace while still benefiting from the 3D ribbon display.
🔸 9) Overbought / Oversold / Mid Reference Levels
The indicator includes standard horizontal reference levels:
70 for overbought
30 for oversold
50 for midpoint
These levels work alongside the ribbon and divergence visuals to preserve standard RSI interpretation workflows.
🔸 10) Background Regime Shading
The script fills the upper (70 to 100) and lower (0 to 30) zones with subtle color shading using the user selected overbought and oversold colors. This helps emphasize extreme zones without overwhelming the pane.
🔸 11) Object Based Internal Design
The script uses custom types for better structure and maintainability:
RSIPoint stores ribbon points (index, RSI, upper, lower)
PivotPoint stores divergence pivots (price and RSI context)
RSI3D stores the engine state, object arrays, labels, and last pivot references
This design supports cleaner extension for future features.
🔹 Calculations
1) RSI Core Calculation
The indicator uses the standard RSI calculation on close:
float rsiVal = ta.rsi(src, LEN)
A second standard RSI calculation is also plotted as a base line for reference:
rsiVal = ta.rsi(close, LEN)
plot(rsiVal, "RSI Base", color=color.new(color.gray, 50), linewidth=1)
2) 3D Ribbon Geometry (Upper and Lower Layers)
For each valid RSI value, the script builds a 3D envelope using the configured thickness:
float upperVal = rsiVal + this.thickness
float lowerVal = rsiVal - this.thickness
These three values define a single RSIPoint :
The center RSI value
The upper ribbon edge
The lower ribbon edge
The ribbon is then drawn by connecting consecutive RSIPoint objects.
3) RSIPoint History Management
The script stores recent ribbon points in an array. If the current bar already exists as the most recent point, it updates that point. Otherwise it appends a new one:
if lastPoint.index == bar_index
this.history.set(this.history.size() - 1, newPoint)
else
this.history.push(newPoint)
History is capped to avoid excessive memory growth:
if this.history.size() > 1000
this.history.shift()
4) Ribbon Segment Drawing Logic
When at least two points exist, the script draws or updates a single segment between the previous and current point:
Upper line between previous upper and current upper
Lower line between previous lower and current lower
Vertical line at current bar connecting upper and lower
Filled region between upper and lower lines
line l_up = line.new(p1.index, p1.upper, p2.index, p2.upper, ...)
line l_dn = line.new(p1.index, p1.lower, p2.index, p2.lower, ...)
line l_v = line.new(p2.index, p2.upper, p2.index, p2.lower, ...)
linefill lf = linefill.new(l_up, l_dn, color=colorFill)
If the bar is still active and no new index exists, the script updates the last segment instead of creating a new one.
5) Gradient Color Calculation for the 3D Ribbon
Ribbon color is derived from the current RSI value using a gradient between the oversold and overbought colors:
color c_curr = color.from_gradient(p2.value, 30, 70, COL_OS, COL_OB)
The script then derives related colors from this base for:
Upper line
Lower line
Fill
Vertical connector
This creates a coherent depth style while preserving the RSI level heatmap effect.
6) Live RSI Label Update
The current value label is updated on each draw cycle:
this.current_label.set_xy(p2.index + 1, p2.value)
this.current_label.set_text(str.tostring(p2.value, "#.0"))
this.current_label.set_textcolor(c_curr)
This keeps the label positioned next to the latest RSI point and colored according to current RSI regime.
7) RSI Pivot Detection for Divergence
The divergence engine uses RSI pivot highs and lows:
float ph_rsi_val = ta.pivothigh(rsiVal, DIV_LB, DIV_RB)
float pl_rsi_val = ta.pivotlow(rsiVal, DIV_LB, DIV_RB)
Pivot index is aligned to the true pivot bar by subtracting the right lookback:
int pivot_idx = bar_index - DIV_RB
This ensures divergence bridges are anchored to the actual pivot points, not the later confirmation bar.
8) Price and RSI Pivot Pair Construction
When an RSI pivot is confirmed, the script creates a PivotPoint using:
Pivot bar index
Price at pivot bar (high for pivot high, low for pivot low)
RSI pivot value
RSI upper and lower ribbon bounds at the pivot
Examples:
float ph_price = high
PivotPoint curr_ph = PivotPoint.new(pivot_idx, ph_price, ph_rsi_val, ph_upper, ph_lower)
float pl_price = low
PivotPoint curr_pl = PivotPoint.new(pivot_idx, pl_price, pl_rsi_val, pl_upper, pl_lower)
9) Bearish Divergence Condition
The script checks regular bearish divergence by comparing the current RSI pivot high to the last stored RSI pivot high:
if curr_ph.price > this.last_ph.price and curr_ph.rsi_val < this.last_ph.rsi_val
draw_bridge(this, this.last_ph, curr_ph, false)
Interpretation:
Price prints a higher high
RSI prints a lower high
This is a classic regular bearish divergence condition.
10) Bullish Divergence Condition
The script checks regular bullish divergence by comparing the current RSI pivot low to the last stored RSI pivot low:
if curr_pl.price < this.last_pl.price and curr_pl.rsi_val > this.last_pl.rsi_val
draw_bridge(this, this.last_pl, curr_pl, true)
Interpretation:
Price prints a lower low
RSI prints a higher low
This is a classic regular bullish divergence condition.
11) 3D Divergence Bridge Construction
When divergence is detected, the script draws a bridge style annotation in the RSI pane:
Outer edge line uses the RSI upper boundary for bearish divergence or RSI lower boundary for bullish divergence
Center line connects the two RSI pivot values
Vertical pillar lines connect outer edge to center at both pivots
A label is placed near the midpoint reading Bull Div or Bear Div
Key logic:
float y1 = is_bullish ? p1.rsi_lower : p1.rsi_upper
float y2 = is_bullish ? p2.rsi_lower : p2.rsi_upper
line.new(p1.index, y1, p2.index, y2, ...)
line.new(p1.index, y1, p1.index, p1.rsi_val, ...)
line.new(p2.index, y2, p2.index, p2.rsi_val, ...)
This gives divergence signals a depth themed appearance that matches the ribbon.
12) Object Cleanup and Performance Controls
To manage chart object limits, the script trims older ribbon objects when the stored ribbon segment count exceeds a threshold:
if this.lines_upper.size() > 480
line.delete(this.lines_upper.shift())
line.delete(this.lines_lower.shift())
line.delete(this.lines_vert.shift())
linefill.delete(this.fills.shift())
This helps maintain performance while preserving a large recent portion of the 3D ribbon.
13) Reference Levels and Background Zones
The script adds standard RSI reference lines:
hline(70, "OB Level", ...)
hline(30, "OS Level", ...)
hline(50, "Mid Level", ...)
It also shades the upper and lower extreme zones with subtle fills:
fill(obLine, plot(100, display=display.none), color=color.new(COL_OB, 95))
fill(osLine, plot(0, display=display.none), color=color.new(COL_OS, 95))
These layers provide familiar RSI context beneath the 3D visuals. Indicator

Adaptive Finite Volume Elements [UAlgo]Adaptive Finite Volume Elements (AFVE) is an enhanced, volatility-adaptive interpretation of the classic Finite Volume Elements concept. The indicator transforms raw volume into a directional volume-flow oscillator by evaluating whether each bar’s “money flow impulse” is meaningful enough to be considered bullish, bearish, or noise. Instead of using a fixed percentage threshold, AFVE uses an ATR-based cutoff that expands and contracts with market volatility. This allows the signal to remain responsive in slow conditions while avoiding excessive whipsaws during high-volatility phases.
AFVE is designed as a practical workflow tool rather than a purely academic oscillator. It provides three layers of information in one pane:
1) A smoothed, normalized AFVE line that represents net volume flow as a percentage.
2) A signal line used for reversal detection in extreme zones.
3) A divergence engine that scans recent pivots and highlights classical bullish and bearish divergences between price and AFVE.
The script also implements a lightweight “engine” architecture using Pine v6 types and methods. This keeps the logic modular, improves readability, and enables controlled memory management for pivot history.
🔹 Features
1) Volatility Adaptive Cutoff (ATR-Based Noise Filter)
AFVE replaces fixed thresholds with a dynamic cutoff derived from ATR. This means the indicator automatically adapts to changing volatility regimes. In calm markets, smaller impulses can still be recognized as meaningful. In fast markets, minor fluctuations are filtered out as noise, reducing false volume-flow flips.
2) Directional Volume Flow Classification
Each bar is classified into one of three states based on the money flow impulse versus the adaptive cutoff:
- Bullish flow: full positive volume is counted.
- Bearish flow: full negative volume is counted.
- Neutral flow: volume is ignored if the impulse is inside the cutoff band.
This produces a cleaner oscillator that focuses on decisive participation rather than constant micro-changes.
3) Normalized Oscillator Output
AFVE is normalized by total volume over the lookback period, then scaled to a percentage. This keeps the output comparable across symbols and timeframes, since it expresses net flow relative to total activity.
4) Optional Smoothing
A selectable EMA smoothing stage is provided. Smoothing reduces jitter and makes trend and reversal structures clearer, while still preserving responsiveness when set to low values.
5) Signal Line Reversal Logic in Extreme Zones
A simple moving average of AFVE is used as a signal line. Reversal markers are produced only when crosses occur in statistically meaningful regions:
- Bullish reversal: AFVE crosses above the signal line while the signal line is below the negative threshold (oversold regime).
- Bearish reversal: AFVE crosses below the signal line while the signal line is above the positive threshold (overbought regime).
This design reduces “mid-range” crosses that tend to be less actionable.
6) Divergence Detection Using Pivot Memory
The script maintains small rolling arrays of recent pivot highs and pivot lows in AFVE (up to 5 each). When a new pivot is confirmed:
- Bearish divergence is flagged if price makes a higher high while AFVE makes a lower high.
- Bullish divergence is flagged if price makes a lower low while AFVE makes a higher low.
The script draws both the oscillator divergence line and the corresponding dashed price line on the main chart (force overlay), allowing fast visual confirmation.
7) Dynamic Coloring and Gradient Fill
AFVE is colored based on both sign and momentum:
- Above zero and rising: strong bullish color.
- Above zero but weakening: faded bullish color.
- Below zero and falling: strong bearish color.
- Below zero but weakening: faded bearish color.
A split fill system paints positive and negative regions separately for clear regime identification.
🔹 Calculations
1) Typical Price and Money Flow Impulse
AFVE starts from typical price and a money-flow style impulse that reacts to both bar structure and short-term change in typical price:
float tp = hlc3
float mf = close - (high + low) / 2 + tp - tp
Interpretation:
- close - (high + low) / 2 measures where the close sits relative to the bar’s midpoint.
- tp - tp adds a short-term directional component based on typical price change.
- Combined, mf becomes a compact impulse term that helps decide whether volume should be counted as bullish, bearish, or ignored.
2) Adaptive Cutoff Using ATR
Instead of using a fixed cutoff, AFVE scales the cutoff by ATR for the selected period:
float volatility = ta.atr(period)
float cutoff = volatility * cutoff_factor
Interpretation:
- Higher volatility increases the cutoff, requiring stronger impulses to classify volume as directional.
- Lower volatility reduces the cutoff, allowing smaller but meaningful impulses to be recognized.
3) Volume Flow Decision (Directional or Neutral)
Volume is converted into a signed flow value using the impulse versus cutoff comparison:
float v_flow = 0.0
if mf > cutoff
v_flow := volume
else if mf < -cutoff
v_flow := -volume
else
v_flow := 0.0
Interpretation:
- If mf exceeds +cutoff, the bar’s volume is treated as bullish participation.
- If mf is below -cutoff, volume is treated as bearish participation.
- Otherwise, volume is ignored to reduce noise in choppy conditions.
4) Summation, Normalization, and Scaling
AFVE is calculated as net directional flow relative to total volume over the lookback:
float fve_raw = math.sum(v_flow, period) / math.sum(volume, period) * 100
Interpretation:
- math.sum(v_flow, period) represents net signed participation.
- math.sum(volume, period) represents total activity.
- The ratio produces a bounded percentage-style oscillator.
5) Optional EMA Smoothing
A smoothing stage is applied if smoothness is greater than 1:
float fve_final = smooth > 1 ? ta.ema(fve_raw, smooth) : fve_raw
Interpretation:
- Low smoothing values keep AFVE responsive.
- Higher smoothing values produce cleaner swings and clearer divergence structures.
6) Signal Line and Extreme-Zone Reversal Conditions
A simple moving average is used as the signal line, and reversal triggers require both a cross and an extreme regime:
float signal_line = ta.sma(fve_value, i_sig_len)
bool is_oversold = signal_line < -i_rev_trsh
bool is_overbought = signal_line > i_rev_trsh
bool bull_rev = ta.crossover(fve_value, signal_line) and is_oversold
bool bear_rev = ta.crossunder(fve_value, signal_line) and is_overbought
Interpretation:
- The threshold defines when the market is treated as stretched.
- Crosses are only considered “reversal-grade” when they occur in these zones.
7) Pivot Detection and Divergence Logic
AFVE pivots are detected using a fast pivot rule (left 2, right 1). When a pivot is confirmed, the script stores it in memory and compares it to the prior pivot:
Pivot High and bearish divergence:
float ph = ta.pivothigh(current_fve, 2, 1)
if not na(ph)
Pivot p = Pivot.new(current_fve , high , bar_index )
high_pivots.unshift(p)
if high_pivots.size() > 5
high_pivots.pop()
if high_pivots.size() >= 2
Pivot p0 = high_pivots.get(0)
Pivot p1 = high_pivots.get(1)
if p0.price > p1.price and p0.val < p1.val
// Bearish Divergence
Interpretation:
- Price higher high (p0.price > p1.price) combined with AFVE lower high (p0.val < p1.val) flags bearish divergence.
Pivot Low and bullish divergence:
float pl = ta.pivotlow(current_fve, 2, 1)
if not na(pl)
Pivot p = Pivot.new(current_fve , low , bar_index )
low_pivots.unshift(p)
if low_pivots.size() > 5
low_pivots.pop()
if low_pivots.size() >= 2
Pivot p0 = low_pivots.get(0)
Pivot p1 = low_pivots.get(1)
if p0.price < p1.price and p0.val > p1.val
// Bullish Divergence
Interpretation:
- Price lower low (p0.price < p1.price) combined with AFVE higher low (p0.val > p1.val) flags bullish divergence.
8) Dynamic Coloring Logic
The AFVE line color reflects both direction (above/below zero) and momentum (rising/falling vs previous value):
val > 0
? (val > val ? bull : color.new(bull, 40))
: (val < val ? bear : color.new(bear, 40))
Interpretation:
- Strong color indicates acceleration in the prevailing direction.
- Faded color indicates weakening momentum, often useful for reading transitions and potential divergence setups. Indicator

Indicator

Indicator

Hidden Zone Detector AI - Crypto/Forex/StockHidden Zone Detector AI - Crypto Forex Stock
Hidden Zone Detector AI is a professional PulseWire indicator designed to find hidden supply and demand zones across markets — crypto, forex and stocks — and surface high-probability areas earlier than classical pivot-only methods. It combines price structure analysis, volatility/ATR sizing, volume profiling and multi-mode AI heuristics (Fast / Balanced / Accurate) to generate prediction zones, highlight tested areas, and visually mark zone breakouts. Built with practical trader workflow in mind: configurable anti-repaint options, adaptable Light/Dark UI, clear labels, and candle-coloring for immediate visual context.
How it works
• Detects hidden zones by scanning pivot formations and finding internal “hidden” bars that represent real institutional activity (not just visible swing points).
• Scores zones by size (ATR-relative), volume, and touch characteristics to produce a strength percentage (Weak/Medium/Strong).
• AI heuristics aggregate price, momentum, moving averages, RSI/MACD signals and volume patterns to propose prediction zones — adjustable for speed vs. accuracy.
• Zones are drawn as persistent boxes with optional midlines, labels, and tailored styling when broken or tested.
Main advantages
• Early edge: finds hidden zones that often act before obvious pivots.
• Actionable visuals: labeled zones, color-coded candles, and breakout styling speed decision-making.
• Flexible AI modes: choose Fast for responsiveness, Balanced for day-to-day use, or Accurate for stricter signals.
• Anti-repaint controls: require confirmed bars for predictions to improve signal reliability.
• Multi-market ready: tuned for crypto, forex and stock chart behavior.
• Light/Dark friendly: UI color handling ensures labels remain readable on any chart background.
• Open & reusable: released under Mozilla Public License 2.0 (MPL-2.0) — use and adapt freely with attribution.
Best practices & tips
• Start with Balanced mode and sensitivity ~5; increase sensitivity for earlier but noisier predictions.
• Use prediction confirmation (Require AI Prediction Confirmation) for lower repaint risk.
• Combine zone reads with higher-timeframe context and orderflow/volume tools for stronger entries.
• Adjust max active zones and opacity to keep charts clean on lower timeframes.
License & author
Mozilla Public License 2.0 (MPL-2.0).
Author: a_jabbaroff — created with care for the PulseWire community and fellow traders. Indicator

Indicator

Turbo Oscillator [RunRox]Introducing Turbo Oscillator by RunRox, our new indicator that combines a multitude of useful and unique features, which we will detail in this post.
List of Advanced Technologies:
Real-Time Divergences: Detects discrepancies between price movements and oscillator indicators to forecast potential price reversals.
Real-Time Hidden Divergences: We identify hidden divergences in real-time. These are not the standard type of divergences; they are opposite to regular divergences, providing unique insights into potential market movements.
Overbought and Oversold Zones: Identifies areas where the market is potentially overextended, suggesting possible entry and exit points.
Signal Line: Indicates the market direction, helping traders to quickly understand current trends.
Money Flow Histogram: Shows the flow of money into and out of the market, providing insights into buying and selling pressure.
Predicted Reversal Zones: Pinpoints areas where the market might experience reversals, aiding in strategic planning and risk management. These zones also serve as potential areas for taking profits, enhancing their utility for exit strategy planning.
Customizable Alerts: You can flexibly set up alerts for any events detected by our indicator, ensuring you stay informed about critical market movements.
To begin with, I would like to describe the difference between classic divergences and hidden divergences.
As you can see, these are opposite situations. Our oscillator identifies both types of divergences and displays them in real-time.
Divergences can serve as points where the price might reverse in the opposite direction, making both classic and hidden divergences powerful tools for spotting reversal points. I'll show a few examples of how divergences are used in our oscillator.
Classic Divergences - which we identify in real-time. As you can see, the price often reacts strongly to the formation of these divergences, frequently changing its direction.
Hidden Divergences - we also observe frequent movement in the opposite direction on the chart. The advantage of our indicator is that we show divergences in real-time without delays, allowing you to react immediately to trend changes.
Overbought and Oversold Zones - These zones allow you to see trend changes when the price is clearly overbought or oversold. When the color changes from a contrasting shade to a neutral one, you can observe the trend shift. The lines work by combining the positivity/negativity of the histogram, the positivity/negativity of the signal line, and the direction of the signal line (red/green). This sophisticated interaction provides precise insights into market conditions, making it an invaluable tool for traders.
Signal Line - This provides insights into trend changes and price reversals. The points on the line better indicate the beginning of a trend shift. These points can vary in size, offering a clearer understanding of the strength of the emerging trend. This feature works in combination with RSI, Stochastic, and MFI. RSI and MFI are top-tier indicators, while Stochastic adds responsiveness and sensitivity to trend changes, ensuring you capture every market movement accurately and promptly.
Money Flow Histogram - As shown in the example, our histogram displays the divergence between money flow and the actual price. You can see that while the price is rising, the money flow is decreasing, indicating insufficient demand for the asset and an imminent trend change. This feature uses MFI with an extended period, providing a more comprehensive and accurate analysis of market conditions. The extended period enhances the reliability of the Money Flow Index, making it an essential tool for identifying subtle shifts in market dynamics.
Predicted Reversal Zones - We automatically identify potential price reversal zones and display them above our overbought and oversold zones. In cases of strong overbought or oversold conditions, we detect potential price pullbacks and mark the beginning of a trend change. This helps you better identify trend shifts. We recommend considering these zones as potential take profit points for your trades.
Customizable Alerts - Our flexible alert system allows you to receive notifications only for the events you are interested in. These can include:
1. Classic Divergences
2. Hidden Divergences
3. Overbought or Oversold conditions on the status line
4. Strong Overbought or Oversold conditions on the status line
5. Signals from the signal line
6. Reversal zones in any direction
Our oscillator is a unique indicator that provides a comprehensive understanding of price movements. It can be used as a standalone tool for analyzing price action.
Here are a few examples of using our Oscillator in practice:
In the example above, you can see three conditions that have formed for a potential trade:
1. Clear overbought condition with a formed reversal point.
2. Decreasing Money Flow Index diverging from the rising price.
3. Formed classic divergence.
The entry point could be the formed divergence, while the exit point could be the overbought condition at the bottom of the oscillator along with the reversal points.
Here's another example of using hidden divergence, where you can see three conditions for a potential trade:
1. Overbought zone
2. Formed hidden divergence
3. Start of bearish movement indicated by the signal line
You can enter the trade either when the hidden divergence forms or wait for confirmation of the trend change by the signal line and enter the trade when the corresponding signal forms on the signal line. The exit point could be the opposite reversal point or the formation of a new hidden divergence.
We have demonstrated a few examples of how you can use our indicator, but we are confident that you will find many more applications in your own strategies.
Oscillator offers a variety of customizable parameters to tailor the indicator to your trading preferences. Here’s what our settings include:
Signal Line
Turn On/Off: Enable or disable the signal line.
Length: Set the length period for the signal line calculation.
Smooth: Adjust the smoothing level of the signal line for more accurate display.
Histogram
Turn On/Off: Enable or disable the histogram.
Length: Set the length period for the histogram calculation.
Smooth: Adjust the smoothing level of the histogram.
Other
Show Divergence Line: Display divergence lines on the chart.
Show Hidden Divergence: Display hidden divergences.
Show Status Line: Show the status line indicating overbought or oversold conditions.
Show TP Signal: Display signals for take profit.
Show Reversal Points: Display potential trend reversal points.
Delete Broken Divergence Lines: Remove broken divergence lines from the chart.
Alerts Customization
Signal Line Bull/Bear: Set alerts for bullish or bearish signals from the signal line.
TP Bull/Bear: Set alerts for take profit signals.
Status Bull/Bear: Set alerts for bullish or bearish status conditions.
Status Bull+/Bear+: Set enhanced alerts for stronger bullish or bearish status conditions.
Divergence Bull/Bear: Set alerts for bullish or bearish divergences.
Hidden Divergence Bull/Bear: Set alerts for hidden bullish or bearish divergences.
With these comprehensive settings, you can fine-tune the Oscillator to perfectly fit your trading strategy and preferences.
Our indicator utilizes technologies such as RSI, Stochastic, and Money Flow Index, with numerous enhancements from our team. It includes exclusive features such as real-time detection of hidden and classic divergences, identification of reversal points using our unique methodology, and much more.
Disclaimer:
While we consider our Turbo Oscillator to be an excellent tool, it is important to understand that past performance is not indicative of future results. We recommend approaching market analysis comprehensively, using a combination of tools and techniques to make well-informed trading decisions. Always consider the full range of market data and risks when using any trading indicator. Indicator

Indicator

Indicator

Zigzag Trend/Divergence DetectorPullbacks are always hardest part of the trade and when it happen, we struggle to make decision on whether to continue the trade and wait for recovery or cut losses. Similarly, when an instrument is trending well, it is often difficult decision to make if we want to take some profit off the table. This indicator is aimed to make these decisions easier by providing a combined opinion of sentiment based on trend and possible divergence.
⬜ Process
▶ Use any indicator to find trend bias. Here we are using simple supertrend
▶ Use any oscillator. I have added few inbuilt oscillators as option. Default used is RSI.
▶ Find divergence by using zigzag to detect pivot high/low of price and observing indicator movement difference between subsequent pivots in the same direction.
▶ Combine divregence type, divergence bias and trend bias to derive overall sentiment.
Complete details of all the possible combinations are present here along with table legend
⬜Chart Legend
C - Continuation
D - Divergence
H - Hidden Divergence
I - Indeterminate
⬜ Settings
▶ Zigzag parameters : These let you chose zigzag properties. If you check "Use confirmed pivots", then unconfirmed pivot will be ignored in the table and in the chart
▶ Oscillator parameters : Lets you select different oscillators and settings. Available oscillators involve
CCI - Commodity Channel Index
CMO - Chande Momentum Oscillator
COG - Center Of Gravity
DMI - Directional Movement Index (Only ADX is used here)
MACD - Moving average convergence divergence (Can chose either histogram or MACD line)
MFI - Money Flow Index
MOM - Momentum oscillator
ROC - Rate Of Change
RSI - Relative Strength Index
TSI - Total Strength Index
WPR - William Percent R
BB - Bollinger Percent B
KC - Keltner Channel Percent K
DC - Donchian Channel Percent D
ADC - Adoptive Donchian Channel Percent D ( Adoptive-Donchian-Channel )
▶ Trend bias : Supertrend is used for trend bias. Coloring option color candles in the direction of supertrend. More option for trend bias can be added in future.
▶ Stats : Enables you to display history in tabular format.
Overview of settings present here:
⬜ Notes
Trend detection is done only with respect to previous pivot in the same direction. Hence, if chart has too many zigzags in short period, try increasing the zigzag length or chart timeframe. Similarly, if there is a steep trend, use lower timeframe charts to dig further.
Oscillators does not always make pivots at same bar as price. Due to this some the divergence calculation may not be correct. Hence visual inspection is always recommended.
⬜ Possible future enhancements
More options for trend bias
Enhance divergence calculation. Possible options include using oscillator based zigzag as primary or using close prices based zigzag instead of high/low.
Multi level zigzag option - Can be messy to include more than one zigzag. Option can be added to chose either Level1 or Level2 zigzags.
Alerts - Alerts can only be added for confirmed pivots - otherwise it will generate too many unwanted alerts. Will think about it :)
If I get time, I will try to make a video. Indicator

Strategy

Indicator

Indicator

Indicator

Indicator

Divergences for many indicators v2.0A gift from me to all.
This script is developed to find Divergences for many indicators. it analyses divergences and then draws line on the graph. red for negatif, lime for positive divergences.
Currently script checks divergence for RSI, MACD, MACD Histogram, Stochastic, CCI, Momentum, OBV, Diosc, VWMACD and CMF indicators. You can use some or all of these indicators to check divergences as you wish by choosing them on the menu. Also you can add/remove many other indicators to the script to check if there is divergence.
The script first calculates tops/bottoms by using higher time frame zig zag and then finds divergences.
Higher Time Frames are
if currend period 1 min => HTF = 5 mins
if currend period 3 mins => HTF = 15 mins
if currend period 5 mins => HTF = 15 mins
if currend period 15 mins => HTF = 1 hour
if currend period 30 mins => HTF = 1 hour
if currend period 45 mins => HTF = 1 hour
if currend period 1 hour => HTF = 4 hours
if currend period 2 hours => HTF = 4 hours
if currend period 3 hours => HTF = 4 hours
if currend period 4 hours => HTF = 1 day
if currend period 1 day => HTF = 1 week
if currend period 1 week => HTF = 1 week
future plan : script finds regular divergences, soon I will add hidden divergences and also I plan to add alert ;)
Indicator

Indicator
