Hidden Divergence Continuation Zones [AGPro Series]Hidden Divergence Continuation Zones
🟦 Overview
Hidden Divergence Continuation Zones is a focused trend-continuation indicator built around one specific market behavior: hidden divergence that forms during a structured pullback inside an existing directional move.
Most divergence tools are built to search for reversals. They scan regular bullish and bearish divergence, print many labels, and often mix every oscillator event into the same visual map. This script intentionally takes a narrower lane. It does not try to be a general divergence scanner. It looks only for hidden bullish and hidden bearish divergence, because hidden divergence is most useful when the question is not "is the trend ending?" but "is the trend trying to continue after a controlled pullback?"
The result is a cleaner continuation framework:
- confirmed price swing structure
- RSI momentum displacement
- EMA and DMI trend filtering
- ATR-normalized quality scoring
- lower-intensity HDC Watch labels
- forward continuation pockets
- swing connectors
- trigger labels
- compact AGPro dashboard
The purpose is to make hidden continuation structure visible without filling the chart with every possible divergence mark.
🔹 What Makes This Different
This script is separated from both common public divergence tools and our existing AGPro divergence family by design.
It is not a multi-oscillator regular divergence stack. It does not score RSI, MACD, CCI, MFI, and OBV together. That lane is already covered by broader stack-style divergence tools.
It is not an OBV pressure divergence map. It does not study price-versus-participation disagreement through cumulative volume pressure.
It is not a trend dashboard with divergence added as a side feature.
Hidden Divergence Continuation Zones focuses on a single continuation workflow:
1. Confirm that the market has an active directional side.
2. Wait for a valid pullback swing.
3. Compare the new swing against the previous swing.
4. Accept only hidden divergence that supports continuation.
5. Draw a forward pocket from the continuation pivot.
6. Track whether price later triggers from that structure.
That narrow scope is the edge. The script is designed to avoid visual noise and avoid conceptual overlap.
🧭 Core Logic
Bullish hidden continuation:
- the trend filter must support a bullish continuation environment
- price must form a confirmed higher low
- RSI must form a lower low against that higher price low
- the two compared swings must be separated by enough bars
- the structure must be large enough relative to ATR
- the RSI displacement must clear the minimum threshold
- the final continuation score must pass the display threshold
Bearish hidden continuation:
- the trend filter must support a bearish continuation environment
- price must form a confirmed lower high
- RSI must form a higher high against that lower price high
- the two compared swings must be separated by enough bars
- the structure must be large enough relative to ATR
- the RSI displacement must clear the minimum threshold
- the final continuation score must pass the display threshold
The script uses confirmed pivots, so events appear only after the pivot is structurally available. This keeps the logic stable and prevents premature labels from appearing on incomplete swings.
📐 Continuation Score
Each qualified setup is graded with a 0 to 100 continuation score.
The score combines:
- ADX strength above the selected minimum
- ATR-normalized distance between the compared swings
- RSI displacement between the two pivot points
- whether the pullback sits in a continuation-relevant EMA area
- whether the fast and slow EMA structure remains aligned
The default thresholds are designed to keep the chart selective. Normal qualified events are shown as HDC+ or HDC-. Stronger events are shown as PRIME HDC+ or PRIME HDC-.
Lower-intensity confirmed hidden divergence candidates can also be displayed as HDC WATCH labels. These marks are intentionally softer: they add visual context and keep the chart informative, but they do not create continuation pockets or trigger tracking unless the full continuation threshold is reached.
🧩 Continuation Pockets
When a hidden continuation event qualifies, the script projects a forward pocket from the pivot area.
These pockets are not generic support and resistance boxes. They are continuation context zones tied directly to the hidden divergence pivot. Their job is to preserve the important pullback area on the chart after the label appears, so the user can see where the continuation structure was created.
Pocket height is ATR-based, which helps the zones adapt across symbols and timeframes. The number of visible pockets is capped, so older structures are automatically removed and the chart remains clean.
🎯 Trigger Labels
After a hidden divergence pocket is created, the script monitors a limited trigger window.
For bullish continuation, a trigger is printed only when price confirms above the pivot candle reference with the selected ATR buffer.
For bearish continuation, a trigger is printed only when price confirms below the pivot candle reference with the selected ATR buffer.
This keeps the workflow organized:
- hidden divergence creates the continuation pocket
- the pocket defines the structure
- the trigger label marks follow-through from that structure
⚙️ Dashboard
The AGPro panel is built for quick reading:
- Oscillator: current RSI value
- Trend Side: bullish continuation, bearish continuation, or neutral
- Swing Quality: none, building, qualified, or prime
- Continuation Score: latest event score
- Active Pocket: current pocket state and freshness
The first panel row follows the AGPro standard: one merged blue header row with only the script title. Panel location, panel theme, label font size, and panel font size are all adjustable from settings.
🧪 Practical Reading
A clean bullish continuation sequence usually looks like this:
1. Trend Side shows Bull Continuation.
2. Price pulls back and forms a confirmed higher low.
3. RSI makes a lower low at that swing.
4. A continuation pocket appears below/around the pullback area.
5. A trigger label appears only if price follows through during the trigger window.
A clean bearish continuation sequence usually looks like this:
1. Trend Side shows Bear Continuation.
2. Price pulls back and forms a confirmed lower high.
3. RSI makes a higher high at that swing.
4. A continuation pocket appears above/around the pullback area.
5. A trigger label appears only if price follows through during the trigger window.
The best use case is structured trend continuation study, especially when a trader wants to separate controlled pullbacks from random oscillator divergence noise.
🔍 Key Inputs
Trend Continuation Filter:
- Fast EMA Length
- Slow EMA Length
- EMA Slope Lookback
- DMI Length
- ADX Smoothing
- Minimum ADX
Hidden Divergence Engine:
- RSI Length
- Confirmed Pivot Length
- Minimum Pivot Separation
- Minimum Price Swing (ATR)
- Minimum RSI Displacement
- Minimum Continuation Score
- Prime Score Threshold
- Show HDC Watch Labels
- Watch Label Score
Continuation Pockets:
- Show Continuation Pockets
- Pocket Extension Bars
- Pocket Height (ATR)
- Maximum Visible Pockets
- Trigger Window Bars
- Trigger Buffer (ATR)
Visual Layout:
- EMA Backbone
- Swing Connectors
- Event Labels
- Same-Side Label Cooldown
- Label Offset
- Label Font Size
- Maximum Visible Labels
- Maximum Visible Connectors
Panel:
- Show Panel
- Panel Location
- Panel Theme
- Panel Font Size
🟣 Design Notes
The visual design is intentionally restrained:
- no regular divergence clutter
- no multi-oscillator table overload
- no unnecessary signal spam
- no permanent background wash
- no oversized dashboard
- no generic zone engine detached from the core concept
The chart should stay readable while still feeling active and premium. Swing connectors explain where the hidden divergence came from. Pockets preserve the continuation area. Labels are offset from candles and controlled by cooldown settings.
✨ Summary
Hidden Divergence Continuation Zones is built for traders who want a cleaner way to study trend continuation through hidden divergence.
Instead of asking whether every oscillator disagreement matters, this tool asks a more specific question:
Is there a confirmed hidden divergence pullback inside a real trend, and did that structure create a continuation pocket worth tracking?
That focused question is what keeps the script distinct, lightweight, and visually clean.
Indicator

Deviation Lens [JOAT]Deviation Lens
Introduction
Deviation Lens is an open-source multi-dimensional statistical displacement tool that applies Z-Score analysis simultaneously to three market dimensions: price level, close-to-close price change, and volume. Rather than using arbitrary overbought/oversold thresholds derived from historical maxima and minima, Deviation Lens computes exactly how many standard deviations each dimension is from its recent rolling mean. This provides a precise, adaptive, distribution-aware measure of how statistically extreme current market conditions are.
The core insight is that markets are mean-reverting systems over short time horizons. Statistical extremes — conditions where price, momentum, or volume are far from their recent averages — represent transient states. The further from the mean, the greater the statistical probability that conditions will normalize. Deviation Lens quantifies this probability directly, from 0% (at the mean) to 99.7% (at three standard deviations), and displays it as a live reversal probability for every bar.
Core Concepts
1. Three-Dimensional Z-Score Calculation
Three independent Z-Scores are computed on every bar:
The Price Z-Score measures how far the current close is from the rolling mean close in standard deviation units. This captures whether the current price level is statistically cheap or expensive relative to recent history.
The Change Z-Score measures how far the current bar's close-to-close price change is from the rolling mean change — quantifying momentum extremity rather than price level extremity.
The Volume Z-Score measures how far the current volume is from the rolling mean volume. High-volume Z-Score values identify bars where unusual institutional participation is statistically evident:
priceZ = priceStd > 0 ? (close - priceMean) / priceStd : 0.0
changeZ = changeStd > 0 ? (chg - changeMean) / changeStd : 0.0
volumeZ = volStd > 0 ? (volume - volMean) / volStd : 0.0
2. Reversal Probability Mapping
The absolute Z-Score is mapped to a reversal probability percentage based on the properties of the normal distribution. A Z-Score of 1.0 corresponds to 68.3% of values lying within one standard deviation — meaning only 31.7% of readings exceed this level, implying a 68.3% probability of mean reversion. A Z-Score of 2.0 corresponds to 95.4%, and 3.0 to 99.7%:
calcRevProb(float z) =>
float absZ = math.abs(z)
absZ >= 3.0 ? 99.7 : absZ >= 2.5 ? 98.8 : absZ >= 2.0 ? 95.4 : absZ >= 1.5 ? 86.6 : absZ >= 1.0 ? 68.3 : absZ >= 0.5 ? 38.3 : 0.0
This probability is displayed in the dashboard alongside the live Z-Score value, giving the trader both the raw statistical reading and its corresponding reversal likelihood.
3. Composite Z-Score and Zone Classification
The three individual Z-Scores are combined into a composite score using configurable weights for each dimension. The composite is then classified into a zone: EXTREME (above the configurable extreme threshold), ELEVATED, NEUTRAL, or the opposing directional equivalents. Zone classification determines the dashboard color coding and alert triggers:
composite = (priceZ * wPrice + changeZ * wChange + volumeZ * wVolume) / totalWeight
4. Divergence and Hidden Divergence Detection
Deviation Lens monitors for two divergence conditions. Standard divergence occurs when the Z-Score direction disagrees with the price direction — price makes a higher high but the Z-Score makes a lower high (bearish divergence), or price makes a lower low but the Z-Score makes a higher low (bullish divergence). Hidden divergence occurs when the Z-Score makes an extreme move while price action is relatively contained — a potential continuation pattern. Divergence events are labeled directly on the chart with bold, clearly sized labels:
bullDiv = close > close and priceZ < priceZ // Price up, Z down = bull div
bearDiv = close < close and priceZ > priceZ // Price down, Z up = bear div
Labels: BULL DIV, BEAR DIV (size.small), H.BULL, H.BEAR (size.tiny for hidden divergence).
5. Multi-Dimensional Dashboard
The institutional dashboard presents all three Z-Scores, the composite Z-Score, current zone classification, reversal probability, and divergence status simultaneously. The layout is designed so the most actionable information — Zone and Rev. Probability — is displayed at the largest text size, with supporting metrics at smaller sizes.
Features
Three independent Z-Scores: Price level, price change (momentum), and volume — each computed on its own rolling mean and standard deviation
Configurable Z-Score weights: The composite score uses adjustable per-dimension weights allowing emphasis on price, momentum, or volume depending on trading context
Live reversal probability: Probability percentage mapped directly from the Z-Score using normal distribution properties (68.3% at 1σ through 99.7% at 3σ)
Zone classification: Composite Z-Score classified as Extreme, Elevated, or Neutral in both directions with color-coded dashboard display
Divergence labels (BULL DIV / BEAR DIV): Z-Score vs price direction disagreement labeled on-chart at size.small
Hidden divergence labels (H.BULL / H.BEAR): Z-Score extreme with contained price action labeled at size.tiny
Configurable extreme and elevated thresholds: Both Z-Score thresholds independently adjustable
Institutional dashboard (top right): 14-row table with Price Z, Change Z, Volume Z, Composite Z, Zone, Reversal Probability, and divergence status
Adaptive thresholds: All calculations normalize to the rolling lookback period, adapting to current instrument and timeframe volatility
Alerts: Separate alertconditions for extreme bull and extreme bear composite Z-Score readings
Input Parameters
Z-Score Settings:
Z-Score Length: Rolling window for all three Z-Score calculations (default: 20)
Extreme Threshold: Z-Score magnitude classified as Extreme zone (default: 2.0)
Elevated Threshold: Z-Score magnitude classified as Elevated zone (default: 1.0)
Dimension Weights:
Price Weight: Relative weight of the price Z-Score in composite (default: 1.0)
Change Weight: Relative weight of the momentum Z-Score in composite (default: 1.0)
Volume Weight: Relative weight of the volume Z-Score in composite (default: 0.5)
Divergence:
Divergence Lookback: Bars back for divergence comparison (default: 5)
Show Divergence Labels toggle
Display:
Show Dashboard toggle
Bull and Bear color inputs
How to Use This Indicator
Step 1: Read the Composite Zone
The Zone row in the dashboard shows the current composite Z-Score classification. EXTREME readings at the top of the scale indicate the highest statistical probability of mean reversion. NEUTRAL readings indicate current conditions are close to the mean and have low statistical directional edge from this tool alone.
Step 2: Check Reversal Probability
The Rev. Probability row translates the Z-Score magnitude directly into a percentage. A reading above 95% means the current composite Z-Score is in the outer 5% of its historical distribution — a statistical extreme that has preceded mean reversion 95% of the time in the measured period.
Step 3: Assess Each Dimension Independently
The three individual Z-Score rows reveal which dimension is driving the composite. A high composite driven entirely by volume Z-Score is a different setup than one driven by price Z-Score. Understanding which dimension is extreme helps filter entries: a price Z-Score extreme without supporting momentum or volume Z-Score extremes may be a lower-conviction reading.
Step 4: React to Divergence Labels
BULL DIV and BEAR DIV labels appear when Z-Score momentum diverges from price direction. These signal that the statistical driver of a move is weakening even as price continues. H.BULL and H.BEAR hidden divergence labels flag potential continuation setups where Z-Score is extreme but price is not.
Step 5: Combine with Structural Context
Deviation Lens produces the highest value when its extreme readings coincide with a structural confluence point — an order block, session low, or structure level. A 99.7% reversal probability at a tested support zone is a higher-conviction setup than the same reading in open air.
Indicator Limitations
All Z-Scores are computed relative to the rolling lookback window. The lookback defines what "normal" means. A very short lookback will produce extreme readings frequently; a very long lookback will rarely reach the extreme threshold. Calibration to the instrument and timeframe is required
The reversal probability percentages are derived from the normal distribution assumption. Price change and volume distributions are not perfectly normal — they exhibit fat tails and skew. The probabilities are approximations, not precise statistical guarantees
The composite Z-Score uses equal weights by default. Changing dimension weights significantly alters which market conditions produce extreme readings. Weight adjustments should be based on the specific instrument's characteristics
Divergence detection uses a simple lookback comparison, not a peak-detection algorithm. In choppy markets, divergence labels may appear frequently without providing actionable signals
Originality Statement
Deviation Lens is original in its simultaneous, weighted multi-dimensional Z-Score framework that maps composite statistical extremity directly to a reversal probability percentage. This indicator is published because:
Applying Z-Score analysis to three independent market dimensions simultaneously — price level, momentum (close-to-close change), and volume — rather than a single oscillator provides a richer statistical picture of current market extremity than any single-dimension Z-Score tool
The direct mapping of Z-Score magnitude to reversal probability percentages using normal distribution properties gives traders an immediately interpretable statistic rather than a raw number requiring subjective interpretation
The composite weighted Z-Score system, where each dimension's contribution to the overall reading is configurable, allows the indicator to be tuned toward price-mean-reversion strategies, momentum exhaustion strategies, or volume anomaly detection depending on the trader's methodology
The combined detection of standard divergence and hidden divergence between the Z-Score and price direction provides trend continuation and reversal signals from the same framework
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Z-Score readings and reversal probability percentages are statistical tools based on historical distributions and do not guarantee any future price behavior. The normal distribution assumption applied to price and volume data is an approximation. Always use proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
Indicator

Equilibrium Momentum Shift + Divegence [BigBeluga]🔵 OVERVIEW
Equilibrium Momentum Shift is a range-based momentum oscillator designed to measure how far price has deviated from its current equilibrium.
Instead of focusing purely on trend direction or overbought/oversold conditions, this indicator evaluates price relative to the midpoint of its recent range and quantifies the strength of the shift away from that balance.
By combining normalized range deviation, smoothing techniques, and nonlinear compression, the indicator provides a clear view of when markets transition from equilibrium into directional momentum, now featuring Normal Divergence detection to spot potential trend reversals.
🔵 CONCEPT
Equilibrium Midpoint — The midpoint between the highest high and lowest low over the selected range length represents the equilibrium price.
Deviation Measurement — The indicator measures how far the current price has moved away from this midpoint.
Range Normalization — Deviations are normalized relative to the size of the current range, allowing the oscillator to remain consistent across different volatility conditions.
Momentum Compression — A hyperbolic tangent function compresses extreme values, stabilizing the oscillator and preventing runaway signals during large trends.
Divergence Identification — Automatically identifies discrepancies between price action and the oscillator to highlight weakening momentum in established trends.
🔵 HOW IT WORKS
1️⃣ Equilibrium Range Calculation
The indicator calculates the highest high and lowest low over the user-defined range length.
The midpoint between these two levels forms the equilibrium line.
This midline represents the center of balance for recent price activity.
2️⃣ Price Deviation Measurement
The distance between the current close and the equilibrium midpoint is calculated.
This deviation is then smoothed using a double EMA structure to reduce noise.
The smoothed value is normalized relative to half of the current range size.
3️⃣ Nonlinear Oscillator Transformation
A hyperbolic tangent function compresses normalized deviations into a stable range between -1 and +1.
This transformation prevents extreme outliers and creates a more interpretable oscillator.
4️⃣ Momentum Histogram
A signal line is generated using EMA smoothing.
The difference between the oscillator and the signal line forms a histogram.
The histogram behaves similarly to a MACD-style momentum indicator:
Expanding bars indicate strengthening momentum.
Contracting bars indicate weakening momentum.
5️⃣ Normal Divergence Logic
Bullish Divergence: Occurs when price makes a Lower Low , but the Equilibrium Oscillator makes a Higher Low . This suggests that despite the price drop, the selling pressure relative to equilibrium is fading.
Bearish Divergence: Occurs when price makes a Higher High , but the Equilibrium Oscillator makes a Lower High . This indicates that the buyers' ability to push price away from the midpoint is losing strength.
🔵 KEY FEATURES
Equilibrium midpoint plotted directly on the chart.
Range-normalized momentum oscillator.
Hyperbolic tangent compression to stabilize signals.
MACD-style histogram for momentum acceleration detection.
Automatic Normal Divergence labels to spot exhaustion.
Gradient-colored oscillator line reflecting directional bias.
Dashboard displaying real-time momentum metrics.
🔵 DASHBOARD METRICS
Shift — Current oscillator value showing how far price has moved from equilibrium.
State — Market regime derived from oscillator thresholds:
Bullish
Bearish
Neutral
Range Position — Location of price inside the current range expressed as a percentage.
Pressure — Magnitude of momentum deviation from equilibrium.
🔵 HOW TO USE
Use the equilibrium midline as a dynamic balance reference.
When the oscillator moves above zero, bullish momentum dominates.
When the oscillator moves below zero, bearish momentum dominates.
Trading Divergences: Watch for divergence labels when price is at historical range extremes. A bullish divergence near the "Lowest Low" of the range suggests a high-probability mean-reversion trade back toward equilibrium.
Histogram expansions highlight momentum acceleration.
Histogram contraction can signal potential momentum exhaustion.
🔵 INTERPRETING MOMENTUM SHIFTS
Oscillator near zero → Market is balanced around equilibrium.
Oscillator above 0.2 → Bullish momentum phase.
Oscillator below -0.2 → Bearish momentum phase.
Divergence Label + Oscillator Flatline → High probability of a trend reversal or deep pullback.
Rapid oscillator expansion → Strong directional pressure.
Oscillator flattening → Momentum compression or consolidation.
🔵 CONCLUSION
Equilibrium Momentum Shift offers a structured way to analyze how price behaves relative to its recent balance point.
By measuring normalized deviations from equilibrium and visualizing momentum shifts with a smoothed oscillator, histogram, and integrated divergence analysis , the indicator helps traders identify when markets transition from balance into directional movement.
This makes it especially useful for spotting early momentum expansions, trend continuation signals, and potential exhaustion points where price is likely to snap back to its equilibrium midpoint. Indicator

Setup Quality Scorecard [AGPro Series]Setup Quality Scorecard
Setup Quality Scorecard grades every bar on a transparent 0-100 scale across ten independent confluence dimensions. Instead of another signal generator, it is a quality filter: it tells you how strong the current setup is, which factors are firing, and how often similar past setups have followed through. Works on any symbol, any timeframe.
🔹 OVERVIEW
Every trader has the same question before pulling the trigger: "Is this setup actually good, or am I forcing it?" Setup Quality Scorecard answers that question with a single auditable number. The composite score blends ten orthogonal factors — trend, momentum, volume, volatility, structure, S/R proximity, divergence, candle quality, session context, and higher-timeframe alignment — into a weighted 0-100 quality rating. Bars scoring above the A-Tier threshold are marked with support/resistance-style zones on the chart, so high-quality setup regions stay visible even as the market moves on.
🔹 UNIQUE EDGE
Most quality indicators hide their internals behind a black-box algorithm. This one is fully transparent. Every factor exposes its own 0-10 score in the panel, every factor weight is user-adjustable, and every historical signal is evaluated against a forward-looking hit-rate test. There are no secret filters, no proprietary confidence bands, and no cherry-picked backtest. If a setup scores 87, you can see exactly which factors contributed and which did not.
🔹 METHODOLOGY
Each of the ten factors is computed independently on the current bar and normalized to a 0-10 scale:
1. Trend Alignment — EMA 20/50/200 stack plus slope confirmation
2. Momentum — RSI zone position combined with 3-bar RSI delta
3. Volume Context — relative volume versus 20-period SMA, calibrated for real-world distribution
4. Volatility Regime — ATR percentile over the last 100 bars, favoring mid-range regimes
5. Structure — HH/HL or LH/LL confirmation via recent pivots
6. S/R Proximity — ATR-normalized distance to the nearest pivot level
7. Divergence — price-versus-RSI regular divergence captured at pivot time
8. Candle Quality — body-to-range ratio and wick balance
9. Session Context — active trading session weighting (London/NY overlap prioritized)
10. HTF Agreement — graduated higher-timeframe alignment scoring (full stack, partial stack, opposed regimes)
The ten factor scores are weighted by user-adjustable coefficients, summed, and normalized to produce the final 0-100 composite. Tier labels (S / A / B / C / D) are assigned against user-configurable thresholds.
🔹 SIGNALS AND ALERTS
When a bar crosses into A-Tier or higher, a zone is drawn using support/resistance-style geometry (body plus a small ATR cushion). Zones merge automatically when adjacent qualifying setups share the same directional bias, preventing chart clutter. Each zone is labeled with its tier and score in compact A·83 format, with a dotted leader line connecting the label to the zone edge.
Four built-in alert conditions are exposed:
- S-Tier Setup Detected (score crosses the S-Tier threshold)
- A-Tier Setup Detected (score crosses the A-Tier threshold)
- New Bullish Quality Setup (first A-tier bullish bar in a run)
- New Bearish Quality Setup (first A-tier bearish bar in a run)
🔹 KEY INPUTS
- General: Higher timeframe reference, rolling history window, forward evaluation bars
- Thresholds: S / A / B / C tier cutoffs, fully adjustable
- Factor Weights: ten independent sliders, 0.0 to 2.0, tune the scorer to your style
- Zones: adaptive extend (auto or manual), merge window, max height cap in ATR units, maximum age
- Labels: on-chart label mode (A-Tier only, S-Tier only, off), size presets
- Panel: position, size, factor breakdown toggle
🔹 HOW TO USE
Start with defaults and observe for a full session on your chart. Trend traders should raise the Trend and HTF Align weights. Reversal traders should raise Divergence, Structure, and S/R Proximity. Use the Active count in the panel as a quick filter: fewer than three factors above seven generally means a weak setup regardless of composite score. Use the hit-rate number to sanity-check whether your current configuration is performing on this asset and timeframe — if it is below 50 percent on a large sample, revisit your weight assignments.
🔹 LIMITATIONS AND TRANSPARENCY
The hit-rate metric is backward-looking. It measures how often past A-tier signals produced a one-ATR directional move within the next N bars. It is not a forecast of future performance. A hit rate with fewer than twenty signals is flagged with an info marker because the sample size is not yet statistically meaningful. Factor definitions are static — they do not adapt to regime changes automatically. Session weighting assumes standard crypto and equity session times in UTC; adjust if you are trading exotic hours. The script uses pivot-based structure, which lags by the pivot length on the right edge of the chart (a standard trade-off for noise suppression).
🔹 RISK DISCLOSURE
This indicator is an analytical tool, not financial advice. It does not predict future price movements. A high quality score does not guarantee a winning trade. Past performance of any displayed signal does not indicate future results. Always use proper risk management and position sizing. Never trade with capital you cannot afford to lose. Indicator

CVD Multi Exchange PercentileCVD Multi Exchange Percentile
Aggregated order flow across four major crypto derivatives exchanges — with historical percentile ranking to measure how extreme today's session really is.
A Cumulative Volume Delta (CVD) indicator with daily reset, divergence detection, and absorption signals, built for perpetual futures.
It combines Binance, Bybit, OKX, and Bitget into a single aggregated flow, then ranks it against its own history to give you objective context.
█ 🧩 KEY FEATURES
🔹 Multi Exchange Aggregation
Four sources (Binance, Bybit, OKX, Bitget) can be toggled independently. The aggregated delta captures cross-exchange order flow that single-source CVD cannot detect — especially during liquidations or arbitrage-driven moves.
🔹 Historical Percentile System
Each session's peak CVD is stored in a rolling buffer, separated by direction (bull vs bear). The current session is ranked against this distribution to measure how extreme the flow is compared to recent history.
🔹 Live Percentile
A real-time percentile tracks the current CVD value as the session develops — no need to wait for session close.
🔹 Swing Divergence
Detects divergences between price and CVD structure:
- Bullish: price makes lower low, CVD makes higher low
- Bearish: price makes higher high, CVD makes lower high
Filtered by percentile threshold and optional trend filter.
🔹 Volume Absorption
Highlights conditions where price and CVD move in opposite directions under high volume:
- Bullish absorption: price down, CVD up
- Bearish absorption: price up, CVD down
Requires elevated volume and percentile confirmation.
🔹 Visual Encoding
Histogram color reflects direction and momentum. Signal markers:
- Divergence bullish: dark green triangle up
- Divergence bearish: blue triangle down
- Absorption bullish: orange circle
- Absorption bearish: purple circle
Optional info table provides real-time stats.
Signal examples on TRXUSDT.P (1H) — three signal types visible:
- Orange circle (Absorption Bull): price dropping but CVD rising on high volume — buying pressure hidden under falling price
- Blue triangle (DIV- Bearish): price making higher high but CVD making lower high — selling pressure building despite rising price
- Purple circle (Absorption Bear): price rising but CVD falling on high volume — selling pressure hidden under rising price
Signal examples on ETHUSDT.P (1H) — bullish signals visible:
- Dark green triangles (DIV+ Bullish): price making lower lows but CVD making higher lows — buying pressure increasing despite falling price, signaling potential reversal
- Orange circle (Absorption Bull): same logic as above — hidden buying under selling candles
█ 🔧 HOW IT WORKS
The script fetches lower-timeframe OHLCV data from each exchange using `request.security_lower_tf()`.
Each intrabar volume is classified using a CLV-based model (close location within range) to estimate buying vs selling pressure. The resulting deltas are summed across all exchanges and accumulated into a daily CVD, resetting at the start of each new UTC session.
█ 📖 HOW TO USE
Apply the indicator to Perpetual Futures charts (.P).
The symbol is auto-detected from the chart and mapped across all supported exchanges — no manual input needed.
Suggested timeframe: 1H (default percentile lookback is 336 bars, which equals ~14 days on 1H charts).
Signals are contextual, not standalone triggers. Use them to identify:
- flow/price divergences
- potential absorption zones
- extreme participation conditions
█ ⚙️ SETTINGS
Data Sources (Perpetual Futures Only) — Enable/disable Binance, Bybit, OKX, Bitget
Settings — Intrabar precision (1/5/15/60), daily reset
Signals — Percentile lookback (default 336 bars, ~14 days on 1H), min percentile for divergence (75), swing length (8), trend filter SMA (20), absorption volume lookback (10) and multiplier (1.5), show/hide toggles for divergences, absorption, trend filter, and info table
█ 💡 WHAT MAKES THIS DIFFERENT
Most CVD indicators rely on a single exchange and lack statistical context.
This script aggregates flow across venues and ranks it using a percentile system, providing a clear measure of whether current activity is extreme or routine.
Bull and bear distributions are handled separately, avoiding distortion from mixed data.
█ ⚠️ LIMITATIONS
— Works only on perpetual futures (.P required)
— Delta is estimated from OHLCV, not tick-level order book data
— Exchange data availability may vary by symbol
— Intrabar resolution affects precision and performance
█ 📌 DISCLAIMER
This is a contextual analysis tool, not a signal generator.
It does not provide buy/sell signals and should not be used as a standalone trading system. Always apply proper risk management.
Indicator

Divergence Stack Scanner [AGPro Series]Divergence Stack Scanner
🔹 Overview
Divergence Stack Scanner scans five independent momentum and volume oscillators simultaneously — RSI, MACD Histogram, CCI, MFI, and OBV — and grades every confirmed pivot by how many of them show regular divergence at the same time. The result is a 0 to 5 STACK score that isolates rare, high-conviction reversal zones which single-divergence tools simply cannot surface.
Most divergence indicators track one oscillator at a time. Strong reversals, however, tend to leave fingerprints across momentum and volume at once. This tool quantifies that confluence in a single, objective number you can act on.
🔸 Unique Edge
What separates this script from the crowded divergence space:
1. Five-oscillator confluence in one engine — not one divergence, five divergences graded together.
2. Strict versus Window classification — a 5/5 STRICT stack (all five on the exact same pivot) is marked with a star flash, while a 5/5 WINDOW stack (all five within a small bar tolerance) is tagged separately. The distinction matters because strict stacks are statistically rarer and sharper.
3. Pressure Zones — a rectangular, SR-style zone is drawn forward from each qualifying pivot, so the reversal level stays visible long after the signal fires.
4. Rolling win-rate panel — the last N decided signals are evaluated N bars forward, and the win percentage is displayed live on the panel.
5. Per-oscillator live state — you see at a glance which oscillators are already in divergence and how long ago they triggered.
🔹 Methodology
Pivots are detected using the standard PulseWire pivot method with a configurable lookback (default 5 bars each side, confirmed, non-repainting).
When a pivot is confirmed, the script compares the current pivot price and oscillator value to the previous same-direction pivot:
- Regular bullish divergence: price prints a lower low while the oscillator prints a higher low.
- Regular bearish divergence: price prints a higher high while the oscillator prints a lower high.
This comparison runs independently for RSI, MACD Histogram, CCI, MFI, and OBV. Each oscillator stores the bar index of its most recent divergence. The stack engine then counts how many oscillators have fired within a tolerance window of the current pivot:
- Strict stack (window = 0): all counted oscillators fired on the exact same pivot bar.
- Window stack (window = 1 to N bars): oscillators fired within N bars of each other.
Pressure zones are drawn only when the stack meets a configurable minimum (default 4/5). Zone height is ATR-scaled so it stays proportional across instruments and timeframes. A proximity filter prevents label clutter: once a label is drawn in a given direction, a new label in the same direction within a short window is only drawn if its stack level is strictly higher.
🔸 Signals & Alerts
On-chart signals:
- ★ N/5 STACK label (filled color) — strict same-bar stack at level N.
- N/5 NEAR label (lighter color) — window stack (near-miss of strict).
- Pressure zone rectangle — drawn forward from the pivot for qualifying stacks.
Alerts available:
- 5/5 Strict Stack (bull and bear, separate) — the rarest and sharpest signal.
- Minimum Stack threshold — fires whenever the stack reaches your configured minimum level.
All alerts use alert.freq_once_per_bar_close and include ticker plus timeframe in the message.
🔹 Key Inputs
Core Engine:
- Pivot Lookback — bars each side to confirm a pivot (default 5).
- RSI, MACD, CCI, MFI lengths — standard defaults, all configurable.
Stack Configuration:
- Minimum Stack Level — display threshold (default 3/5).
- Window Tolerance — bar tolerance for near-stacks (default 3).
- Win-Rate Lookback — number of recent signals used for rolling win rate (default 20).
- Win Evaluation Bars — forward bars to decide win or loss (default 10).
Pressure Zones:
- Minimum Stack for Zone (default 4/5) — keeps the chart premium and uncluttered.
- Zone Extend and Height (ATR%) — tune the visual footprint to your taste.
- Max Active Zones — oldest zones are automatically trimmed.
Panel and Theme:
- Location (6 anchors), Dark or Light theme, font size presets.
- Fully brand-consistent AGPro color palette built in.
🔸 How to Use
- Treat 5/5 STRICT stacks as the headline signal. They are rare by construction and typically appear at genuine inflection points.
- Use 4/5 stacks as early-warning context around support, resistance, or higher-timeframe levels.
- Read the per-oscillator live state on the panel. When RSI, MACD, CCI, MFI are all in the same direction and OBV is the last holdout, a full stack is often imminent.
- Pressure zones work well as re-entry or invalidation levels after the initial signal fires.
- The rolling win rate is a sanity check for the current asset and timeframe — if it degrades meaningfully, raise the minimum stack level or widen the pivot lookback.
🔹 Limitations and Transparency
- This is a confluence tool, not a standalone trading system. Divergence by nature can persist in strong trends before any reversal.
- The engine is pivot-based and therefore delayed by the pivot lookback. Labels appear on the bar the pivot is confirmed, not on the pivot itself.
- Win rate is computed on the last N decided signals on the current chart. It is not a backtest, it is an evolving statistic and it does not include slippage, spread, or position sizing.
- Window stacks are lower-confidence than strict stacks by design. The visual distinction is intentional.
- Session-based "Today's Max" uses calendar-day rollover.
🔸 Risk Disclosure
This indicator is a technical analysis tool for research and education. It is not financial advice, not a signal service, and not a trading strategy. Past patterns do not guarantee future behavior. You are solely responsible for your trading decisions, risk management, and position sizing. Always combine any indicator with independent analysis, higher-timeframe context, and strict risk controls.
🔹 Technical Notes
- Pine Script v6, overlay indicator.
- Fully non-repainting. All divergences are evaluated only on confirmed pivots.
- Drawing objects (labels, boxes) are capped to avoid resource overruns.
- MPL 2.0 licensed — open source. Indicator

Cumulative Volume Delta Flow [AGPro Series]Cumulative Volume Delta Flow
🔹 **Overview**
Cumulative Volume Delta Flow is a hybrid CVD engine designed to expose order-flow imbalances without requiring footprint charts or exchange-native buy/sell data. It reconstructs cumulative delta using lower-timeframe breakdown when available, with intrabar polarity as a universal fallback — making it work on every symbol and every timeframe. On top of this engine, a triple-layer divergence detector identifies Regular, Hidden, and statistical Exhaustion signals, and every signal is scored by its own statistical strength with a ★/★★/★★★ rating system printed directly on the label.
The indicator is built for traders who want smart-money context at a glance: when buyers are absorbing, when a rally is losing real participation, and when a climactic flush is likely to reverse — with an immediate visual cue of how strong each signal is relative to the recent flow regime.
🔹 **Unique Edge**
Most CVD indicators are single-mode: either they plot cumulative delta, or they call a Regular divergence. This script combines four layers that rarely appear together in one tool:
- Hybrid engine with transparent fallback (no silent failure on high TFs)
- Exhaustion detection based on standard-deviation of CVD change, not price — catches reversals that price-only divergence misses
- Per-signal ★/★★/★★★ strength rating using type-specific statistical metrics (pivot-gap σ for Regular/Hidden, change σ for Exhaustion), so traders instantly know which signals deserve attention
- Optional reaction zones anchored at flow-driven pivots, behaving as dynamic support/resistance born from real participation events rather than pure price structure
🔹 **Methodology**
- The engine computes two parallel delta streams every bar: an intrabar polarity stream (weighted by wick balance for neutral/doji candles) and a lower-timeframe stream that iterates sub-bars and signs each by its close-vs-open direction
- In Hybrid mode, the LTF stream is preferred when it yields a non-zero value; the intrabar stream is used as fallback so the indicator never goes blank on exotic tickers or high timeframes
- A session/daily/weekly reset prevents long-run drift and keeps the cumulative counter meaningful across regime changes
- Pivots are detected on both price and CVD with a shared lookback window; the last two price pivots and their paired CVD values are tested for all four classical divergence relationships
- Exhaustion is a separate statistical trigger: the single-bar CVD change is compared against a 50-bar standard deviation; a σ breach in the direction opposite to the candle body is flagged as climactic absorption
- Each divergence label is rated with stars based on its type: Regular and Hidden use the CVD-pivot gap normalized by 50-bar CVD level stdev (how far apart the two flow pivots are), while Exhaustion uses the σ multiple of the current CVD change (how extreme the climactic event is)
- A cooldown window suppresses signal clustering in chop, and labels are offset by ATR-scaled distance with a leader line so they never collide with candles
🔹 **Signals & Alerts**
On-chart labels with star rating:
- Reg Bull / Reg Bear ★-★★★ — classical reversal divergence (price exhausts, flow refuses)
- Hid Bull / Hid Bear ★-★★★ — continuation divergence (pullback inside an active trend)
- Exh Bull / Exh Bear ★-★★★ — statistical flow climax above the σ threshold
Star thresholds for Regular/Hidden: ★★★ ≥ 2.0σ gap, ★★ ≥ 1.0σ gap, ★ < 1.0σ.
Star thresholds for Exhaustion: ★★★ ≥ 3.0σ, ★★ ≥ 2.0σ, ★ < 2.0σ (minimum trigger is 1.75σ).
Each signal carries its own color code and a leader line connecting the label back to the source candle for fast visual reading. Six discrete alertcondition slots are exposed plus three proactive alert() calls grouped by divergence family, so traders can route regular, hidden, and exhaustion signals to different channels.
🔹 **Key Inputs**
- Calculation Method: Hybrid, LTF Only, or Intrabar Only
- LTF Resolution: Auto (adaptive by chart TF) or fixed 1 / 3 / 5 / 15m
- CVD Reset: Session, Daily, Weekly, or None
- Pivot Length: 2–15 bars
- Toggles for Regular / Hidden / Exhaustion layers independently
- Exhaustion Threshold (σ): 1.0–4.0, default 1.75
- Min Bars Between Signals: anti-clustering cooldown (default 15)
- Reaction Zones: optional, with ATR width, extend length, and max active cap
- Label Size + Label Offset (ATR) for visual tuning
- Info Panel: 5 positions, 4 text sizes, full hide toggle
🔹 **How to Use**
- On the 4H timeframe, run the defaults on liquid instruments: BTCUSDT, ETHUSDT, SPX, ES, major FX pairs
- Treat ★★★ signals as the highest-priority reads of the chart — these are statistical outliers
- Treat ★★ signals as the normal tradeable population — the bulk of decision-making happens here
- Treat ★ signals as background context — use them for bias confirmation, not as primary entries
- Regular divergences are reversal warnings at structural highs/lows; they are most reliable when aligned with a key horizontal level or trendline
- Hidden divergences are trend-continuation entries during pullbacks inside a confirmed trend
- Exhaustion signals mark participation climaxes and often coincide with short-term reversals even when no classical pivot has formed yet
- Check the Info Panel's Last Signal row for the most recent event type and its star rating without scanning the chart
- Enable Reaction Zones when you want persistent S/R context from flow events; keep them off for minimal, label-only use
- Consider combining with a structure tool from the AGPro Series (SFP, Breaker, Unicorn) for confluence
🔹 **Info Panel**
The compact info panel on the chart surfaces seven live metrics: the current cumulative CVD value, the CVD trend classification (Up/Down/Flat based on price relative to its own EMA 21), the last signal's full name and star rating in color, the rolling divergence count over the last 200 bars (Bull / Bear), and the bar-age of the most recent bullish and bearish events. This gives a full situational snapshot without scrolling.
🔹 **Limitations & Transparency**
- CVD from intrabar polarity is an approximation, not true tick-level order flow. Exchange-native buy/sell volume is only available through footprint data
- On very high timeframes (Daily+), LTF breakdown may return partial data; Hybrid mode is recommended
- Divergence signals appear only after both pivot legs are confirmed; the second pivot needs `pivotLen` bars of right-side confirmation, so signals print with that lag
- Exhaustion requires at least 50 bars of CVD history for the standard-deviation baseline
- Star ratings are statistical descriptors of signal strength relative to recent flow, not trade-quality guarantees
- Past performance of any divergence pattern does not guarantee future results; this tool surfaces probabilistic context, not guaranteed reversals
🔹 **Risk Disclosure**
This indicator is an analytical framework, not a trading system or financial advice. Signals are technical observations intended to support decision-making; they do not account for fundamentals, news, liquidity, or your risk tolerance. Always use proper position sizing, stop-loss placement, and risk management. Test the tool on historical data and in a simulated environment before deploying it on live capital. Trading carries risk of substantial loss. Indicator

Indicator

Fibonacci MA Trend Gap V1Overview
The Smart Fibonacci Trend Gap is a comprehensive momentum and mean-reversion oscillator designed to identify when price action has overextended relative to its Fibonacci-weighted trend. By calculating the squared variance between the current price and a composite average of 17 Fibonacci lengths, this tool highlights high-probability reversal zones and trend exhaustion points.
Key Features
📐 Multi-Fibonacci Core: Calculates an aggregate mean from up to 17 different Fibonacci moving average lengths (2 to 4181), providing a much "smoother" and more reliable trend baseline than a single MA.
🔍 Auto-Divergence Detection: Automatically identifies and draws Regular and Hidden bullish/bearish divergences directly on the oscillator. Solid lines indicate Regular divergence; dashed lines indicate Hidden.
⚡ Dual Signal Lines: Includes a Fast (Red) and Slow (Green) signal crossover system for confirming momentum shifts and trend changes.
🌈 Visual Sentiment: The background dynamically shifts color based on the Signal Line crossover, providing an instant "at-a-glance" read on the current trend bias.
🛠 Fully Customizable: Choose from 7 different MA types (SMA, EMA, WMA, HMA, VWMA, SMMA, DEMA) and toggle exactly how many Fibonacci lengths to include in the calculation.
How to Use
Mean Reversion: When the cyan oscillator line reaches extreme peaks or valleys away from the zero line, look for Regular Divergence (Triangles) to signal a potential snap-back to the mean.
Trend Following: Use the background color and Signal Line crossovers (Red/Green) to stay on the right side of the macro trend.
Hidden Divergence: Use dashed-line signals to identify trend continuation opportunities during pullbacks.
Settings
MA Type: Change the underlying math of the trend (HMA for speed, EMA for standard trend following).
Number of MAs: Scale the sensitivity by including more or fewer Fibonacci lengths.
Divergence Lookback: Fine-tune how sensitive the pivot detection is to fit your specific timeframe. Indicator

Tidal Volume Oscillator [JOAT]Tidal Volume Oscillator
Introduction
The Tidal Volume Oscillator is a separate-pane oscillator that attempts to answer a single question: is the current price movement being carried by genuine volume participation, or is it occurring on weak flow? It constructs a volume-weighted momentum score, normalizes it to a bounded range of −100 to +100, applies a Fourier-inspired exponential decay smoothing pass to reduce noise without introducing phase lag, and then scales the result with an adaptive trend filter. A flow momentum line tracks the acceleration of the oscillator itself. A divergence engine scans for all four divergence types simultaneously — regular bullish, regular bearish, hidden bullish, and hidden bearish — and plots them directly in the oscillator panel.
The indicator does not predict future price. It contextualizes current price movement relative to volume behavior and flags when price action and volume-weighted momentum are moving in opposite directions, which historically precedes changes in directional character — though not always, and not reliably in all instruments or conditions.
---
Core Concepts
The VZO Foundation
The Volume Zone Oscillator (VZO) is an established concept that categorizes volume as positive or negative based on the direction of price change, then computes a ratio of positive to negative volume over a rolling window. This indicator rebuilds that concept from the ground up using a different normalization approach:
Relative Volume: Instead of using raw volume, the oscillator first normalizes each bar's volume against a rolling SMA of volume. This produces a relative volume reading — a value above 1.0 means the bar traded heavier than average, below 1.0 means lighter. This step removes the absolute scale of volume from the calculation, allowing the oscillator to behave comparably across instruments with vastly different volume profiles and across timeframes where absolute volume differs by orders of magnitude.
Volume-Weighted Momentum: The price change on each bar is smoothed via EMA, and the relative volume is separately smoothed via EMA. Multiplying these two smoothed values produces a volume-weighted momentum signal. This is then smoothed again to form a base momentum reading.
RSI-Style Normalization: Positive and negative portions of the base momentum are separated, each independently smoothed, and their ratio is fed into an RSI-style formula: vzo = 100 * (ratio - 1) / (ratio + 1) . This bounds the oscillator strictly between −100 and +100 and gives it a symmetric zero-line structure where positive values indicate dominant upward volume momentum and negative values indicate dominant downward volume momentum.
Fourier Exponential Decay Smoothing
After the initial VZO is computed, a second smoothing pass is applied using exponential decay weights. For each bar, the contribution of each of the prior N bars is weighted by exp(-i / (len * 0.3)) , where i is the number of bars back. This means the most recent bar carries maximum weight and each earlier bar contributes exponentially less. The window clips naturally as the weights approach zero.
The result is a smoothing pass that is inspired by frequency-domain thinking: it emphasizes recent values and de-emphasizes older values in a continuous decay rather than in the binary on/off fashion of a simple rolling average. The smoothed output tracks the oscillator's underlying shape while suppressing high-frequency noise without the phase shift that a centered moving average would introduce.
ADF Trend Filter
An adaptive multiplier is derived by comparing a short SMA and a long SMA of price, normalizing their difference by the rolling standard deviation of price over a matching window. This produces a dimensionless value that reflects the strength of the current trend relative to recent volatility — conceptually analogous to the logic behind an Augmented Dickey-Fuller trend test applied in a simplified real-time form.
This multiplier is kept close to 1.0 intentionally. Its role is not to dramatically change the oscillator's value but to apply a mild scaling that slightly amplifies the VZO when trend conditions are strong and slightly suppresses it during choppy, mean-reverting conditions. The effect is subtle but helps the oscillator's readings align better with the underlying market character.
Final Blended VZO
The final oscillator value blends the EMA-smoothed VZO and the Fourier-smoothed VZO according to a blend parameter, scales the result by the ADF multiplier, and clamps the output to the range. The blend parameter controls how much weight goes to the Fourier-smoothed version versus the EMA-smoothed version, allowing the user to tune between responsiveness and smoothness.
Flow Momentum Line
A secondary line is plotted alongside the main oscillator, computed as:
flow_momentum = (vzo - ema(vzo, lookback)) * 0.5
This measures the rate of change of the oscillator — its acceleration — and scales it to stay visually proportional. When the flow momentum line is rising, the oscillator is accelerating upward. When it is falling, the oscillator is losing momentum regardless of its absolute level. Crossovers between the oscillator and the flow momentum line can highlight inflection points in volume-weighted momentum.
Divergence Engine
The divergence engine uses pivot high and pivot low detection to identify four divergence types:
Regular Bullish Divergence: Price makes a lower low while the oscillator makes a higher low. Suggests weakening downward volume participation on the new price low.
Regular Bearish Divergence: Price makes a higher high while the oscillator makes a lower high. Suggests weakening upward volume participation on the new price high.
Hidden Bullish Divergence: Price makes a higher low while the oscillator makes a lower low. Often associated with pullbacks within an established uptrend where volume momentum remains stronger than the pullback's depth implies.
Hidden Bearish Divergence: Price makes a lower high while the oscillator makes a higher high. Often associated with rallies within an established downtrend where volume momentum is failing to confirm the price bounce.
The engine uses ta.valuewhen to retrieve the oscillator's value at the most recent prior pivot of the same type, then compares it to the current pivot. Lines and labels are drawn directly in the oscillator pane, keeping all divergence context in a single panel.
Dynamic Color Blending
The oscillator line and histogram (if enabled) use color blending that responds to both the direction of the oscillator and the intensity of the flow momentum. Colors transition smoothly between bull and bear palettes as conditions shift, with intensity modulated by momentum acceleration. This avoids binary color flips and gives a continuous visual read of the oscillator's strength and direction.
---
Features
Relative-volume-normalized VZO foundation — removes absolute volume scale bias
RSI-style normalization producing a symmetric −100 to +100 oscillator
Fourier exponential decay smoothing pass for noise reduction without phase lag
ADF-inspired adaptive trend multiplier for regime-sensitive scaling
Blended output combining EMA and Fourier smoothing with user-adjustable weighting
Flow momentum line showing oscillator acceleration
Full four-type divergence engine: regular bull/bear and hidden bull/bear
Divergence lines and labels rendered directly in the oscillator pane
Dynamic color blending based on direction and momentum intensity
Overbought/oversold level lines at user-defined thresholds (default ±80)
Fully toggleable visual components including divergence types individually
---
Input Parameters
VZO Length: Primary lookback for the volume-weighted momentum and normalization calculations (default: 14)
Smoothing Length: Short EMA length used in the initial volume-weighted momentum construction (default: 5)
Signal Length: EMA length applied to the final VZO for the signal/flow line (default: 9)
Fourier Window: Number of bars used in the exponential decay smoothing pass (default: 20)
Fourier Blend: Proportion of the final output taken from the Fourier-smoothed VZO versus the EMA-smoothed VZO (default: 0.4, meaning 40% Fourier / 60% EMA)
Overbought Level: Upper reference line threshold (default: +80)
Oversold Level: Lower reference line threshold (default: −80)
Pivot Bars: Number of bars on each side required to confirm a pivot high or low for divergence detection
Visual Toggles: Individual controls for divergence types (regular bull, regular bear, hidden bull, hidden bear), flow momentum line, bar coloring, and OB/OS lines
---
How to Use
Reading the oscillator: Values above zero indicate that volume-weighted momentum favors buyers over the lookback window. Values below zero indicate it favors sellers. The magnitude reflects how dominant one side is. A reading of +60 is meaningfully different from +20 — the former suggests strong participation on the upside, the latter suggests modest positive lean.
Overbought/oversold levels: The default ±80 levels are deliberately set wide. Reaching ±80 indicates a statistically strong skew in volume momentum, not simply a directional bias. A reading at +85 that begins to decline is worth noting; a reading that has been above +80 for many bars without declining suggests strong persistent flow, not an automatic reversal condition.
Flow momentum line: Use the flow momentum line to identify when the oscillator is accelerating or decelerating. If the oscillator is above zero but the flow momentum line is falling and crossing below the oscillator, volume-weighted momentum is losing strength even if it has not crossed zero. This can be an early warning of a fading move.
Divergences: Divergence signals appear as labeled lines in the oscillator pane. They flag a disagreement between price structure and volume momentum structure. Regular divergences are typically associated with potential trend reversal conditions; hidden divergences are typically associated with trend continuation conditions during a pullback. Neither type is a standalone entry signal — they require context from price structure, higher timeframe trend, and other confirmation.
Combining types: A regular bearish divergence occurring while the oscillator is above +60 and the flow momentum line is declining is a more compelling condition than a divergence occurring at a neutral oscillator reading. Look for confluence between divergence signals, oscillator level, and flow momentum direction.
Timeframe notes: On lower timeframes, the divergence engine will fire frequently and many signals will resolve as noise. On higher timeframes, divergence signals are structurally more significant but rarer. The Fourier blend and VZO length should be calibrated to the timeframe being traded.
---
Limitations
This indicator does not predict future price movement. All readings are computed from past and current bar data.
Volume data quality varies significantly across instruments and data providers. On instruments with unreliable, synthetic, or missing volume data (some forex pairs, certain CFDs, spread-betting instruments), the oscillator's readings will be distorted or meaningless.
Divergences are detected only at confirmed pivot points, which by definition require a lookback into past bars. A divergence signal will appear after the pivot is confirmed, not at the pivot bar itself. This is inherent to pivot-based divergence detection and is not a bug.
Hidden divergences can occur frequently during strong trends and produce many signals that resolve without follow-through on shorter timeframes.
The ADF-inspired filter is a simplified heuristic, not a formal statistical test. It does not guarantee that the adaptive scaling accurately reflects whether a market is trending or mean-reverting at any given moment.
The Fourier exponential decay smoothing is not a formal frequency-domain Fourier transform. The term is used descriptively to indicate the exponential weighting pattern, not to imply that the calculation resolves into sinusoidal components.
Extreme or sustained overbought/oversold readings do not guarantee a reversal. Strong trends can keep the oscillator pinned at extremes for extended periods.
The oscillator is bounded at ±100 by construction. This means that at extreme readings, additional strengthening of volume momentum does not move the line further — the clamping obscures incremental changes at extremes.
Past divergence performance on a given instrument is not indicative of future performance.
---
Originality Statement
The VZO concept is established in the public domain. This implementation departs from the standard in several meaningful ways. Using relative volume (each bar's volume divided by a rolling SMA of volume) rather than raw volume removes the absolute scale of volume from the oscillator's behavior — a standard VZO applied to a futures contract and a low-float equity will behave differently purely due to volume magnitude; this version will not. The RSI-style normalization of the volume-weighted momentum ratio is retained from the VZO concept but is applied to a momentum signal constructed differently from the standard signed-volume approach. The Fourier exponential decay smoothing layer is an original addition: it is not a standard EMA, WMA, or VWMA — it applies a decaying weight function that is conceptually distinct from any standard Pine Script built-in smoothing function, producing a cleaner oscillator output with less phase distortion than an equivalent EMA. The ADF-inspired adaptive multiplier is a real-time regime-sensitivity mechanism not present in any standard oscillator. The four-type divergence engine built into the same panel, detecting all four divergence classes simultaneously using pivot comparison logic, provides complete divergence coverage without requiring additional scripts or manual line drawing. The combination of these elements — relative-volume normalization, Fourier decay smoothing, adaptive trend scaling, blended output, flow momentum line, and full-coverage divergence detection — into a single oscillator panel represents an original synthesis that is not replicated by any standard built-in indicator.
---
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Past performance of any indicator or strategy is not indicative of future results. Always conduct your own research and consult a qualified financial professional before making any trading decisions.
-Made with passion by officialjackofalltrades
Indicator

Nexus Fusion Engine ML [WillyAlgoTrader]🧠 Nexus Fusion Engine ML is a non-overlay oscillator that fuses three independent momentum measurements into a single adaptive line (0–100), enriched with a K-Nearest Neighbors directional bias engine, volatility-normalized volume flow, automatic divergence detection (regular + hidden), momentum fatigue warnings, higher-timeframe bias, and a weighted confluence meter — delivering a complete momentum analysis system in one pane.
The core insight: a single momentum reading is noisy. Two readings averaged together are still fragile. But three fundamentally different momentum perspectives — directional velocity, efficiency-weighted impulse, and stochastic range position — blended in proportion to current market regime, produce a reading that adapts to trend and range conditions without manual switching. Layer a KNN classifier trained on live features, volume confirmation, and multi-timeframe alignment on top, and every signal carries measurable confluence.
Works on any market (crypto, forex, stocks, futures, indices) and any timeframe.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A standard RSI or stochastic tells you where price sits in its recent range — but it has no concept of trend quality, volume confirmation, or historical pattern similarity. You get overbought readings in strong trends that never reverse. You get crossover signals with zero volume support. You get divergences with no structural confirmation.
Nexus Fusion Engine ML solves this by chaining every subsystem into an integrated pipeline:
Adaptive Momentum Fusion (3 components) → Signal Line Crossover → Volume Flow Confirmation → Efficiency Ratio Regime Detection → KNN Pattern Matching → Higher-Timeframe Bias → Confluence Meter (weighted vote of all subsystems)
The AMF engine produces an adaptive oscillator that automatically shifts its blend toward trend-measuring components (NROC + EWI) when the Efficiency Ratio is high, and toward range-measuring components (SMP) when the market is choppy. The signal line catches crossovers. Volume Flow confirms whether real buying or selling pressure backs the move. The Efficiency Ratio classifies the regime (trending vs ranging). The KNN engine finds historically similar conditions and votes on the most likely next-bar direction. The HTF bias filters noise by confirming alignment with the higher timeframe. Finally, the Confluence Meter aggregates all six sources into a single 0–100 score — so you see at a glance how many independent systems agree.
Without adaptive blending, the oscillator would either lag in trends or whipsaw in ranges. Without volume flow, signals lack confirmation. Without KNN, you have no statistical context. Without confluence scoring, you must mentally juggle six independent readings. The integration chain converts raw momentum data into actionable, scored, confirmed intelligence.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Adaptive Momentum Fusion (AMF) — three-component blended oscillator.
The engine computes three independent momentum measurements on every bar:
— NROC (Normalized Rate of Change): measures directional price velocity. Formula: ROC = (source − source ) / source × 100, smoothed with the selected method, then min-max normalized over a 3×N window to 0–100.
— EWI (Efficiency-Weighted Impulse): measures bar-to-bar impulse scaled by trend quality. Formula: impulse = change(source) / ATR(N) × ER, smoothed and normalized over a 4×N window to 0–100. High ER amplifies the impulse; low ER suppresses it.
— SMP (Stochastic Momentum Position): maps price within its recent range. Formula: (source − lowest(N)) / (highest(N) − lowest(N)) × 100, smoothed with EMA(N/2).
The blend is adaptive:
— trendWeight = min(ER_smoothed × 1.5, 0.75)
— rangeWeight = 1.0 − trendWeight
— oscRaw = trendWeight × (NROC × 0.55 + EWI × 0.45) + rangeWeight × SMP
When the market is trending (high ER), the oscillator favors NROC and EWI (directional components). In ranging conditions (low ER), it leans on SMP (range-mapping component). The final value is clamped to 0–100 after a short smoothing pass (N/3 bars).
2️⃣ Candle Anatomy Volume Flow — continuous directional volume scoring.
Instead of binary close > open direction, the volume flow uses a candle anatomy model that scores each bar from −1.0 to +1.0:
— candleScore = bodyDirection × bodyRatio × 0.7 + wickBias × 0.3
— bodyRatio = |close − open| / (high − low)
— wickBias = (lowerWick − upperWick) / (high − low)
A full bullish candle with no upper wick scores +1.0. A doji scores near 0. A pin bar with a long lower wick and small body scores +0.3 to +0.6.
The signed volume (candleScore × volume) is normalized by ATR × average volume, producing a Volatility-Normalized Volume Flow (VNVF). A dual-EMA blend (fast = 0.6×N, slow = 1.4×N, weighted 60/40) is then rescaled to 0–100 via dynamic peak normalization. Values above 50 indicate net buying pressure; below 50, net selling pressure.
3️⃣ KNN Directional Bias — Manhattan distance + inverse-distance weighted voting.
A K-Nearest Neighbors classifier runs on four live features:
— M (Momentum): oscVal / 100
— V (Volume Flow): vfVal / 100
— X (Signal Cross State): (oscVal − sigVal + 50) / 100
— E (Efficiency): ER_smoothed, clamped 0–1
On each bar, the previous bar's features are stored with the current bar's outcome (up / down / flat, determined by ATR-threshold price change). To find the current bias, the engine computes Manhattan distance from the current feature vector to every historical sample in the training window (default 120 bars), applies a recency bonus (recent bars get a slight distance reduction), selects the K nearest neighbors (default K = 5), and takes an inverse-distance weighted vote.
Result: a KNN bias score 0–100. Above 58 = bullish bias. Below 42 = bearish bias. The KNN panel displays direction, confidence percentage, a visual bar, feature states (M+/M−, V+/V−, E+/E−, X+/X−), and current regime.
4️⃣ Regular + Hidden Divergence with Structural Filter.
The divergence detector identifies pivot highs and lows on the oscillator (lookback = N/2 bars each side), then compares consecutive pivots:
— Regular Bullish: price makes a lower low, oscillator makes a higher low → potential reversal up.
— Regular Bearish: price makes a higher high, oscillator makes a lower high → potential reversal down.
— Hidden Bullish: price makes a higher low, oscillator makes a lower low → uptrend continuation.
— Hidden Bearish: price makes a lower high, oscillator makes a higher high → downtrend continuation.
The optional Structural Filter suppresses weak divergences by requiring:
— Minimum oscillator swing between pivots (default 5.0 points)
— Minimum price swing as % of recent range (default 0.3%)
— Volume flow confirmation (volume flow must agree with divergence direction)
— Maximum pivot age (default 100 bars) — prevents stale pivots from triggering false signals
Divergence lines are drawn solid (regular) or dashed (hidden) with configurable opacity. Labels: D▲ D▼ for regular, H▲ H▼ for hidden.
5️⃣ Regime Detection — Efficiency Ratio + 4-factor composite score.
The regime module scores the current market state from 0 to 4:
— +1 if oscillator > signal line
— +1 if oscillator > 50 (bullish territory)
— +1 if volume flow > 50 (net buying)
— +1 if Efficiency Ratio > 0.3 (trending market)
Score 4 = strong bullish trend → full bull fill in the OB zone. Score 0 = strong bearish trend → full bear fill in the OS zone. Scores 1–3 = transitional states with reduced opacity. The Efficiency Ratio itself uses the Kaufman formula: ER = |price − price | / sum(|price − price |, N), measuring how much of total price movement is directional.
6️⃣ Confluence Meter — 6-source weighted composite score.
Six independent subsystems vote bullish (+1), bearish (−1), or neutral (0):
— Oscillator position (>55 bull, <45 bear)
— Signal cross direction (osc > sig = bull)
— Volume Flow (>55 bull, <45 bear)
— Efficiency-confirmed direction (ER > 0.3 + oscillator side)
— KNN Bias (bull/bear state)
— HTF Bias (bull/bear state)
Net votes mapped: confRaw = (bullVotes − bearVotes + 6) / 12 × 100, smoothed with EMA(3). Above 70 = strong bullish confluence. Below 30 = strong bearish confluence. Displayed as a thin step-line on the oscillator pane.
7️⃣ Higher-Timeframe Bias — non-repainting HTF confirmation.
Fetches the oscillator and signal values from a user-selected higher timeframe using request.security() with offset + lookahead_on = previous closed HTF bar. This guarantees zero repainting. HTF is considered bullish when HTF oscillator > 50 and HTF oscillator > HTF signal; bearish when the reverse.
8️⃣ Momentum Fatigue Detection — consecutive weakening in extreme zones.
When the oscillator is above the OB level and declining for N consecutive bars (default 3), a fatigue label (✦ OB) appears — signaling that buying momentum is weakening even though the oscillator remains overbought. Mirror logic applies in the oversold zone (✦ OS). This early warning often precedes crossover signals by several bars.
9️⃣ Six smoothing algorithms with preset system.
The smoothing engine supports EMA, SMA, DEMA (double-exponential), TEMA (triple-exponential), WMA (weighted), and VWMA (volume-weighted). Four presets instantly configure period, smoothing, and zone levels:
— Scalping: period 8, OB 75, OS 25
— Default: period 14, OB 80, OS 20
— Swing: period 21, OB 80, OS 20
— Position: period 34, OB 85, OS 15
🔟 Full alert suite with webhook JSON support.
12 alert conditions covering every subsystem: bull/bear cross, OB/OS zone exit, regular/hidden divergence, volume flow inflow/outflow, fatigue OB/OS, KNN bias flip, confluence threshold cross. Each alert includes ticker, timeframe, price, and oscillator value. Toggle webhook mode to send JSON payloads for bot integration.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Warmup guard: The indicator requires 3× the engine period (minimum 60 bars) before producing any signals, divergences, or KNN output. This prevents false signals from insufficient data.
Step 2 — AMF oscillator computation: Three momentum components (NROC, EWI, SMP) are computed independently, each normalized to 0–100. The Efficiency Ratio determines the blend weights. The raw blend is smoothed with the selected algorithm over N/3 bars and clamped to 0–100.
Step 3 — Signal line: The oscillator is smoothed again with a separate method and period (default EMA 7) to produce the signal/trigger line. Crossovers between oscillator and signal generate dots and alerts.
Step 4 — Volume Flow: Each candle is scored using candle anatomy (body ratio + wick bias). Signed volume is normalized by ATR × average volume. A dual-EMA blend is rescaled to 0–100 via dynamic peak normalization.
Step 5 — Regime scoring: Four binary conditions (osc > sig, osc > 50, VF > 50, ER > 0.3) produce a regime score 0–4. This score drives zone fills.
Step 6 — Divergence scan: Pivot highs and lows are detected on the oscillator. Consecutive pivots are compared for regular and hidden divergence patterns. The Structural Filter (optional) suppresses weak signals.
Step 7 — Fatigue check: Consecutive declining bars in the OB zone (or rising bars in the OS zone) are counted. After N bars (default 3), a fatigue label fires.
Step 8 — KNN classification: Four features from the current bar are compared to the training window via Manhattan distance. The K nearest neighbors vote with inverse-distance weighting. Result: KNN bias 0–100.
Step 9 — HTF bias fetch: Oscillator and signal are fetched from the higher timeframe using previous-bar lookahead to prevent repainting.
Step 10 — Confluence aggregation: Six subsystems cast bull/bear/neutral votes. Net votes are mapped to 0–100 and smoothed.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator to your chart. It appears as a separate oscillator pane below price.
2. Select a preset matching your trading style: Scalping (fast), Default (balanced), Swing, or Position (slow).
3. If you trade a higher timeframe, set the HTF Bias timeframe (e.g., for a 15min chart, set HTF to 60).
4. Watch for the oscillator line crossing the signal line inside the OB/OS zones — these are the primary signals.
5. Check the dashboard (top-left by default) and KNN panel for confluence confirmation before acting.
👁️ Reading the chart:
— 🟢 Green oscillator line = momentum is in bullish territory (above midline) or in the overbought zone.
— 🔴 Red oscillator line = momentum is in bearish territory (below midline) or in the oversold zone.
— Thin gray signal line = trigger line for crossover signals.
— 🟢 Green dot on signal line = bullish crossover (oscillator crossed above signal).
— 🔴 Red dot on signal line = bearish crossover (oscillator crossed below signal).
— 🟢 Green fill between oscillator and midline = bullish momentum with gradient intensity.
— 🔴 Red fill between oscillator and midline = bearish momentum with gradient intensity.
— 🟢 Green volume flow fill (above 50) = net buying pressure.
— 🔴 Red volume flow fill (below 50) = net selling pressure.
— D▲ / D▼ labels with solid lines = regular (reversal) divergence.
— H▲ / H▼ labels with dashed lines = hidden (continuation) divergence.
— ✦ OB / ✦ OS labels = momentum fatigue warning in extreme zones.
— Regime fills in OB/OS zones = colored fills when regime score reaches 3–4 (bull) or 0–1 (bear).
— Thin step-line = confluence meter (above 70 = strong bullish, below 30 = strong bearish).
📊 Dashboard fields:
— Trend: Bullish (osc > 60) / Bearish (osc < 40) / Neutral.
— Signal: Latest signal event — Bull Cross, Bear Cross, Overbought, Oversold, or none.
— Strength: Strong (osc ≥ 70 or ≤ 30) / Medium / Weak.
— Oscillator: Current numeric oscillator value.
— Momentum: Acceleration state — Accel ▲ (gaining speed) / Decel ▼ (losing speed) / Steady.
— HTF Bias: Higher-timeframe direction — Bullish / Bearish / Neutral / OFF.
— Vol Flow: Inflow (VF > 60) / Outflow (VF < 40) / Neutral / N/A (no volume data).
— Regime: Trending (ER > 0.3) / Ranging.
— KNN Bias: KNN directional output — Bullish / Bearish / Neutral.
— Confluence: Composite reading with label — Strong Bull / Lean Bull / Mixed / Lean Bear / Strong Bear.
— ER: Current Efficiency Ratio value.
— Score: Regime score (0–4).
— Consensus: Raw bull vs bear vote count (e.g., 5B / 1S).
🔧 Tuning guide:
— Too many signals / whipsaw: Increase Engine Period (try 21 or 34), or switch to the Swing / Position preset. Enable the Structural Filter for divergences.
— Too few signals / too slow: Decrease Engine Period (try 8–10), or use the Scalping preset. Lower the Confirmation Bars for fatigue to 1–2.
— Divergences feel noisy: Enable the Structural Filter. Increase Min Osc Swing (try 8–10). Enable Require Volume Confirmation. Lower Max Pivot Age to 50–60.
— KNN seems random: Increase K (try 8–10) for more conservative voting. Increase Training Window to 200–300 for more historical data. KNN works best on liquid instruments with sufficient bar history.
— Volume flow shows N/A: The instrument has no volume data (some forex pairs, indices). Volume Flow and its contribution to regime/confluence will be inactive.
— HTF Bias always neutral: Make sure the HTF timeframe is actually higher than your current chart timeframe. An empty field = same timeframe (no filtering).
💡 Trading ideas:
— Crossover in extreme zone: Wait for the oscillator to enter the oversold zone (below 20), then watch for a bullish cross of the signal line. Confirm with volume flow turning green and KNN showing bullish. The reverse applies for overbought bearish crosses.
— Divergence + fatigue combo: A regular bullish divergence (D▲) appearing near or shortly after a ✦ OS fatigue label is a strong reversal setup. Both systems independently detect weakening bearish momentum.
— Confluence filter: Only take trades when the Confluence Meter is above 70 (for longs) or below 30 (for shorts). This ensures at least 4–5 out of 6 subsystems agree.
— Regime-aware strategy: When the dashboard shows "Trending" and the regime score is 3–4, favor trend-following entries (hidden divergences, pullbacks to midline). When "Ranging" with score 1–2, favor mean-reversion entries (regular divergences, OB/OS zone fades).
— Multi-timeframe alignment: Set the HTF to 4× your chart timeframe (e.g., 1H chart → 4H HTF). Only take long entries when HTF Bias = Bullish, and shorts when HTF Bias = Bearish. This one filter alone can significantly reduce false signals.
⚙️ KEY SETTINGS REFERENCE
⚙️ Main Settings:
— Engine Period (default 14): Core lookback for the AMF engine. 8–12 = scalping, 14 = balanced, 20–50 = swing/position.
— Source (default close): Price input. Close = standard, HLC3 = smoother, OHLC4 = smoothest.
— Smoothing (default DEMA): Algorithm for oscillator core. DEMA recommended for fast and smooth response.
— Preset (default Default): Quick configuration — Scalping / Default / Swing / Position.
— Signal Period (default 7): Smoothing for the trigger line. Keep below Engine Period.
— Signal Smoothing (default EMA): Method for the signal line.
— Show Cross Dots (default ON): Dots at oscillator–signal crossover points.
📐 Zones & Fills:
— Overbought Level (default 80): Upper extreme threshold.
— Oversold Level (default 20): Lower extreme threshold.
— OB/OS Fill Opacity (default 20): Zone fill transparency.
📊 Volume Flow:
— Show Volume Flow (default ON): Toggle the VNVF overlay.
— Volume Flow Opacity (default 18): Fill transparency. Keep 10–25 so the oscillator stays visible.
🔬 Regime Detection:
— Show Regime State (default ON): Toggle regime zone fills.
— Regime OB/OS Opacity (default 35): Fill transparency for regime fills.
🔀 Divergence:
— Regular Divergence (default ON): Reversal divergence detection.
— Hidden Divergence (default ON): Continuation divergence detection.
— Structural Filter (default OFF): Suppresses weak divergences. When ON, uses Min Osc Swing (default 5.0), Min Price Swing % (default 0.3%), and Volume Confirmation.
— Max Pivot Age (default 100 bars): Maximum distance between divergence pivots.
💨 Momentum Fatigue:
— Show Fatigue Labels (default ON): Toggle fatigue warnings.
— Confirmation Bars (default 3): Consecutive weakening bars required. 1 = fast, 5 = strict.
🧠 KNN Bias:
— Show KNN Panel (default ON): Toggle the AI panel.
— Neighbors (K) (default 5): Voting neighbors. 3 = fast, 10+ = conservative.
— Training Window (default 120): Historical bars for learning. 50 = short memory, 300+ = long memory.
🔭 Higher Timeframe:
— Show HTF Bias (default ON): Toggle HTF filter.
— Higher Timeframe (default empty = current TF): Select a higher TF for meaningful bias.
🎯 Confluence:
— Show Confluence Meter (default ON): Toggle the composite score line.
— High Confluence (default 70): Threshold for strong bullish confluence.
— Low Confluence (default 30): Threshold for strong bearish confluence.
🎨 Visual:
— Theme (default Auto): Auto-detects chart background. Force Dark or Light as needed.
— Adaptive Line Color (default ON): Oscillator color shifts with momentum direction.
— Bull/Bear Colors : Customizable green/red palette.
🔔 ALERTS
— 🟢 Bull Cross — oscillator crosses above signal line below the midline. Payload: ticker, TF, price, osc value.
— 🔴 Bear Cross — oscillator crosses below signal line above the midline. Payload: ticker, TF, price, osc value.
— 🟢 Exit Oversold — oscillator crosses above OS level.
— 🔴 Exit Overbought — oscillator crosses below OB level.
— 🟢 Regular Bull Divergence — D▲ detected (passes structural filter if enabled).
— 🔴 Regular Bear Divergence — D▼ detected.
— 🟢 Hidden Bull Divergence — H▲ detected.
— 🔴 Hidden Bear Divergence — H▼ detected.
— 🟢 Volume Inflow — volume flow crosses above 50.
— 🔴 Volume Outflow — volume flow crosses below 50.
— ⚠️ OB Fatigue — buying momentum weakening in overbought zone.
— ⚠️ OS Fatigue — selling momentum weakening in oversold zone.
— 🧠 KNN → Bull — KNN bias flips to bullish.
— 🧠 KNN → Bear — KNN bias flips to bearish.
— 🎯 Confluence High — confluence meter crosses above high threshold (default 70).
— 🎯 Confluence Low — confluence meter crosses below low threshold (default 30).
All alerts support plain text and JSON webhook format (toggle in settings). Alerts fire once per bar.
⚠️ IMPORTANT NOTES
— 🚫 Divergence timing. Pivots are detected with equal left/right lookback (N/2 bars). This means the divergence line and label appear at the confirmed pivot bar, which is N/2 bars in the past. This is delayed confirmation, not repainting — the signal does not change once it appears.
— 🚫 HTF bias does not repaint. The higher-timeframe values use the previous closed HTF bar ( offset + barmerge.lookahead_on). The HTF reading updates only when a new HTF bar closes.
— 📐 KNN is not a crystal ball. The KNN classifier finds similar historical conditions and votes on direction. It does not predict the future — it provides statistical context based on the training window. In low-liquidity or unusual market conditions, historical patterns may not repeat.
— 📐 Volume Flow requires volume data. On instruments without volume (some forex feeds, certain index CFDs), Volume Flow displays N/A and its contribution to regime scoring and confluence voting is inactive.
— ⚖️ Warmup period. The indicator needs 3× Engine Period (minimum 60 bars) of data before producing output. On very low-timeframe charts with limited history, some subsystems may not activate.
— 🛠️ This is an analysis tool, not an automated trading bot. It provides momentum analysis, volume confirmation, pattern recognition, and confluence scoring — trade decisions remain yours.
— 🌐 Works on all markets and all timeframes. Optimized for liquid instruments with volume data.
Version: v1.2.1 Indicator

PSP zones with validationThis indicator implements a structured cross-asset correlation signal model (PSP — Price Structure Parity) combined with dynamic zone-based market representation and invalidation logic.
Unlike traditional correlation tools that only compare directional candle agreement between two assets, this script transforms correlation events into actionable market zones, while also managing their lifecycle through objective invalidation rules.
🔍 Core Concept
PSP (Price Structure Parity) identifies situations where:
The current asset shows a bullish candle while the reference asset is bearish, or vice versa (direct mode)
Or both assets move in the same direction under inverse correlation logic
These conditions highlight temporary structural dislocations between correlated instruments, often driven by liquidity imbalance or delayed price response.
🧠 How It Works
1. Cross-Asset Structure Comparison
The script compares:
Current chart candles
Reference symbol candles (user-defined)
It evaluates directional alignment or divergence depending on selected mode:
Direct correlation mode
Inverse correlation mode
2. PSP Signal Generation
A PSP event is triggered when a structural mismatch occurs between the two assets based on candle direction.
Signals are classified into:
Bullish PSP
Bearish PSP
3. Zone Construction (Key Feature)
Instead of simply coloring candles, each PSP event generates a price zone, representing:
The full body range of the signal candle
A contextual imbalance area where correlation deviation occurred
Zones remain active on the chart and provide a visual representation of where structural inefficiencies were identified.
4. Invalidation Mechanism
Each zone has a lifecycle and is automatically removed when invalidated:
Bullish zones are invalidated when price closes below the zone
Bearish zones are invalidated when price closes above the zone
This ensures only active and relevant market structures remain visible, eliminating visual noise and outdated signals.
📊 Key Features
Cross-asset correlation detection (PSP model)
Direct and inverse correlation modes
Zone-based visualization instead of single-bar signals
Automatic invalidation of broken structures
Clean and low-noise chart output
Suitable for multi-asset analysis
⚙️ Inputs
Reference Symbol – asset used for correlation comparison
Inverse Correlation Mode – flips correlation logic
Color Theme Selector – customizable visual styles
Opacity Control – zone transparency adjustment
🧭 How to Use
This indicator is best applied in:
Correlated crypto pairs (e.g., BTC/ETH, BTC/ALTS)
Index vs single asset analysis
Liquidity divergence identification
Typical workflow:
Wait for PSP zone creation
Observe price reaction inside the zone
Monitor invalidation level for structural confirmation
Use zones as context for entries or confirmations
⚠️ Notes
This indicator does not repaint historical PSP zones
Signals are based on closed candle structure
Best results occur when used with correlated liquid assets
🇷🇺 Description (RU — дополнительный перевод)
Этот индикатор реализует модель корреляционных структур PSP (Price Structure Parity) и превращает расхождения между активами в торговые зоны ликвидности.
В отличие от стандартных индикаторов корреляции, он не просто сравнивает направление свечей, а формирует:
структурные зоны дисбаланса
визуальные области интереса
автоматическую инвалидацию сломанных структур
🧠 Логика работы
Индикатор сравнивает:
свечи текущего графика
свечи выбранного референс-актива
При выявлении расхождения формируется PSP-сигнал:
бычий
медвежий
📊 Зоны
Каждый сигнал превращается в зону (box), которая показывает:
область структурного дисбаланса
потенциальную зону реакции цены
❌ Инвалидация
Зона удаляется при:
пробое вниз (для бычьей зоны)
пробое вверх (для медвежьей зоны)
🎯 Применение
Лучше всего работает:
на криптовалютах с высокой корреляцией
в анализе BTC vs альткоины
при поиске реакций от дисбаланса Indicator

Liquidity sweep divergence (SMT) This script implements a refined version of SMT (Smart Money Technique) divergence, focused specifically on liquidity sweeps between correlated assets rather than simple structural divergence.
Use it on one market:
FOREX: EURUSD + DXY (or GBPUSD + DXY)
CRYPTO: BTC+ETH (BTC + TOTAL3, ETH + TOTAL3)
INDICES: ES + NQ
COMMODITIVES: XAU + XAG (GOLD+SILVER)
Unlike traditional SMT indicators that rely on comparing consecutive swing highs/lows (HH/LL logic), this script detects true liquidity events, where one asset takes liquidity (sweeps a previous swing) while the other fails to do so.
🔍 Core Concept
SMT divergence in this script is defined as:
Bearish SMT
The main chart sweeps a previous swing high (liquidity taken)
The second asset fails to sweep its corresponding swing high
Bullish SMT
The main chart sweeps a previous swing low
The second asset fails to do the same
This reflects asymmetry in liquidity behavior, often interpreted as a sign of weakening trend continuation and potential reversal.
⚙️ How It Works
The script uses:
1. Pivot-based swing detection
Uses confirmed pivots (ta.pivothigh / ta.pivotlow)
Eliminates noise and repaint issues from naive fractal logic
2. Cross-asset synchronization
Swings between assets are matched using a configurable bar offset tolerance
Ensures meaningful comparison between structurally aligned points
3. Liquidity sweep detection
Detects when price:
Breaks a previous swing level (high/low)
Optionally closes back inside (ICT-style wick sweep)
4. Signal filtering
To reduce false SMT signals, the script includes:
ATR-based minimum move filter
Optional wick confirmation (true liquidity grab)
No multi-swing brute-force scanning (only relevant structure is used)
🎯 What Makes This Script Unique
Focuses on liquidity sweeps, not just HH/LL divergence
Avoids common SMT noise from weak structural comparisons
Uses minimal and efficient logic (O(1)), no heavy loops
Produces clean and trade-relevant signals, not visual clutter
Designed with algorithmic trading compatibility in mind
📊 Visual Features
Clean SMT labels (Bullish / Bearish)
Optional connecting lines showing the sweep move
Background highlighting for quick contextual awareness
Transparent styling to avoid chart obstruction
⚙️ Inputs
Second Asset – symbol used for SMT comparison
Pivot Length – controls swing sensitivity
Max Sync Offset – allowed mismatch between swing points (in bars)
Wick Sweep Filter – require close back inside level (ICT-style)
ATR Filter – minimum sweep strength
Show Lines – toggle visual connections
🧠 How to Use
This indicator is best used in:
Reversal zones
Liquidity pools (equal highs/lows, prior highs/lows)
Session highs/lows (London / NY)
Typical workflow:
Identify SMT signal
Wait for confirmation:
Break of structure (BOS)
Displacement move
Execute entry in direction of SMT
⚠️ Notes
Signals appear at the moment of liquidity sweep, not at pivot formation
This script is non-repainting, as it uses confirmed pivots
SMT is not a standalone strategy — use with market structure
🌍 Дополнительно (RU — для твоей аудитории)
Этот индикатор реализует правильный SMT, основанный не на HH/LL, а на снятии ликвидности.
Ключевая идея:
Один актив забирает ликвидность (пробивает свинг)
Второй — нет
→ это и есть настоящий SMT
В отличие от большинства индикаторов:
нет мусорных сигналов
нет перебора всех свингов
используется только актуальная структура
Лучше всего работает:
на хаях/лоу сессий
на уровнях ликвидности
в связке с BOS / FVG Indicator

Liquidity Tessera [JOAT]Liquidity Tessera
Introduction
Liquidity Tessera is an advanced open-source volume intelligence pane that fuses Cumulative Volume Delta (CVD), Weis Wave volume clustering, multi-design intensity bars, volume absorption and climax detection, CVD momentum ribbon, liquidity exhaustion tracking, session-partitioned delta accumulation, and a comprehensive 16-row dashboard into a unified volume analysis system. This indicator transforms raw volume data into actionable intelligence about who controls the market — buyers or sellers — and whether that control is strengthening or weakening.
Standard volume indicators show you how much trading occurred. Liquidity Tessera shows you the character of that trading: whether volume is flowing in or out (CVD), whether volume waves are expanding or contracting (Weis Wave), whether institutions are absorbing supply or distributing into demand (absorption detection), and whether a move is reaching climactic exhaustion (climax and exhaustion signals). The indicator operates in its own pane below the price chart, providing a complete volume intelligence layer without cluttering price action.
Core Concepts
1. Cumulative Volume Delta (CVD)
CVD approximates the net buying and selling pressure by assigning each bar's volume as positive (buying) when the close is above the open, and negative (selling) when the close is below the open:
float barDelta = close > open ? volume : close < open ? -volume : 0.0
var float cvdRaw = 0.0
cvdRaw := nz(cvdRaw ) + barDelta
The cumulative sum of these deltas creates a running total of net order flow. Rising CVD indicates net buying pressure is accumulating; falling CVD indicates net selling pressure. The indicator offers optional normalization using a z-score approach (CVD relative to its rolling mean and standard deviation), which makes CVD comparable across different instruments and timeframes.
CVD divergences from price are particularly significant: when price makes a new high but CVD does not confirm (it stays below its recent high), it suggests the rally lacks genuine buying conviction and may be vulnerable to reversal.
2. Weis Wave Volume Clustering
The Weis Wave method groups volume into directional waves. Rather than looking at volume bar-by-bar, it accumulates volume during each directional swing. A wave reversal is triggered when price moves against the current wave direction by more than a configurable ATR-based threshold:
float waveThreshold = ta.atr(waveAtrLen) * waveAtrMul
// When price reverses by more than the threshold, the wave completes
// and accumulated volume is plotted as a single wave column
This reveals the Wyckoff-style volume pattern: are up-waves attracting more volume than down-waves (accumulation), or are down-waves attracting more volume (distribution)? The indicator tracks wave history and detects divergences between price swings and their corresponding wave volumes.
3. Volume Absorption Detection
Institutional absorption occurs when large players absorb selling pressure (or buying pressure) without allowing price to move significantly. The indicator detects this by identifying bars where volume is extremely high relative to average (above the configurable threshold, default 2x) but the price range is unusually small (below 50% of average range):
High volume + small range = someone is absorbing the opposite side's orders
This often occurs at the end of trends when institutions are building positions against the prevailing direction
Absorption bars are highlighted with a distinct amethyst color and labeled "ABS" on the chart.
4. Volume Climax Detection
A volume climax occurs when extreme volume (above the configurable threshold, default 3x average) coincides with a reversal candle pattern — specifically, a bar with a large wick-to-body ratio (wick > 2x body). This combination suggests that a massive influx of orders met strong opposition, creating a potential turning point. Climax bars are highlighted in fuchsia and labeled "CLIMAX."
5. Liquidity Exhaustion Tracking
The indicator tracks consecutive Weis Waves where volume declines from wave to wave. When two or more consecutive waves in the same direction show declining volume, it signals exhaustion — the trend is running out of fuel. This is a classic Wyckoff concept: a trend sustained by decreasing volume is unsustainable.
6. Delta Intensity Bar Coloring
Rather than simple up/down coloring, the indicator offers gradient-based bar coloring where the intensity of the color reflects the strength of the bar's delta relative to average volume:
float deltaStr = math.min(math.abs(barDelta) / volMA, 2.0) / 2.0
// Weak delta = faint color, strong delta = vivid color
baseCol := color.from_gradient(deltaStr, 0, 1,
color.new(TESS_INFLOW, 65), color.new(TESS_INFLOW, 0))
This means a green bar with faint color had weak buying conviction, while a vivid green bar had strong buying conviction — information not available from standard volume bars.
7. CVD Momentum Ribbon
A fast and slow EMA of the raw CVD create a momentum ribbon. When the fast CVD EMA is above the slow, delta momentum is bullish (buying pressure is accelerating). Crossovers between the two indicate shifts in delta momentum direction.
Features
Four Bar Design Modes: Solid (standard filled bars), Hollow (outline only), Intensity (transparency scales with volume relative to average), and Glass (semi-transparent with a stepline cap) — each providing a different visual emphasis
Weis Wave Histogram: Background columns showing completed wave volumes, colored by wave direction. Up-wave volumes plot above zero, down-wave volumes below
CVD Overlay: The cumulative delta line scaled to fit the volume pane, with gradient coloring from bearish (red) to bullish (teal) based on CVD value
Session Volume Accumulation: Separate tracking of pre-market, regular, and post-market session volumes and deltas, with session background coloring
Delta Pressure Score: A 0-100 percentage measuring net buying pressure over the last 20 bars. Above 60 = buy pressure dominant, below 40 = sell pressure dominant
Wave Volume Comparison: Real-time comparison of the current wave's volume against the previous wave, classified as Expanding, Steady, or Contracting
Liquidity State Classification: Categorizes the current bar as Absorption, Climax, Exhaustion, Spike, Dry-Up, or Normal based on the composite of all detection systems
Volume Spike Detection: Identifies bars where volume exceeds 2.5x average with a background highlight
Session Delta Bias: Tracks whether the current session's cumulative delta is net accumulating or distributing
16-Row Dashboard: Displays bar delta, CVD state, volume ratio, wave direction, session volumes, last wave volume, liquidity state, delta pressure, CVD momentum, wave volume comparison, session delta bias, delta strength, active wave volume, exhaustion counts, and bar style
Input Parameters
Cumulative Delta:
CVD Smoothing: EMA period for CVD smoothing (default: 14)
Normalize CVD: Toggle z-score normalization for cross-asset comparability (default: on)
CVD Ribbon Fast/Slow: EMA periods for the momentum ribbon (default: 8/21)
Wave Volume:
Wave ATR Multiplier: Threshold for wave reversal detection (default: 1.5)
Wave ATR Length: ATR period for wave threshold (default: 14)
Signals:
Absorption Vol Threshold: Volume multiple for absorption detection (default: 2.0)
Climax Vol Threshold: Volume multiple for climax detection (default: 3.0)
Toggles for wave divergence, absorption, climax, and exhaustion signals
Visuals:
Bar Style: Solid, Hollow, Intensity, or Glass (default: Intensity)
Toggles for delta intensity coloring, wave histogram, CVD overlay, CVD ribbon, session background, and dashboard
How to Use This Indicator
Step 1: Read the Liquidity State
Check the dashboard's Liquidity State. "Absorption" at support suggests institutions are buying. "Climax" after an extended move suggests a potential turning point. "Exhaustion" means the trend is losing volume fuel. "Normal" means standard conditions apply.
Step 2: Monitor CVD Direction
Rising CVD confirms uptrends; falling CVD confirms downtrends. CVD diverging from price is a warning sign. If price is making new highs but CVD is flat or declining, the rally may lack genuine buying support.
Step 3: Compare Wave Volumes
In a healthy uptrend, up-wave volumes should be larger than down-wave volumes. If down-wave volumes start exceeding up-wave volumes while price is still rising, distribution may be occurring. The Wave Volume Comparison metric in the dashboard tracks this automatically.
Step 4: Use Delta Pressure for Bias
The Delta Pressure score (0-100) provides a quick read on who controls the last 20 bars. Above 60 = buyers dominate. Below 40 = sellers dominate. Between 40-60 = balanced/contested.
Step 5: Watch for Signal Clusters
The most significant moments occur when multiple signals cluster: an absorption bar followed by a wave divergence during an exhaustion phase, for example, creates a high-conviction reversal setup. Single signals in isolation are less reliable.
Indicator Limitations
The CVD approximation (close > open = buying, close < open = selling) is a simplification. True order flow data requires Level 2/DOM data not available in Pine Script. This approximation works reasonably well on liquid instruments but is inherently imprecise
Volume data quality varies significantly across instruments and data providers. Forex "volume" is typically tick count, not actual traded volume. Crypto volume may include wash trading. The indicator's effectiveness depends on the quality of the underlying volume data
Weis Wave reversal detection depends on the ATR threshold parameter. Too small a threshold produces too many waves (noise); too large produces too few (missing genuine reversals). The optimal setting varies by instrument and timeframe
Absorption and climax detection use fixed ratio thresholds. What constitutes "extreme" volume varies across instruments and market conditions. The thresholds may need adjustment
Session volume tracking uses PulseWire's built-in session detection, which may not align perfectly with all exchanges or instruments
The indicator operates in a separate pane and cannot overlay directly on price. Cross-referencing signals with price action requires visual comparison between panes
Originality Statement
This indicator is original in its comprehensive fusion of multiple volume analysis methodologies into a unified intelligence pane. While individual components (CVD, Weis Wave, volume absorption) exist separately, this indicator is justified because:
The integration of CVD, Weis Wave clustering, absorption detection, climax detection, and exhaustion tracking into a single system provides layered volume intelligence not available in any single existing indicator
The delta intensity bar coloring system uses gradient transparency based on delta strength, providing conviction information within the volume bars themselves
The liquidity state classification system synthesizes all detection subsystems into a single categorical assessment of current market conditions
Session-partitioned delta tracking reveals whether accumulation or distribution is occurring within specific market sessions
The CVD momentum ribbon provides a trend-following overlay on the delta data, identifying shifts in buying/selling momentum
Four distinct bar design modes (Solid, Hollow, Intensity, Glass) offer visual flexibility for different analysis preferences
Wave volume comparison with expanding/contracting classification automates Wyckoff-style wave analysis
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Volume analysis provides context about market participation but does not predict future price direction. Absorption, climax, and exhaustion signals are probabilistic patterns that can and do fail. CVD approximations are not equivalent to true order flow data. Always use proper risk management and conduct your own analysis. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

RSI Divergence ProRSI Divergence Pro
Forget the classic RSI bouncing between 0 and 100 where you're left squinting at charts trying to spot divergences yourself.
RSI centers everything on zero — positive means bullish, negative means bearish, done. No mental math wondering if 45 is "almost oversold." Overbought/oversold zones adapt dynamically to the market instead of sitting frozen at 30/70.
Three divergence types detected automatically: Regular (trend reversal), Hidden (trend continuation), and — this is what nobody else has — Momentum Divergences: price is still climbing, but RSI is quietly losing steam. The warning signal before the classic divergence even becomes visible.
Armed State is the real killer feature: the indicator detects when a divergence is building but hasn't fired yet — green/red dots show you in real time "heads up, something's brewing." You see the trade before it exists.
Everything controlled by a single strength filter: one slider, zero clutter. High = fewer signals that hit. Low = see everything. Your call.
Arrows on chart, lines in the oscillator, info table, alerts — all built in, all toggleable. Indicator

Dissonance Ledger [JOAT]Dissonance Ledger
Introduction
Dissonance Ledger is an advanced open-source divergence intelligence system that simultaneously monitors four independent oscillators — RSI, MACD histogram, Money Flow Index (MFI), and Momentum — for both regular and hidden divergences against price. Rather than relying on a single oscillator (which produces frequent false divergences), this indicator uses a confluence scoring system that requires multiple oscillators to confirm the same divergence before generating a signal. The result is a divergence detection engine with substantially fewer false positives than any single-oscillator approach.
The fundamental problem with traditional divergence trading is reliability. A bearish RSI divergence (price making higher highs while RSI makes lower highs) fails more often than it succeeds when used in isolation. This is because a single oscillator can diverge from price for structural reasons unrelated to an impending reversal. Dissonance Ledger solves this by requiring a minimum number of oscillators (configurable, default 2 out of 4) to independently confirm the same divergence pattern. When RSI, MACD, MFI, and Momentum all agree that momentum is weakening despite price advancing, the probability of a genuine reversal increases substantially.
Core Concepts
1. Multi-Oscillator Divergence Architecture
The indicator calculates four oscillators at global scope to ensure proper history tracking:
RSI (Relative Strength Index): Measures the ratio of average gains to average losses. Divergences in RSI indicate that the magnitude of price moves is changing relative to the trend
MACD Histogram: The difference between the MACD line and its signal line. Divergences in the histogram indicate that the rate of momentum change is shifting
MFI (Money Flow Index): A volume-weighted RSI that incorporates buying and selling pressure. MFI divergences indicate that volume is not confirming the price move
Momentum: Raw rate of change (close minus close N bars ago). Momentum divergences indicate that the absolute speed of price movement is declining
Each oscillator provides a different lens on momentum. RSI measures relative strength, MACD measures momentum acceleration, MFI measures volume-confirmed pressure, and Momentum measures raw speed. When multiple lenses agree, the signal is more reliable.
2. Fractal Pivot Anchoring
Divergences are anchored to fractal pivot points rather than arbitrary lookback windows. The indicator uses `ta.pivothigh()` and `ta.pivotlow()` with configurable left and right bar counts to identify genuine swing highs and lows. Each pivot's price and all four oscillator values are stored in arrays:
if not na(pivHigh)
array.unshift(phPrices, pivHigh)
array.unshift(phBars, bar_index - pivotRight)
array.unshift(phRSI, rsiAtBar)
array.unshift(phMACD, macdAtBar)
// ... MFI, MOM stored similarly
When a new pivot forms, the indicator compares it against the previous pivot. If price made a higher high but one or more oscillators made a lower high, that oscillator registers a bearish divergence vote. The confluence count is the total number of oscillators that agree.
3. Regular vs Hidden Divergences
The indicator detects both types:
Regular Divergence (Reversal): Price makes a higher high / lower low while oscillators make a lower high / higher low. This suggests the current trend is losing momentum and a reversal may follow
Hidden Divergence (Continuation): Price makes a lower high / higher low while oscillators make a higher high / lower low. This suggests the underlying trend remains strong despite a surface-level pullback, and continuation is likely
Regular divergences are drawn with solid lines; hidden divergences use dashed lines in distinct colors (arctic cyan for hidden bull, amber for hidden bear) to differentiate them visually.
4. Divergence Strength Scoring
Each detected divergence receives a strength score (0-100) based on three factors:
Confluence Weight (50%): More oscillators confirming = higher score. 4/4 confluence scores maximum
Price Divergence Magnitude (25%): Larger percentage difference between the two pivot prices = stronger divergence
Oscillator Divergence Magnitude (25%): Larger absolute difference in oscillator readings between pivots = stronger signal
This scoring system helps traders prioritize high-conviction divergences over marginal ones.
5. ATR Target Projections
When a divergence is confirmed, the indicator projects a target level using a configurable ATR multiple from the pivot point. For bullish divergences, the target is projected above the pivot low; for bearish, below the pivot high. These targets provide a measured-move expectation for the potential reversal.
6. Oscillator Aggregate Bias
Beyond divergence detection, the indicator calculates an aggregate bias across all four oscillators. Each oscillator's reading is normalized to a -1 to +1 scale, and the average is smoothed with an EMA. This provides a continuous measure of overall momentum direction and strength, independent of divergence signals.
Features
Confluence-Scored Divergence Labels: Each divergence signal shows its confluence count (e.g., "3/4 REG" for a regular divergence confirmed by 3 of 4 oscillators) and whether it is regular or hidden
Divergence Lines: Solid lines for regular divergences, dashed lines for hidden divergences, connecting the two pivot points that form the divergence pattern
ATR Target Projections: Dashed horizontal lines with price labels showing the projected target for each divergence
Oscillator Momentum Ribbon: An EMA-based ribbon on the price chart that fills bullish or bearish based on the aggregate oscillator bias, providing continuous momentum context
Divergence Decay Tracking: After a divergence signal, a fading background zone tracks the "decay" period — the window during which the divergence is still considered active. The zone fades progressively over the configurable decay duration
Confluence-Weighted Bar Coloring: Candle colors shift on a gradient based on how many oscillators agree on direction. Full agreement produces vivid colors; mixed signals produce muted colors
Divergence History Chain: The dashboard tracks the last three divergence signals in sequence (e.g., "BULL > BEAR > H-BULL"), revealing the pattern of momentum shifts
Pivot Markers: Small circles mark fractal pivots that did not produce divergences, maintaining structural awareness
16-Row Dashboard: Displays all four oscillator values, agreement count, aggregate bias, last bull/bear divergence details, strength scores, hidden divergence tracking, history chain, decay status, and total divergence counts
Input Parameters
Pivot Detection:
Left/Right Bars: Fractal pivot detection sensitivity (default: 5/5)
Lookback Window: Maximum bars between pivots for divergence comparison (default: 60)
Oscillators:
RSI Length (default: 14), MACD Fast/Slow/Signal (default: 12/26/9), MFI Length (default: 14), Momentum Length (default: 14)
Confluence:
Min Confluence: Minimum oscillators required to confirm a divergence (default: 2, range: 1-4)
Target Projection:
ATR Target Multiple: Multiplier for target distance (default: 1.5)
Target ATR Length: ATR period for projection calculation (default: 14)
Visuals:
Toggles for divergence lines, hidden divergences, target projections, oscillator ribbon, bar coloring, signal background, decay zones, and dashboard
Decay Duration: Number of bars the divergence decay zone persists (default: 20)
How to Use This Indicator
Step 1: Set Your Confluence Threshold
Start with the default minimum confluence of 2. If you want fewer but higher-conviction signals, increase to 3 or 4. A 4/4 confluence divergence is rare but highly significant.
Step 2: Watch for Divergence Labels
When a label appears (e.g., "3/4 REG" below a pivot low), it means 3 of 4 oscillators confirmed a regular bullish divergence at that pivot. The higher the confluence, the more attention the signal deserves.
Step 3: Check the Strength Score
In the dashboard, review the divergence strength percentage. Scores above 60 indicate strong divergences with large price and oscillator magnitude differences. Scores below 30 are marginal.
Step 4: Use Target Projections for Planning
The dashed target line shows where a measured-move reversal might reach. Use this for take-profit planning, not as a guaranteed level.
Step 5: Monitor the Decay Zone
The fading background after a divergence signal shows the active window. If price hasn't responded by the time the decay zone expires, the divergence has likely failed.
Step 6: Read the History Chain
A sequence like "BEAR > BEAR > BEAR" in the history chain suggests persistent bearish momentum divergences — the trend may be weakening structurally. Alternating "BULL > BEAR > BULL" suggests choppy, unreliable conditions.
Close-up showing a 4/4 confluence bearish divergence with all four oscillator divergence lines visible, the strength score in the dashboard reading 78%, and the ATR target projection line below
Indicator Limitations
Divergences are identified at fractal pivots, which require right-bar confirmation. This means divergences are detected with a delay equal to the right-bar count (default 5 bars after the actual pivot)
Even with multi-oscillator confluence, divergences can fail. Strong trends can produce multiple consecutive divergences before any reversal occurs — this is known as "divergence stacking" and is a well-known limitation of divergence trading
The four oscillators used (RSI, MACD, MFI, Momentum) are all derived from price and volume. They are not truly independent — they share common inputs and can produce correlated false signals during certain market conditions
MFI requires reliable volume data. On forex pairs or instruments with synthetic/tick volume, MFI-based confluence may be less meaningful
Target projections use ATR as a distance measure, which is backward-looking. In rapidly changing volatility environments, projected targets may overshoot or undershoot
Hidden divergences are continuation signals, not reversal signals. Confusing the two types leads to trading against the trend
Originality Statement
This indicator is original in its multi-oscillator confluence approach to divergence detection. While divergence indicators exist for individual oscillators, this indicator is justified because:
The four-oscillator confluence system (RSI + MACD + MFI + Momentum) provides a reliability filter not available in single-oscillator divergence detectors. Each oscillator measures a different aspect of momentum, and their agreement substantially reduces false positives
The divergence strength scoring system quantifies signal quality using confluence weight, price magnitude, and oscillator magnitude — providing an objective measure for prioritizing signals
Fractal pivot anchoring ensures divergences are measured between genuine swing points rather than arbitrary lookback windows
The divergence decay tracking system provides a visual time-window for signal validity, addressing the common question of "how long is this divergence still relevant?"
The aggregate oscillator bias ribbon provides continuous momentum context independent of divergence signals
The history chain tracking reveals patterns in divergence sequences that can indicate structural trend weakening or choppy conditions
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Divergences are probabilistic patterns, not certainties — even high-confluence divergences can and do fail. Past divergence patterns do not guarantee future reversals. Target projections are mathematical estimates, not price predictions. Always use proper risk management including stop losses and position sizing. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

Indicator

Adaptive Regime Filter + Divergence (AER-VN) [KEYALGOS]Adaptive Regime Filter + Divergence (AER-VN)
Professional Grade Market Regime Classification with Advanced Divergence Detection
Precision trend identification using Adaptive Efficiency Ratio methodology
Volatility-normalized thresholds that adjust to real-time market conditions
Automatic divergence detection (Regular and Hidden) with visual confirmation lines
Four distinct market regimes with color-coded clarity
Zero-lag signal generation with confirmation logic
OVERVIEW
The Adaptive Regime Filter with Volatility Normalization (AER-VN) represents a sophisticated evolution of traditional trend filtering methodologies. This proprietary indicator combines Kaufman's Efficiency Ratio principles with dynamic volatility adaptation to classify market conditions into four actionable regimes: Uptrend, Downtrend, Choppiness, and Consolidation.
The integrated Divergence Detection System operates as a secondary analytical layer, identifying momentum exhaustion and trend continuation patterns through comparative analysis of price action versus efficiency metrics. Unlike standard oscillators that measure raw momentum, this system evaluates the quality of price movement, providing earlier and more reliable reversal signals.
METHODOLOGY AND TECHNIQUE
1. Adaptive Efficiency Ratio (AER) Core
Traditional efficiency ratios utilize static thresholds that fail across varying volatility environments. The AER-VN methodology introduces dynamic threshold calculation that self-adjusts based on current volatility relative to historical norms.
Displacement Measurement: Calculates net price movement over the lookback period
Path Distance Analysis: Sums absolute bar-to-bar movements to determine movement quality
Efficiency Calculation: Ratio of displacement to path distance (0.0 to 1.0 scale)
Threshold Adaptation: Baseline efficiency requirements scale proportionally with the ATR ratio
When volatility expands (ATR above mean), the system automatically raises the efficiency threshold required to qualify as "trending." This prevents false trend signals during volatile chop. Conversely, during low volatility periods, the threshold contracts to capture subtle trending behavior.
2. Volatility Normalization Engine
The Volatility Normalization component creates a relative volatility index by comparing current ATR readings against a rolling historical average. This produces an ATR Ratio that serves as the scaling factor for dynamic threshold calculation.
Current ATR: Short-term volatility measurement (default 14 periods)
Mean ATR: Long-term volatility baseline (default 50 periods)
Adaptive Scaling: Raw threshold = Base Threshold x ATR Ratio
Ceiling Protection: Maximum threshold cap prevents mathematically impossible requirements during extreme volatility events
3. Four Regime Classification System
Uptrend (Teal): Efficiency exceeds dynamic threshold with positive price displacement. Indicates high-quality upward movement with minimal retracement.
Downtrend (Maroon): Efficiency exceeds dynamic threshold with negative price displacement. Indicates sustained selling pressure with directional clarity.
Choppiness (Orange): Efficiency below threshold during above-average volatility. Characterized by noisy, directionless movement with large wicks and whipsaws.
Consolidation (Gray): Efficiency below threshold during below-average volatility. Represents quiet, range-bound markets with compressed price action.
4. Zero-Lag Divergence Detection
The divergence system employs confirmed swing detection to identify pivotal highs and lows without repainting. Once a swing point is confirmed (price violates the extreme), the system evaluates four divergence classifications:
Regular Bearish Divergence: Price records higher highs while Efficiency Ratio records lower highs. Indicates trend exhaustion and potential reversal to the downside.
Regular Bullish Divergence: Price records lower lows while Efficiency Ratio records higher lows. Indicates selling exhaustion and potential reversal to the upside.
Hidden Bearish Divergence: Price records lower highs while Efficiency Ratio records higher highs. Suggests continuation of the current downtrend after a pullback.
Hidden Bullish Divergence: Price records higher lows while Efficiency Ratio records lower lows. Suggests continuation of the current uptrend after a retracement.
Visual confirmation lines connect the relevant swing points on the indicator panel, allowing traders to verify divergence validity visually.
INPUT PARAMETERS AND CONFIGURATION
Efficiency Ratio Settings
ER Lookback (N)
Default: 10 | Range: 2+
The calculation period for efficiency measurement. Shorter values increase sensitivity to recent price action, suitable for scalping lower timeframes. Longer values smooth the oscillator, better for swing trading higher timeframes.
Base ER Threshold
Default: 0.25 | Range: 0.05 to 0.80 | Step: 0.05
The foundational efficiency level required in normalized volatility conditions. Higher values demand cleaner, more directional movement to trigger trending regime classification. Lower values allow noisier price action to qualify as trending.
Max Threshold Cap
Default: 0.65 | Range: 0.10 to 0.99 | Step: 0.05
The absolute ceiling for the dynamic threshold. This safety mechanism prevents the threshold from rising to levels mathematically impossible to achieve during extreme volatility expansion.
Volatility Normalization Settings
ATR Length
Default: 14 | Range: 1+
The lookback period for Average True Range calculation. Determines how quickly the system responds to changing volatility conditions.
ATR Mean Lookback
Default: 50 | Range: 5+
The historical window for establishing the volatility baseline. Longer periods create a smoother volatility reference, while shorter periods adapt more quickly to regime changes in volatility.
Divergence Detection Settings
Swing Definition Length
Default: 10 | Range: 3+
The lookback window for identifying swing highs and lows. Determines the minimum number of bars required to establish a pivot point. Lower values detect micro-swings (more signals, more noise). Higher values detect major swings (fewer signals, higher quality).
Visual Display Toggles
Show Regular Div Markers: Display circle markers for Regular Bearish and Regular Bullish divergences
Show Hidden Div Markers: Display circle markers for Hidden Bearish and Hidden Bullish divergences
Line: Regular Bearish: Draw connecting lines between swing highs for Regular Bearish divergences (Red)
Line: Regular Bullish: Draw connecting lines between swing lows for Regular Bullish divergences (Lime)
Line: Hidden Bearish: Draw connecting lines for Hidden Bearish divergences (Orange)
Line: Hidden Bullish: Draw connecting lines for Hidden Bullish divergences (Aqua)
Visual Settings
Color Price Bars
Toggle to apply regime colors directly to price candles/bars on the main chart. Uptrend (Teal), Downtrend (Maroon), Choppiness (Orange), Consolidation (Gray).
INTERPRETATION GUIDE
Reading the Oscillator
The main panel displays three critical elements:
Efficiency Ratio Line: The primary oscillator colored by current regime. Values near 1.0 indicate perfect efficiency (strong trend). Values near 0.0 indicate complete inefficiency (chop).
Dynamic Threshold: The white crossed line representing the current volatility-adjusted efficiency requirement. When the ER line crosses above this threshold, the regime shifts to trending.
Base Threshold Reference: The gray dotted line showing the static baseline (0.25 default) for reference.
Divergence Signal Interpretation
Red Circle (Regular Bearish): Momentum divergence at highs. Consider reducing long exposure or preparing short entries. Highest probability when appearing near resistance or after extended uptrends.
Lime Circle (Regular Bullish): Momentum divergence at lows. Consider reducing short exposure or preparing long entries. Highest probability when appearing near support or after extended downtrends.
Orange Circle (Hidden Bearish): Trend continuation signal in downtrends. Pullback likely ending, downtrend resumption probable.
Aqua Circle (Hidden Bullish): Trend continuation signal in uptrends. Retracement likely ending, uptrend resumption probable.
TRADING APPLICATIONS
Strategy 1: Regime-Based Trend Following
Enter long positions only when the indicator displays Teal coloring (Uptrend regime) and short positions only during Maroon coloring (Downtrend regime). Exit positions when the regime shifts to Orange or Gray, indicating the trending condition has ended.
Best for: Directional traders and trend followers
Timeframe: M15 and higher recommended for stability
Confluence: Combine with moving average alignment or breakout patterns
Strategy 2: Divergence Reversal Trading
Monitor for Regular Divergences (Red or Lime circles) as early warning systems. Wait for price confirmation (engulfing candles, pin bars) at the divergence point before entering. Use the connecting lines to visualize the divergence strength.
Best for: Counter-trend scalpers and swing traders
Timeframe: M5 to H1 depending on swing length settings
Confluence: Combine with support/resistance levels and volume analysis
Strategy 3: Chop Avoidance and Consolidation Breakout
Use the Orange (Choppiness) and Gray (Consolidation) regimes as "No Trade" zones or reduction zones. Wait for a divergence to form within these regimes, then enter when the regime shifts back to trending (Teal or Maroon), capturing the breakout momentum.
Best for: Patience-based traders seeking high-probability setups
Timeframe: Effective across all timeframes
Confluence: Combine with volume expansion on regime change
Strategy 4: Hidden Divergence Continuation
In established trends (Teal lasting 5+ bars), look for Hidden Bullish Divergences (Aqua) on pullbacks to enter additional long positions. In established downtrends (Maroon), look for Hidden Bearish Divergences (Orange) on rallies to add to shorts.
Best for: Position traders adding to winners
Timeframe: H1 to Daily for best results
Confluence: Combine with Fibonacci retracement levels
OPTIMIZATION GUIDELINES
For Lower Timeframes (M1 to M5)
Reduce ER Lookback to 6-8 for faster response
Lower Base ER Threshold to 0.15-0.20 to account for noise
Reduce Max Threshold Cap to 0.50-0.55
Shorten ATR Mean Lookback to 20-30
Reduce Swing Definition Length to 6-8 for micro-structure
For Higher Timeframes (H1 to Daily)
Increase ER Lookback to 14-21 for smoother readings
Maintain or increase Base ER Threshold to 0.30+ for quality control
Increase ATR Mean Lookback to 50-100 for stable volatility baselines
Increase Swing Definition Length to 10-20 for major pivots only
ALERTS AND NOTIFICATIONS
The indicator includes built-in alert conditions for:
Regular Bearish Divergence Detection
Regular Bullish Divergence Detection
Configure PulseWire alerts to trigger on these conditions to monitor markets without constant chart watching.
BEST PRACTICES AND RISK MANAGEMENT
Always confirm divergence signals with price action patterns (engulfing candles, pin bars, break of structure) rather than entering immediately on marker appearance.
Avoid trading divergence signals that occur deep within the Choppiness (Orange) regime without waiting for a regime shift confirmation.
Use the regime colors as a position sizing guide: Full size in Teal/Maroon, half size in Gray, flat or minimal in Orange.
The indicator excels when combined with support/resistance analysis. Divergences forming at key S/R levels carry significantly higher probability.
In ranging markets, decrease the Base ER Threshold to reduce whipsaws. In strongly trending markets, consider increasing it to filter out minor retracements.
TECHNICAL NOTES
The indicator does not repaint. Swing points require confirmation on the subsequent bar to print, ensuring signals remain fixed after formation.
All calculations utilize Pine Script v6 native functions for optimal performance and minimal resource usage.
The Volatility Normalization component prevents the common failure mode of static efficiency indicators during periods of expanding volatility.
Connecting lines for divergences are managed with automatic cleanup protocols to prevent chart clutter on extended runs.
SUPPORT AND UPDATES
This indicator is maintained by KeyAlgos. All users receive automatic updates as methodology improvements are implemented. For questions regarding parameter optimization or implementation strategies, utilize the PulseWire comments section on this publication.
Disclaimer: This indicator is a technical analysis tool designed to assist with market analysis, not a guaranteed profit system. Always practice proper risk management and use stop losses. Past performance of indicator signals does not guarantee future results. Indicator

Temporal Flow Analyzer [JOAT]Temporal Flow Analyzer
Introduction
The Temporal Flow Analyzer is an advanced open-source time-based analysis indicator that examines price flow across temporal dimensions, session dynamics, and time-weighted patterns to identify institutional activity timing and flow shifts. This indicator transforms time-based market data into actionable flow intelligence, helping traders identify when price flow is accelerating, decelerating, reversing, or experiencing temporal pressure changes.
Unlike basic trend indicators that ignore time dynamics, this system analyzes flow direction, flow strength, flow acceleration, session-based patterns, temporal pressure, and time zone positioning. The indicator is designed for traders who understand that institutional activity follows temporal patterns and that time-based analysis reveals flow dynamics invisible to price-only indicators.
Why This Indicator Exists
This indicator addresses a fundamental aspect of market analysis often overlooked: the temporal dimension of price flow. Markets don't just move in price - they move through time, and the relationship between price movement and time reveals institutional flow dynamics. The core innovation lies in analyzing multiple temporal dimensions:
Price Flow Analysis: Measures directional flow using dual-EMA comparison with strength and acceleration tracking
Session Analysis: Identifies Asian, London, and NY sessions with session high/low tracking and breakout detection
Temporal Momentum: RSI-based momentum with flow-weighted calculations and divergence detection
Volume Flow: Analyzes volume flow patterns, net pressure, and buying/selling flow dynamics
Time Zone Positioning: Determines if price is in premium, discount, or equilibrium zones within session range
Flow Shift Detection: Identifies when flow direction changes, signaling potential trend reversals
Flow Exhaustion: Detects when flow strength is high but acceleration is low, warning of exhaustion
Temporal Pressure: Combines price flow, volume flow, and flow strength into unified pressure metric
Each component reveals different aspects of temporal flow. Price flow shows direction, session analysis provides timing context, momentum shows strength, volume flow confirms participation, time zones show value, flow shifts warn of reversals, exhaustion signals caution, and temporal pressure quantifies intensity.
Core Components Explained
1. Price Flow Calculation
Price flow measures directional movement using dual exponential moving averages:
Price Flow = EMA(Close, Flow Period) - EMA(Close, Flow Period * 2)
This calculation creates a zero-centered oscillator:
- Positive values indicate bullish flow (faster EMA above slower EMA)
- Negative values indicate bearish flow (faster EMA below slower EMA)
- Magnitude shows flow strength
Flow Direction = Price Flow > 0 ? Bullish : Bearish
Flow Strength = Absolute(Price Flow) / ATR(14)
Flow strength normalization using ATR ensures cross-instrument comparison and removes price-level bias. Values above 1.5 indicate strong flow, 0.8-1.5 moderate flow, below 0.8 weak flow.
Flow Acceleration = Change in Price Flow over 3 bars
Positive acceleration indicates flow is building, negative acceleration indicates flow is fading. This provides early warning of flow changes before they become obvious in the main flow metric.
2. Session Detection and Analysis
The indicator identifies three major trading sessions using UTC hour detection:
Asian Session: Customizable start hour (default 0 UTC) to London start
London Session: Customizable start hour (default 7 UTC) to NY start
NY Session: Customizable start hour (default 12 UTC) to Asian start
Session tracking maintains:
- Session High: Highest price since session start
- Session Low: Lowest price since session start
- Session Start Bar: Bar index when session began
- New Session Flag: Triggers on session transitions
Session boxes are drawn showing the high/low range for each session, providing visual context for session-based support/resistance and breakout analysis.
3. Session Breakout Detection
Session breakouts mark when price exceeds previous session boundaries with conviction:
Session Breakout Up:
- High > Previous Session High
- Volume > Average Volume * 2.0
- Close > Previous Session High (confirms breakout, not just wick)
Session Breakout Down:
- Low < Previous Session Low
- Volume > Average Volume * 2.0
- Close < Previous Session Low
These breakouts often mark the start of significant moves as price breaks out of established ranges with institutional participation (confirmed by volume). The indicator places small labels marking breakout events.
4. Temporal Momentum Analysis
Temporal momentum combines RSI with flow-based weighting:
Momentum = RSI(Close, Momentum Length)
Momentum Flow = EMA(Momentum, 5)
Momentum Divergence = Momentum - Momentum Flow
Momentum Acceleration = Change in Momentum over 3 bars
Momentum classification:
- Overbought: Momentum > 70
- Oversold: Momentum < 30
- Neutral: Momentum between 30 and 70
The indicator tracks momentum divergence to identify when momentum is deviating from its trend, often preceding flow reversals.
5. Volume Flow Dynamics
Volume flow analysis separates buying and selling pressure:
Volume Flow = EMA(Volume, Volume Flow Period)
Volume Flow Delta = Current Volume - Volume Flow
Volume Flow Ratio = Current Volume / Volume Flow
Buying Pressure = Volume when Close > Open
Selling Pressure = Volume when Close < Open
Net Pressure = EMA(Buying Pressure - Selling Pressure, Volume Flow Period)
Net pressure reveals institutional positioning:
- Positive net pressure: Institutions accumulating (buying dominance)
- Negative net pressure: Institutions distributing (selling dominance)
- Magnitude shows intensity of positioning
6. Time Zone Position Analysis
The indicator calculates price position within the session range:
Session Range = Session High - Session Low
Session Mid = (Session High + Session Low) / 2
Premium Zone = Price > Session Mid + Range * 0.25 (upper 25%)
Discount Zone = Price < Session Mid - Range * 0.25 (lower 25%)
Equilibrium = Price between premium and discount zones
Smart money concepts suggest:
- Premium zones: Favorable for selling/distribution
- Discount zones: Favorable for buying/accumulation
- Equilibrium: No clear value edge
The dashboard displays current zone and suggested bias (SELL in premium, BUY in discount, WAIT in equilibrium).
7. Flow Shift Detection System
Flow shifts mark critical transitions in directional flow:
Flow Shift = Flow Direction changes from previous bar's direction
The indicator tracks the last flow direction and compares it to current direction. When they differ, a flow shift is detected. These shifts often mark:
- Trend reversals (shift from strong flow to opposite flow)
- Consolidation starts (shift from strong flow to weak flow)
- Breakout beginnings (shift from weak flow to strong flow)
Flow shift labels are placed at shift points with direction indicators (UP for bullish shift, DN for bearish shift).
8. Accumulation and Distribution Detection
The indicator identifies institutional accumulation/distribution using strict criteria:
Strong Accumulation:
- Close > Open (bullish candle)
- Volume > Average Volume * 2.5 (very high participation)
- Close > EMA(20) (above trend)
- Close > High (breaking above previous high)
- Momentum < 50 (not overbought)
Strong Distribution:
- Close < Open (bearish candle)
- Volume > Average Volume * 2.5
- Close < EMA(20) (below trend)
- Close < Low (breaking below previous low)
- Momentum > 50 (not oversold)
These strict criteria ensure only genuine institutional positioning is flagged, not retail noise. Labels mark accumulation ("A") and distribution ("D") events.
9. Flow Divergence Analysis
Flow divergences identify price-flow asymmetries:
Bullish Flow Divergence:
- Price makes lower low (Price < Price )
- Flow makes higher low (Flow > Flow )
- Momentum < 35 (oversold context)
- Flow Strength > 0.5 (significant flow)
Bearish Flow Divergence:
- Price makes higher high (Price > Price )
- Flow makes lower high (Flow < Flow )
- Momentum > 65 (overbought context)
- Flow Strength > 0.5
Divergences warn that flow is not confirming price extremes, often preceding reversals. The indicator places "DIV" labels at divergence points.
10. Flow Exhaustion Detection
Flow exhaustion occurs when flow strength is high but acceleration is low:
Flow Exhaustion = Flow Strength > 2.0 AND Absolute(Momentum Acceleration) < 0.5
This condition suggests flow has reached extreme levels but is no longer accelerating, often marking climax moves before reversals. Exhaustion labels ("EX") warn traders to prepare for potential flow reversal.
11. Temporal Pressure Calculation
Temporal pressure combines multiple flow dimensions:
Temporal Pressure = (Price Flow / ATR) * (Volume Flow Ratio - 1) * Flow Strength
This calculation creates a comprehensive pressure metric:
- Positive values: Bullish temporal pressure
- Negative values: Bearish temporal pressure
- Magnitude shows pressure intensity
Extreme pressure (absolute value > 2.0) often precedes significant moves or reversals depending on context.
12. Flow Velocity Analysis
Flow velocity measures the rate of price change over time:
Flow Velocity = Change in Close over 5 bars / 5
Flow Velocity EMA = EMA(Flow Velocity, 10)
Velocity Divergence = Flow Velocity - Flow Velocity EMA
Velocity Threshold = ATR * 0.2
Velocity classification:
- Fast: Absolute Velocity > Velocity Threshold
- Slow: Absolute Velocity <= Velocity Threshold
Fast velocity indicates rapid flow, slow velocity indicates gradual flow. Velocity divergence shows when current velocity differs from average velocity.
Visual Elements
Session Boxes: Colored boxes showing Asian (yellow), London (green), and NY (red) session ranges
Flow Shift Labels: Small labels marking flow direction changes (UP/DN)
Accumulation/Distribution Labels: Tiny labels marking institutional positioning (A/D)
Flow Divergence Labels: Labels marking price-flow asymmetries (DIV)
Session Breakout Labels: Labels marking session high/low breakouts (BO/BD)
Flow Exhaustion Labels: Labels warning of flow exhaustion (EX)
Time Zone Backgrounds: Subtle backgrounds showing premium (bearish) and discount (bullish) zones
Flow Direction Background: Very subtle background showing current flow direction
Session Level Lines: Dashed lines showing session high, mid, and low levels
Flow EMA Line: Line showing flow EMA for trend context
Comprehensive Dashboard: 12-row intelligence panel with all temporal flow metrics
The visual system is designed for clarity with minimal clutter - only significant events are marked, and backgrounds are very subtle to avoid distraction.
Input Parameters
Temporal Settings:
Flow Period: Period for flow calculation (10-50, default 20)
Session Length: Bars for session analysis (10-100, default 24)
Momentum Length: Period for momentum (5-30, default 14)
Volume Flow Period: Period for volume flow (5-30, default 10)
Features:
Price Flow Direction: Toggle flow analysis (default enabled)
Session Analysis: Toggle session detection (default enabled)
Temporal Momentum: Toggle momentum tracking (default enabled)
Volume Flow: Toggle volume analysis (default enabled)
Time-Based Zones: Toggle premium/discount zones (default enabled)
Flow Shift Signals: Toggle shift detection (default enabled)
Flow Divergence: Toggle divergence detection (default enabled)
Session Breakouts: Toggle breakout signals (default enabled)
Sessions:
Asian Session Start: Hour in UTC (0-23, default 0)
London Session Start: Hour in UTC (0-23, default 7)
NY Session Start: Hour in UTC (0-23, default 12)
Colors:
All colors are fully customizable including time bull (neon cyan), time bear (neon pink), session active (gold), flow positive (neon green), flow negative (pink), momentum high (purple), accumulation (cyan), and distribution (pink).
How to Use This Indicator
Step 1: Identify Flow Direction
Check dashboard "FLOW" field showing BULLISH or BEARISH. This indicates current directional flow. Note the status (STRONG/MODERATE/WEAK) showing flow strength.
Step 2: Monitor Flow Strength
Review "STRENGTH" metric showing flow intensity. Values above 1.5 indicate strong directional flow suitable for trend-following. Values below 0.8 suggest weak flow where range-bound strategies may work better.
Step 3: Watch Flow Acceleration
Check "ACCELERATION" showing ACCELERATING, DECELERATING, or STABLE. Accelerating flow confirms trend strength. Decelerating flow warns of potential exhaustion even if flow remains positive/negative.
Step 4: Identify Active Session
Review "SESSION" field showing ASIAN, LONDON, or NY. Different sessions have different characteristics - London and NY overlap often shows highest volatility and volume.
Step 5: Assess Volume Flow
Check "VOL FLOW" showing HIGH, NORMAL, or LOW. High volume flow confirms genuine institutional participation. Low volume flow suggests retail-dominated or thin-market conditions.
Step 6: Monitor Net Pressure
Review "PRESSURE" showing BUYING or SELLING with intensity (STRONG/MODERATE/WEAK). This reveals institutional positioning - sustained buying pressure suggests accumulation, sustained selling suggests distribution.
Step 7: Check Time Zone Position
Review "TIME ZONE" showing PREMIUM, DISCOUNT, or EQUILIBRIUM with bias suggestion. Buy in discount zones, sell in premium zones for optimal risk/reward aligned with smart money concepts.
Step 8: Watch for Flow Shifts
Flow shift labels mark critical transitions. These often provide early warning of trend changes before they're obvious in price. Shifts from strong flow to opposite flow are most significant.
Step 9: Use Divergence Warnings
Flow divergence labels warn when flow is not confirming price extremes. These often precede reversals and provide high-probability counter-trend entry opportunities.
Step 10: Monitor Flow State
Check "STATE" field showing current flow condition (EXHAUSTED, SHIFTING, BULL DIV, BEAR DIV, ACCUM, DISTRIB, or FLOWING). This provides immediate context for current flow dynamics.
Best Practices
Flow shifts with strong acceleration often mark the start of new trends
Session breakouts during London/NY overlap offer highest-probability setups
Accumulation in discount zones and distribution in premium zones are most reliable
Flow divergences at extreme momentum levels (>70 or <30) are most significant
Flow exhaustion signals work best when combined with time zone extremes
Strong volume flow confirmation separates genuine moves from false signals
Temporal pressure above 2.0 or below -2.0 often precedes significant moves
Flow velocity acceleration provides early entry timing before flow shift is obvious
Session high/low levels often provide support/resistance for intraday trading
Multiple flow shifts in short period suggest choppy conditions - reduce position size
Flow strength above 2.0 in discount zones offers optimal long entry conditions
Flow deceleration in premium zones warns of potential distribution
Indicator Limitations
Session detection uses UTC hours which may not align perfectly with actual market hours
Flow analysis works best on instruments with consistent intraday patterns
Volume flow requires accurate volume data - some instruments have unreliable volume
Time zone analysis assumes session ranges are meaningful - may not apply to all instruments
Flow shifts can whipsaw during genuinely transitional periods
Accumulation/distribution detection uses strict criteria - may miss some institutional activity
Flow divergences can persist longer than expected before price reverses
Session breakouts can be false - always use stop losses
The indicator shows flow dynamics but cannot predict news events or fundamental catalysts
Temporal pressure can remain extreme during strong trends
Flow exhaustion signals are warnings, not guarantees of reversal
Technical Implementation
Built with Pine Script v6 using:
Dual-EMA flow calculation with ATR-normalized strength measurement
Session detection using hour() function with customizable UTC start times
Session high/low tracking with reset on new session detection
RSI-based momentum with flow-weighted calculations
Volume flow analysis with buying/selling pressure separation
Net pressure calculation using EMA smoothing
Time zone position analysis using session range calculations
Flow shift detection using directional comparison
Strict accumulation/distribution criteria combining volume, price action, and momentum
Flow divergence detection using lookback comparison with strength filtering
Flow exhaustion identification combining strength and acceleration thresholds
Temporal pressure calculation integrating flow, volume, and strength
Flow velocity tracking with EMA smoothing and divergence calculation
Comprehensive dashboard with 12 metrics and color-coded status indicators
Minimal label system preventing chart clutter while maintaining signal visibility
The code is fully open-source with detailed comments explaining temporal flow concepts.
Originality Statement
This indicator is original in its comprehensive temporal flow analysis approach. While individual components (flow, sessions, momentum, volume) are established concepts, this indicator is justified because:
It integrates price flow, session analysis, momentum, and volume flow into a unified temporal framework
The flow shift detection system provides early warning of directional changes
Accumulation/distribution detection uses strict multi-factor criteria ensuring institutional-grade signals
Flow divergence analysis identifies price-flow asymmetries with strength filtering
Flow exhaustion detection combines strength and acceleration for climax move identification
Temporal pressure calculation synthesizes multiple flow dimensions into unified intensity metric
Time zone position analysis provides smart money context for entry timing
Session breakout detection with volume confirmation identifies high-probability setups
The comprehensive dashboard synthesizes 12 distinct metrics into unified temporal intelligence
Flow velocity and acceleration tracking provides early momentum shift detection
Each component reveals different temporal dynamics: flow shows direction, sessions provide timing, momentum shows strength, volume confirms participation, time zones show value, shifts warn of changes, divergences signal reversals, exhaustion marks climaxes, and pressure quantifies intensity. The indicator's value lies in combining these complementary perspectives into a cohesive temporal flow analysis system.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Temporal flow analysis is a tool for understanding time-based market dynamics, not a crystal ball for predicting future price movement. Flow shifts do not guarantee trend changes. Session breakouts do not guarantee continuation. Past flow patterns do not guarantee future flow patterns. Market conditions change, and strategies that worked historically may not work in the future.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. Flow shifts, divergences, exhaustion signals, and session breakouts do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Fractal Velocity Accelerator [JOAT]Fractal Velocity Accelerator
Introduction
The Fractal Velocity Accelerator is an advanced open-source momentum indicator that combines fractal efficiency measurement, adaptive Laguerre filtering, and Gaussian smoothing to create a multi-dimensional momentum oscillator with institutional-grade signal generation. This indicator transforms raw price data into a sophisticated momentum measurement system that reveals not just momentum direction and strength, but also velocity, acceleration, and regime characteristics.
Unlike traditional momentum indicators that simply measure rate of change, this system analyzes the efficiency of price movement through fractal mathematics, applies adaptive lag reduction through Laguerre transforms, and smooths data using 4th-order Gauss filters. The result is a momentum oscillator that responds quickly to genuine momentum shifts while filtering out noise and false signals.
Why This Indicator Exists
This indicator addresses fundamental limitations in traditional momentum analysis by introducing fractal efficiency concepts and adaptive filtering:
4th-Order Gauss Filter: Ultra-smooth OHLC data processing that eliminates noise while preserving genuine price movements
Fractal Efficiency Engine: Logarithmic path efficiency measurement that quantifies how directly price moves from point A to point B
Adaptive Laguerre Transform: Dynamic lag reduction that adjusts based on fractal efficiency, responding faster during efficient moves
Percentile-Based Bands: Self-adjusting overbought/oversold zones that adapt to each instrument's unique momentum characteristics
Velocity and Acceleration Tracking: First and second derivative calculations that identify momentum shifts before they're obvious
Momentum Regime Classification: Seven-level regime system from Extreme Bearish to Extreme Bullish with confidence measurements
Divergence Detection: Fractal-based divergence scanner that identifies price-momentum asymmetries
Each component provides unique intelligence about momentum dynamics. Gauss filtering ensures clean data, fractal efficiency measures directional clarity, Laguerre adaptation reduces lag, percentile bands provide context, velocity/acceleration track changes, regime classification guides strategy, and divergences reveal hidden shifts.
Core Components Explained
1. 4th-Order Gauss Filter System
The indicator applies a sophisticated Gaussian filter to all OHLC data:
w = (2.0 * math.pi / gaussLength)
beta = (1 - math.cos(w)) / (math.pow(1.414, 2.0 / betaDev) - 1)
alpha = (-beta + math.sqrt(beta * beta + 2 * beta))
Gc := math.pow(alpha, 4) * close +
4 * (1.0 - alpha) * nz(Gc ) -
6 * math.pow(1 - alpha, 2) * nz(Gc ) +
4 * math.pow(1 - alpha, 3) * nz(Gc ) -
math.pow(1 - alpha, 4) * nz(Gc )
This 4th-order filter provides exceptional smoothing while maintaining responsiveness. The filter uses four previous values with specific weightings that create a bell curve response, eliminating high-frequency noise while preserving genuine price movements.
The beta deviation parameter (default 2.0) controls filter aggressiveness. Higher values create more smoothing but add lag. Lower values maintain responsiveness but allow more noise. The default balances these tradeoffs optimally for most instruments.
2. Fractal Efficiency Calculation
Fractal efficiency measures how efficiently price moves by comparing net displacement to total path length:
sumRange = math.sum((math.max(Gh, nz(Gc )) - math.min(Gl, nz(Gc ))), fractalLength)
totalRange = ta.highest(Gh, fractalLength) - ta.lowest(Gl, fractalLength)
fractalGamma = if totalRange > 0
math.log(sumRange / totalRange) / math.log(fractalLength)
else
0.0
fractalEfficiency = math.max(0, math.min(1, (fractalGamma + 1) / 2))
The calculation uses logarithmic scaling to measure path complexity. When price moves in a straight line (high efficiency), the ratio approaches 1.0. When price moves erratically (low efficiency), the ratio approaches 0.0.
Fractal efficiency is normalized to 0-1 range where:
- 1.0 = Perfect efficiency (straight line movement)
- 0.7-1.0 = High efficiency (strong trending)
- 0.4-0.7 = Moderate efficiency (developing trend)
- 0.0-0.4 = Low efficiency (choppy/ranging)
This measurement is crucial because it determines how aggressively the Laguerre filter adapts.
3. Adaptive Laguerre Transform
The Laguerre filter applies adaptive lag reduction based on fractal efficiency:
gamma = laguerreGamma * (1 - fractalEfficiency) + 0.1 * fractalEfficiency
L0 := (1 - gamma) * Gc + gamma * nz(L0 )
L1 := -gamma * L0 + nz(L0 ) + gamma * nz(L1 )
L2 := -gamma * L1 + nz(L1 ) + gamma * nz(L2 )
L3 := -gamma * L2 + nz(L2 ) + gamma * nz(L3 )
cu = (L0 > L1 ? L0 - L1 : 0) + (L1 > L2 ? L1 - L2 : 0) + (L2 > L3 ? L2 - L3 : 0)
cd = (L0 < L1 ? L1 - L0 : 0) + (L1 < L2 ? L2 - L1 : 0) + (L2 < L3 ? L3 - L2 : 0)
laguerreRSI = cu + cd != 0 ? 100 * (cu / (cu + cd)) : 50
The Laguerre transform creates four cascading filters (L0-L3) that progressively smooth the data. The gamma parameter controls lag - lower gamma means less lag but more noise, higher gamma means more lag but smoother output.
The adaptive component adjusts gamma based on fractal efficiency:
- High efficiency (trending): Gamma decreases toward 0.1, reducing lag for fast response
- Low efficiency (choppy): Gamma increases toward laguerreGamma setting, adding smoothing to filter noise
The cu (count up) and cd (count down) calculations measure upward vs downward movement across the four Laguerre levels, creating an RSI-like oscillator that's far more responsive than traditional RSI.
4. Fractal Momentum Oscillator
The final momentum value combines Laguerre RSI with fractal efficiency:
rawMomentum = (laguerreRSI - 50) * (1 + fractalEfficiency)
momentumEMA = ta.ema(rawMomentum, 5)
fractalMomentum = math.max(-100, math.min(100, momentumEMA))
This calculation:
1. Centers Laguerre RSI around zero by subtracting 50
2. Amplifies the signal by (1 + fractalEfficiency), giving more weight to efficient moves
3. Smooths with 5-period EMA to reduce jitter
4. Bounds the result to -100 to +100 range
The efficiency amplification is key - during high-efficiency trending moves, momentum readings become more extreme, providing clear signals. During low-efficiency choppy moves, momentum readings stay muted, preventing false signals.
5. Velocity and Acceleration Tracking
The indicator calculates first and second derivatives of momentum:
momentumVelocity = ta.change(fractalMomentum, 1)
momentumAcceleration = ta.change(momentumVelocity, 1)
velocityEMA = ta.ema(momentumVelocity, 3)
Velocity (first derivative) shows the rate of momentum change. Positive velocity means momentum is increasing, negative velocity means momentum is decreasing.
Acceleration (second derivative) shows the rate of velocity change. Positive acceleration means velocity is increasing (momentum gaining speed). Negative acceleration means velocity is decreasing (momentum losing speed).
These metrics provide early warning of momentum shifts:
- Positive momentum + positive velocity + positive acceleration = Strong bullish momentum building
- Positive momentum + positive velocity + negative acceleration = Bullish momentum slowing (potential top)
- Positive momentum + negative velocity = Bullish momentum fading (reversal warning)
6. Momentum Regime Classification
The indicator classifies momentum into seven regimes:
Extreme Bullish: Momentum > threshold (default 60), very strong upward pressure
Strong Bullish: Momentum 40-60, solid upward pressure
Weak Bullish: Momentum 20-40, mild upward pressure
Neutral: Momentum -20 to +20, balanced conditions
Weak Bearish: Momentum -40 to -20, mild downward pressure
Strong Bearish: Momentum -60 to -40, solid downward pressure
Extreme Bearish: Momentum < -threshold, very strong downward pressure
Each regime includes confidence measurement equal to the absolute momentum value. Higher confidence indicates stronger regime conviction.
7. Adaptive Band System
The indicator uses percentile-based bands that adapt to each instrument:
momentumPercentile = ta.percentrank(fractalMomentum, bandLength)
dynamicOB = ta.percentile_linear_interpolation(fractalMomentum, bandLength, obLevel)
dynamicOS = ta.percentile_linear_interpolation(fractalMomentum, bandLength, 100 - obLevel)
These bands automatically adjust to the instrument's typical momentum range. An instrument that frequently reaches ±80 will have wider bands than one that typically stays within ±40. This prevents false overbought/oversold signals on volatile instruments and ensures sensitivity on stable instruments.
8. Fractal Divergence Detection
The indicator detects divergences using fractal pivot analysis:
momentumHigh = ta.pivothigh(fractalMomentum, divLookback, divLookback)
momentumLow = ta.pivotlow(fractalMomentum, divLookback, divLookback)
bullishDiv := lastPrice < prevPrice and lastMomentum > prevMomentum and lastMomentum < 0
bearishDiv := lastPrice > prevPrice and lastMomentum < prevMomentum and lastMomentum > 0
Regular divergences signal potential reversals:
- Bullish: Price makes lower low, momentum makes higher low (selling pressure weakening)
- Bearish: Price makes higher high, momentum makes lower high (buying pressure weakening)
Hidden divergences signal trend continuation:
- Hidden Bullish: Price makes higher low, momentum makes lower low (trend resumption after pullback)
- Hidden Bearish: Price makes lower high, momentum makes higher high (downtrend resumption after bounce)
Visual Elements
Multi-Layer Momentum Line: Three overlaid plots (white underlay, gradient middle, solid core) creating depth and visibility
Velocity Histogram: Histogram showing momentum velocity scaled 10x for visibility
Adaptive Bands: Dynamic overbought/oversold lines that adjust to instrument characteristics
Zone Fills: Gradient fills between bands and zero line showing bullish/bearish zones
Reference Lines: Horizontal lines at extreme (±60), strong (±40), and weak (±20) levels
Regime Background: Subtle background coloring showing current momentum regime
Divergence Labels: Text labels marking regular and hidden divergences
Reversal Signals: Labels marking extreme momentum reversals
Velocity Signals: Small labels marking velocity acceleration/deceleration
Comprehensive Dashboard: 14-row intelligence panel showing momentum value, regime, velocity, acceleration, efficiency, Laguerre RSI, trend strength, consistency, adaptive bands, and divergence status
The dashboard provides complete momentum intelligence with color-coded metrics and status indicators.
Input Parameters
Signal Architecture:
Extreme Momentum Reversals: Toggle high-confidence exhaustion signals (default enabled)
Fractal Divergence Detection: Toggle price-momentum asymmetry detection (default enabled)
Velocity Acceleration Alerts: Toggle momentum acceleration warnings (default enabled)
Extreme Momentum Threshold: Score required for extreme classification (40-90, default 60)
Gauss Filter:
Gauss Filter Length: Smoothing period (5-100, default 20)
Beta Deviation: Filter aggressiveness (0.5-5.0, default 2.0)
Fractal Engine:
Fractal Efficiency Length: Efficiency calculation period (10-200, default 50)
Laguerre Transform:
Laguerre Gamma: Base lag parameter (0.1-0.99, default 0.7)
Adaptive Bands:
Band Percentile Length: Percentile calculation period (20-500, default 100)
Overbought Level: Upper band percentile (50-95, default 75)
Oversold Level: Lower band percentile (5-50, default 25)
Divergence:
Enable Divergence Scanner: Toggle divergence detection (default enabled)
Divergence Lookback: Pivot detection period (3-20, default 5)
Visualization:
Momentum Intelligence Panel: Toggle dashboard (default enabled)
Momentum Regime Zones: Toggle background coloring (default enabled)
Velocity Histogram: Toggle velocity display (default enabled)
Dashboard Scale: Small/Normal/Large sizing (default Normal)
Colors:
All colors fully customizable including bullish momentum (neon cyan), bearish momentum (neon pink), extreme bullish (neon green), extreme bearish (neon red), neutral (gold), and divergence (neon purple).
How to Use This Indicator
Step 1: Assess Momentum Value and Direction
Check dashboard "MOMENTUM" value and direction. Positive values indicate bullish momentum, negative indicate bearish. Values above 60 or below -60 suggest extreme conditions that may precede reversals or strong continuations.
Step 2: Identify Current Regime
Review "REGIME" classification and confidence percentage. Extreme regimes with high confidence (>80%) indicate strong momentum that typically continues. Weak regimes suggest transitional conditions.
Step 3: Monitor Velocity and Acceleration
Check "VELOCITY" and "ACCEL" metrics. Positive velocity with positive acceleration suggests momentum is building. Negative acceleration while momentum is still positive warns of potential momentum exhaustion.
Step 4: Evaluate Fractal Efficiency
Review "EFFICIENCY" percentage. High efficiency (>70%) confirms that momentum is backed by clean, directional price movement. Low efficiency (<40%) suggests choppy conditions where momentum signals may be less reliable.
Step 5: Check Adaptive Bands
Monitor "OB LEVEL" and "OS LEVEL" showing dynamic overbought/oversold thresholds. When momentum exceeds these levels, watch for reversal signals or continuation acceleration.
Step 6: Watch for Divergences
Check "DIVERGENCE" status and look for divergence labels. Regular divergences at extreme momentum levels often precede significant reversals. Hidden divergences in established trends suggest continuation after pullbacks.
Step 7: Identify Extreme Reversals
Watch for "EXTREME REVERSAL" labels when momentum crosses from extreme territory. These high-confidence signals often mark major turning points or trend acceleration phases.
Step 8: Track Velocity Acceleration
Monitor velocity acceleration labels. "VELOCITY ACCEL" signals indicate momentum is gaining speed, often marking optimal entry timing in early trend phases.
Best Practices
Extreme momentum reversals (>60 or <-60) are most reliable when confirmed by velocity deceleration
High fractal efficiency (>70%) validates momentum signals as backed by clean price action
Divergences at extreme momentum levels offer highest-probability reversal setups
Velocity acceleration signals work best in early trend phases, less reliable in mature trends
Adaptive bands automatically adjust to instrument volatility - respect them as dynamic thresholds
Momentum regime transitions provide clear strategy adjustment points
Combine momentum analysis with price action for optimal entry timing
Laguerre RSI above 70 or below 30 confirms extreme momentum readings
Trend strength above 60 indicates strong momentum persistence
Trend consistency above 70 confirms momentum is directionally stable
Hidden divergences in strong trends (momentum >40 or <-40) suggest continuation opportunities
Neutral regime (-20 to +20) suggests range-bound conditions unsuitable for momentum strategies
Indicator Limitations
Momentum indicators are lagging by nature - they confirm trends rather than predict them
Extreme momentum can persist longer than expected during strong trends
Fractal efficiency requires sufficient price history - may be unreliable on newly listed instruments
Gauss filter adds smoothing which inherently introduces some lag
Adaptive bands require adequate history for percentile calculations
Divergences can persist for extended periods before price responds
The indicator works best on liquid instruments with consistent price action
Very low timeframes may produce excessive noise despite filtering
Velocity and acceleration are sensitive to sudden price spikes
Regime classification is probabilistic, not deterministic
The indicator shows momentum dynamics but cannot predict duration
Technical Implementation
Built with Pine Script v6 using:
4th-order Gaussian filter with customizable beta deviation
Logarithmic fractal efficiency calculation using path complexity measurement
Adaptive Laguerre transform with four cascading filter levels
Fractal momentum oscillator combining Laguerre RSI with efficiency amplification
First and second derivative calculations for velocity and acceleration
Seven-level momentum regime classification with confidence measurement
Percentile-based adaptive bands using linear interpolation
Fractal pivot-based divergence detection system
Multi-layer gradient visualization with depth effects
Comprehensive dashboard with 14 metrics and color-coded indicators
Alert system for reversals, divergences, and velocity signals
The code is fully open-source with extensive comments explaining fractal mathematics and adaptive filtering concepts.
Originality Statement
This indicator is original in its integration of fractal efficiency with adaptive momentum measurement. While individual components exist, this indicator is justified because:
It combines 4th-order Gauss filtering with fractal efficiency and Laguerre transforms in a unified system
The adaptive Laguerre gamma adjustment based on fractal efficiency is a novel approach to lag reduction
Fractal momentum amplification using efficiency multiplier creates regime-aware momentum measurement
Velocity and acceleration tracking provides multi-dimensional momentum analysis
Seven-level regime classification with confidence measurement guides strategy selection
Percentile-based adaptive bands automatically adjust to each instrument's characteristics
Fractal pivot-based divergence detection identifies asymmetries with statistical precision
The comprehensive dashboard synthesizes 14 distinct metrics into unified momentum intelligence
Multi-layer visualization with gradient effects provides exceptional clarity
Integration of efficiency, velocity, acceleration, and regime creates layered confirmation
Each component contributes unique intelligence: Gauss filtering ensures clean data, fractal efficiency measures directional quality, Laguerre adaptation reduces lag, momentum oscillator quantifies strength, velocity tracks changes, acceleration identifies inflections, regime classification guides strategy, bands provide context, and divergences reveal hidden shifts. The indicator's value lies in combining these complementary perspectives into a cohesive, adaptive momentum system.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Momentum analysis is a tool for understanding price dynamics, not a crystal ball for predicting future movement. Extreme momentum readings do not guarantee reversals. Divergences do not guarantee price response. Past momentum patterns do not guarantee future patterns. Market conditions change, and strategies that worked historically may not work in the future.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. Momentum readings, divergences, and regime classifications do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Chaos Regime Detection Engine [JOAT]Chaos Regime Detection Engine
Introduction
The Chaos Regime Detection Engine is an advanced open-source market microstructure indicator that classifies market conditions into distinct regimes using multi-dimensional volatility analysis, directional conviction measurement, and institutional flow detection. This indicator transforms raw market data into actionable regime intelligence, helping traders identify when markets are trending, ranging, chaotic, or experiencing volatility shocks.
Unlike single-dimension volatility indicators that only measure price movement magnitude, this engine analyzes market structure through four independent scoring systems that combine into a unified regime classification framework. The indicator is designed for traders who understand that different market regimes require different trading approaches and that regime identification is the foundation of adaptive strategy selection.
Why This Indicator Exists
This indicator addresses a fundamental challenge in trading: markets constantly shift between different behavioral regimes, and strategies that work in one regime often fail in another. The core innovation lies in synthesizing multiple market microstructure measurements into a probabilistic regime classification system:
Directional Flow Regime: Markets exhibiting high price efficiency, low choppiness, and strong ADX conviction - ideal for trend-following strategies
Equilibrium Regime: Markets showing balanced conditions with moderate volatility and weak directional bias - suitable for mean-reversion approaches
Chaotic Turbulence Regime: Markets displaying high choppiness, low efficiency, and conflicting signals - best avoided or traded with tight stops
Volatility Shock Regime: Markets experiencing extreme volatility expansion with high volume - requires defensive positioning or volatility strategies
Each regime classification is derived from normalized scores across multiple dimensions, ensuring that regime identification remains robust across different instruments, timeframes, and market conditions. The system provides not just regime labels but confidence levels and intensity measurements that quantify regime strength.
Core Components Explained
1. ATR and Volatility Percentile Analysis
The indicator calculates Average True Range (ATR) over a customizable period (default 14) and expresses it as a percentage of current price. This normalization allows cross-instrument comparison and removes price-level bias.
ATR percentile ranking over 100 bars provides context for current volatility relative to recent history. High percentile rankings (>70) indicate elevated volatility, while low rankings (<30) suggest compressed volatility. This percentile approach is superior to raw ATR because it adapts to each instrument's unique volatility characteristics.
The volatility percentile feeds into multiple regime scores, particularly the Volatility Shock score, which combines ATR percentile with standard deviation percentile and volume surge detection to identify extreme volatility events.
2. Kaufman Efficiency Ratio
The Efficiency Ratio measures how efficiently price moves from point A to point B by comparing net price change to total path length:
Efficiency = Net Price Change / Sum of Absolute Bar-to-Bar Changes
Values near 1.0 indicate highly efficient, directional movement (trending). Values near 0.0 indicate inefficient, choppy movement (ranging). The indicator uses a customizable lookback period (default 20) to calculate efficiency.
High efficiency feeds into the Directional Flow score, while low efficiency contributes to both Equilibrium and Chaotic Turbulence scores. This dual contribution ensures that the regime classification captures the full spectrum of market behavior.
3. Choppiness Index
The Choppiness Index quantifies market choppiness using logarithmic calculations:
Choppiness = 100 * log10(Sum of ATR / (Highest High - Lowest Low)) / log10(Length)
Values above 61.8 indicate choppy, range-bound markets. Values below 38.2 indicate trending markets. The indicator uses a customizable period (default 14) for this calculation.
The Choppiness Index is inverted when contributing to the Directional Flow score (100 - Choppiness) because low choppiness indicates high directional clarity. High choppiness directly contributes to the Chaotic Turbulence score, identifying markets where price action lacks clear direction.
4. ADX Directional Conviction System
The indicator implements a complete ADX (Average Directional Index) calculation including +DI and -DI components:
+DI measures upward directional movement strength
-DI measures downward directional movement strength
ADX measures the strength of directional movement regardless of direction
ADX values above the trend threshold (default 25) indicate emerging directional conviction. Values above the strong threshold (default 40) indicate dominant directional conviction. The indicator uses customizable lengths for both DI calculation (default 14) and ADX smoothing (default 14).
ADX contributes bonus points to the Directional Flow score when above threshold and to the Equilibrium score when below threshold. The difference between +DI and -DI provides directional bias (long vs short) and conviction strength measurements.
5. Standard Deviation and RVI Analysis
Standard deviation of close prices over 20 bars provides an alternative volatility measurement that captures price dispersion rather than range. The indicator calculates standard deviation as a percentage of price and ranks it using percentile analysis.
The Relative Volatility Index (RVI) applies standard deviation concepts to directional movement:
RVI = 100 * StdDev(Up Moves) / (StdDev(Up Moves) + StdDev(Down Moves))
RVI values above 50 indicate upward volatility dominance, below 50 indicates downward volatility dominance. This provides directional context to volatility measurements that raw standard deviation lacks.
Both metrics contribute to the Volatility Shock score, helping identify when markets are experiencing not just high volatility but directionally biased volatility expansion.
6. Volume Delta Integration
The indicator estimates buying and selling pressure using volume and candle structure:
Buy Volume = Volume when close > open
Sell Volume = Volume when close < open
Volume surge detection compares current volume to 20-period average using a customizable threshold (default 1.5x). Volume surges add bonus points to the Volatility Shock score, confirming that volatility expansion is accompanied by genuine institutional participation rather than thin-market noise.
This volume integration ensures that regime classifications reflect actual market activity rather than just price movement patterns.
7. Regime Scoring and Classification Engine
The indicator calculates four independent regime scores (0-100 scale):
Directional Score = (Efficiency * 100 + (100 - Choppiness) + ADX Bonus) / 2.2
Equilibrium Score = (100 - ATR Percentile + (100 - Efficiency * 100) + ADX Penalty) / 2.2
Turbulence Score = (Choppiness + (100 - Efficiency * 100)) / 2
Shock Score = (ATR Percentile + StdDev Percentile + Volume Surge Bonus) / 2.3
These scores are then normalized to sum to 100%, creating a probability distribution across the four regimes. The dominant regime is determined by the highest normalized score, with confidence level equal to that score's magnitude.
Regime intensity is classified as Nascent (score 35-45), Established (score 45-60), or Dominant (score >60), providing additional context about regime strength and stability.
8. Fractal Divergence Detection
The indicator implements fractal-based divergence detection using a composite volatility index that combines:
30% ATR Percentile
20% Efficiency Ratio
20% Inverted Choppiness
15% StdDev Percentile
15% RVI
This composite index is smoothed with a 5-period EMA and analyzed for fractal tops and bottoms using a 5-bar pattern recognition system. Divergences are detected when price makes new highs/lows but the composite volatility index fails to confirm, suggesting hidden institutional positioning or liquidity asymmetries.
Regular divergences signal potential reversals, while hidden divergences suggest trend continuation after pullbacks. The indicator plots these divergences with color-coded markers and draws connecting lines for visual clarity.
Visual Elements
Composite Volatility Line: Main plot showing the smoothed composite volatility index with dynamic gradient coloring based on regime confidence
Regime Intensity Histogram: Histogram showing regime-specific intensity with transparency based on confidence level
Microstructure Indicators: Subtle circle plots showing ATR percentile, efficiency ratio, and directional clarity for detailed analysis
Conviction Overlay: Stepline plot showing ADX with gradient coloring based on conviction strength
Fractal Divergence Markers: Circle plots at fractal tops/bottoms with color-coded divergence identification
Regime Threshold Lines: Horizontal lines at key regime transition levels (50, 60, 40, 75, 25)
Probability Zone Fill: Subtle background fill showing current regime probability field
Signal Shapes: Triangle shapes on price chart for high-confidence regime transitions and divergences
Comprehensive Dashboard: 12-row intelligence panel showing regime state, certainty, bias, probability scores, conviction, confluence, and all key metrics
The dashboard provides at-a-glance regime assessment with color-coded values, status indicators, and confidence measurements for all regime dimensions simultaneously.
Input Parameters
Signal Architecture:
Regime Shift Signals: Toggle chaos-to-order transition detection (default enabled)
Regime Persistence Signals: Toggle regime stability confirmations (default enabled)
Fractal Divergence Detection: Toggle hidden liquidity flow asymmetries (default enabled)
Minimum Confluence Threshold: Multi-factor validation requirement (1-5, default 3)
Volatility Microstructure:
Volatility Expansion Period: ATR calculation length (5-50, default 14)
Volatility Percentile Window: Percentile ranking lookback (20-500, default 100)
Price Efficiency Horizon: Efficiency ratio calculation period (5-100, default 20)
Chaos Measurement Period: Choppiness index length (5-50, default 14)
Directional Conviction:
Conviction Measurement Length: DI calculation period (5-50, default 14)
Conviction Smoothing Factor: ADX smoothing length (1-50, default 14)
Conviction Emergence Level: ADX trend threshold (15-40, default 25)
Conviction Dominance Level: ADX strong threshold (30-60, default 40)
Institutional Flow:
Enable Flow Asymmetry Detection: Toggle volume delta analysis (default enabled)
Flow Surge Multiplier: Volume threshold for surge detection (1.0-5.0, default 1.5)
Regime Parameters:
Directional Regime Threshold: Score required for directional classification (50-90, default 60)
Chaotic Regime Threshold: Score required for chaos classification (10-50, default 40)
Volatility Shock Threshold: Score required for shock classification (25-50, default 35)
Visualization:
Regime Intelligence Panel: Toggle dashboard display (default enabled)
Microstructure Indicators: Toggle detailed metric plots (default enabled)
Regime Probability Zones: Toggle background probability field (default enabled)
Intelligence Panel Scale: Small/Normal/Large dashboard sizing (default Normal)
Colors:
All colors are fully customizable including directional expansion (neon cyan), volatility shock (neon pink), equilibrium state (gold), and chaotic turbulence (sunset orange).
How to Use This Indicator
Step 1: Identify Current Regime
Check the dashboard "STATE" field to see current regime classification. Note the intensity level (Nascent/Established/Dominant) and certainty percentage. Dominant regimes with high certainty (>80%) are most reliable for strategy selection.
Step 2: Assess Regime Certainty
Monitor the "CERTAINTY" metric. High certainty (>60%) indicates clear regime conditions where strategies aligned with that regime should perform well. Low certainty (<40%) suggests transitional conditions where defensive positioning is appropriate.
Step 3: Check Directional Bias
Review the "BIAS" field showing Long Flow, Short Flow, or Neutral. This indicates whether directional conviction favors long or short positioning within the current regime. The numerical value shows conviction strength.
Step 4: Analyze Regime Probability Scores
Examine the four regime probability scores (Directional, Equilibrium, Turbulence, Shock). These show the relative likelihood of each regime. When one score dominates (>60%), regime classification is clear. When scores are balanced, market is transitional.
Step 5: Monitor Conviction Metrics
Check "CONVICTION" showing ADX value and status (Dominant/Emerging/Absent). Dominant conviction (>40) confirms that directional regimes have strong follow-through potential. Absent conviction (<25) suggests equilibrium or chaotic conditions.
Step 6: Evaluate Confluence Matrix
Review the "CONFLUENCE" score (0-5) showing how many confirmation factors align. Maximum confluence (5/5) indicates all factors agree, providing highest-confidence regime classification. Low confluence (1-2/5) suggests conflicting signals requiring caution.
Step 7: Watch for Regime Transitions
Regime transition signals (triangles on price chart) mark shifts between regimes. These are critical moments for strategy adjustment. Transitions from Chaos to Directional often mark the start of new trends. Transitions to Shock regimes warn of elevated risk.
Step 8: Use Divergence Signals
Fractal divergence markers (labeled "DIV") identify price-volatility asymmetries that often precede regime changes. Bullish divergences in Equilibrium regimes may signal upcoming Directional regimes. Bearish divergences in Directional regimes may warn of regime exhaustion.
Best Practices
Use Directional Flow regimes for trend-following strategies with trailing stops
Use Equilibrium regimes for mean-reversion strategies with defined profit targets
Avoid new positions during Chaotic Turbulence regimes or use very tight stops
Reduce position size or hedge during Volatility Shock regimes
Regime transitions with high confluence (4-5/5) offer highest-probability strategy shift opportunities
Dominant intensity regimes (>60% certainty) are most reliable for strategy execution
Nascent intensity regimes (<45% certainty) require defensive positioning until regime establishes
Monitor conviction metrics - Directional regimes without conviction (ADX <25) often fail
Fractal divergences are most reliable when they occur at regime extremes
Use the probability scores to anticipate regime transitions before they're officially classified
Equilibrium regimes with rising Directional scores suggest impending breakouts
Directional regimes with rising Turbulence scores warn of trend exhaustion
Indicator Limitations
Regime classification is probabilistic, not deterministic - no regime guarantees specific outcomes
The indicator identifies current regime but cannot predict regime duration
Regime transitions can be whipsaw-prone during genuinely transitional market conditions
Volume-based components require accurate volume data - some instruments have unreliable volume
The indicator works best on liquid instruments with consistent trading patterns
Newly listed instruments may lack sufficient history for reliable percentile calculations
Extreme market events (flash crashes, circuit breakers) can temporarily distort regime classification
The indicator shows what regime exists, not why - fundamental catalysts can override regime signals
Confluence scoring requires all factors to be relevant - some factors may be less meaningful on certain instruments
Fractal divergence detection requires clear fractal formation - choppy markets may produce false divergences
Regime intensity classifications are relative to recent history, not absolute across all market conditions
Technical Implementation
Built with Pine Script v6 using:
Complete ADX calculation with +DI/-DI components and customizable smoothing
Kaufman Efficiency Ratio using net change vs path length methodology
Choppiness Index with logarithmic normalization
Multi-component composite volatility index with weighted factor contributions
Percentile ranking calculations for ATR, standard deviation, and composite volatility
Fractal pattern recognition using 5-bar pivot detection
Divergence detection comparing price fractals to volatility fractals
Four-dimensional regime scoring system with normalization to probability distribution
Confluence factor calculation combining conviction, flow, clarity, certainty, and efficiency
Dynamic color gradients based on regime confidence and intensity
Comprehensive dashboard with 12 metrics and color-coded status indicators
Alert system for regime transitions, divergences, and conviction surges
The code is fully open-source with extensive comments explaining each calculation and regime classification logic.
Originality Statement
This indicator is original in its multi-dimensional regime classification approach. While individual components (ATR, Efficiency Ratio, Choppiness, ADX) are established concepts, this indicator is justified because:
It synthesizes four independent regime scoring systems into a unified probabilistic classification framework
The composite volatility index combines five distinct measurements with optimized weighting
Regime intensity classification (Nascent/Established/Dominant) provides confidence context beyond simple regime labels
Confluence scoring validates regime classification through multi-factor confirmation
Fractal divergence detection identifies hidden institutional positioning through volatility-price asymmetries
The normalization of regime scores to probability distribution ensures consistent interpretation across instruments
Integration of volume surge detection confirms that regime classifications reflect genuine market activity
The dashboard synthesizes 12 distinct metrics into a unified regime intelligence panel
Regime transition signals with confluence filtering provide high-confidence strategy adjustment points
The system adapts to each instrument's unique characteristics through percentile-based calculations
Each component contributes unique intelligence: ATR measures volatility magnitude, Efficiency measures directional clarity, Choppiness measures range-bound behavior, ADX measures conviction, volume confirms participation, and divergences reveal hidden positioning. The indicator's value lies in combining these complementary perspectives into a cohesive regime classification system that guides strategy selection.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Regime classification is probabilistic analysis that identifies current market conditions but does not predict future regime duration or transitions. Regime signals do not guarantee profitable trades. Past regime patterns do not guarantee future regime patterns. Market conditions change, and strategies that worked in historical regimes may not work in future regimes.
The metrics displayed are mathematical calculations based on current market data, not predictions of future price movement. Regime transitions, divergences, and confluence scores do not guarantee profitable trades. Users must conduct their own analysis and risk assessment before making trading decisions.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades Indicator

Displacement Lens [JOAT]Displacement Lens
Introduction
The Displacement Lens is an advanced open-source momentum analysis indicator that measures real-time displacement intensity by fusing four normalized momentum oscillators with volume-weighted candle body analysis. It produces a composite displacement score displayed as a gradient histogram with adaptive threshold bands, designed to separate institutional displacement candles from retail noise. This is not a simple oscillator mashup — it is a unified displacement measurement engine with institutional-grade features built on top of the core signal.
The indicator operates in its own pane (non-overlay) and provides traders with a clear, visual representation of when price is being displaced by institutional force versus when it is drifting on low-conviction retail flow.
Why This Indicator Exists
Standard momentum oscillators like RSI, CCI, or Bollinger %B each capture only one dimension of market momentum. Traders often flip between multiple oscillators trying to get a complete picture. The Displacement Lens solves this by:
Normalizing four independent oscillators (BB %B, CCI, ROC, RSI) to a common scale so they can be meaningfully combined
Weighting the composite by volume intensity and candle body ratio — because a large-bodied candle on high volume is institutional displacement, while a small-bodied candle on low volume is noise
Adding adaptive threshold bands that adjust to the signal's own volatility, rather than using fixed overbought/oversold levels that fail in different market conditions
Layering institutional features on top: decay detection, accumulation phases, divergence scanning, exhaustion markers, and a per-bar institutional candle grade
The result is a single composite signal that tells you not just "is momentum bullish or bearish" but "how strong is the institutional displacement right now, and is it accelerating, decaying, or exhausting?"
Core Signal Construction
The displacement signal is built in three stages:
Stage 1: Oscillator Normalization
Each of the four oscillators is normalized to a range using methods appropriate to each:
Bollinger %B: Measures where price sits within the Bollinger Bands. The raw %B (0 to 1) is remapped to with a soft clamp. When price is above the upper band, the score approaches +1. Below the lower band, it approaches -1.
CCI: The Commodity Channel Index is divided by 200 and clamped. CCI values beyond +/-200 saturate at +/-1, while values near zero produce scores near zero.
ROC: Rate of Change is normalized using adaptive scaling — it divides by twice its own standard deviation over 50 bars. This means the normalization adapts to the instrument's typical momentum range.
RSI: Remapped from the standard 0-100 range to by subtracting 50 and dividing by 50. RSI 70 becomes +0.4, RSI 30 becomes -0.4.
Each oscillator can be individually toggled on or off, and the composite averages only the active ones.
Stage 2: Volume-Weighted Displacement
The oscillator composite is blended with a volume displacement component:
float vol_displacement = disp_direction * body_ratio * vol_intensity
float raw_signal = osc_composite * (1.0 - vol_weight) + vol_displacement * vol_weight
Where:
disp_direction is +1 for bullish candles, -1 for bearish
body_ratio is the candle body size divided by the full range (high-low) — institutional candles have ratios above 0.7
vol_intensity is current volume relative to the 20-bar average, clamped to
vol_weight (default 0.3) controls how much volume influences the final score
This means a strong oscillator reading on a small-bodied, low-volume candle gets dampened, while a moderate oscillator reading on a large-bodied, high-volume candle gets amplified.
Stage 3: Smoothing and Thresholds
The raw signal is smoothed with an EMA (default period 5), and adaptive threshold bands are calculated as the signal's own standard deviation multiplied by a configurable factor (default 1.5x over 100 bars). This creates bands that widen in volatile markets and tighten in calm markets — far more reliable than fixed thresholds.
Institutional Features
1. Displacement Impulse Signals
When the signal crosses above the upper threshold for the first time (with volume and body confirmation), a bullish impulse label appears. Similarly for bearish. These mark the exact moment institutional displacement begins — not after it has already played out.
2. Momentum Divergence Engine
The indicator detects four types of divergence between price pivots and signal pivots:
Regular Bearish: Price makes a higher high, but the displacement signal makes a lower high — momentum is weakening despite price advance
Regular Bullish: Price makes a lower low, but the signal makes a higher low — selling pressure is fading
Hidden Bearish: Price makes a lower high, but the signal makes a higher high — continuation of downtrend likely
Hidden Bullish: Price makes a higher low, but the signal makes a lower low — continuation of uptrend likely
Divergences are detected using configurable pivot lengths and drawn as labeled markers directly on the histogram.
3. Displacement Decay Zones
When the signal was above the upper threshold but starts declining (still positive, but fading), the indicator marks a "decay zone" — a dotted box on the histogram showing where institutional momentum is waning. This is a unique concept: it identifies the transition from impulse to drift before the signal crosses zero. Bear decay zones work identically on the downside.
4. Accumulation Phase Detector
When both the signal and signal line are near zero (below half the standard deviation) for a minimum number of bars, the indicator draws a dashed "accumulation" box. These low-displacement consolidation phases often precede the next major impulse move. The concept is borrowed from Wyckoff methodology but applied to displacement scoring rather than price.
5. Institutional Candle Grading
Every bar receives a grade from D to A+ based on three factors:
Body ratio (how much of the candle is body vs wick) — 33.3% weight
Volume intensity (current volume vs 20-bar average) — 33.3% weight
Displacement alignment (how far the signal is from the threshold) — 33.4% weight
A+ candles (score >= 80) with body ratio > 0.7 and volume > 1.5x average are flagged as true institutional candles. The grade is shown in the dashboard.
6. Velocity Channel
The rate of change of the displacement signal itself is plotted as a velocity line with standard deviation bands. When velocity is expanding (accelerating), the displacement move has conviction. When velocity contracts, the move is losing steam. Optional glow effects make the velocity channel visually distinct.
7. Exhaustion Detection
Bullish exhaustion fires when the signal was above the threshold for 3 consecutive bars and then declines for 3 consecutive bars. Bearish exhaustion is the mirror. These are rare, high-conviction reversal signals that mark the exact point where institutional displacement has peaked and is reversing.
8. HTF Displacement Bias
The indicator calculates the same displacement composite on a higher timeframe (default 4H) using request.security(). When the current timeframe signal aligns with the HTF bias, conviction is higher. The dashboard shows whether HTF is BULLISH, BEARISH, or NEUTRAL and whether it is aligned with the current signal.
9. Displacement Streak Counter
Tracks how many consecutive bars the signal has been above the upper threshold (bull streak) or below the lower threshold (bear streak). Longer streaks indicate sustained institutional pressure.
Visual Elements
Gradient Histogram: The main displacement signal plotted as columns with gradient coloring — bullish bars transition from muted teal to bright teal as strength increases, bearish bars from muted rose to hot rose. Volume spike bars are highlighted in amber.
Signal Line: A further-smoothed version of the signal (3x the smoothing period) plotted as a bright lavender line. Crossovers between the signal and signal line generate diamond markers.
Adaptive Threshold Bands: Upper and lower threshold lines that expand and contract with signal volatility.
Decay Zones: Dotted boxes marking fading institutional momentum.
Accumulation Zones: Dashed boxes marking low-displacement consolidation.
Velocity Channel: Rate-of-change line with glow bands showing displacement acceleration.
15-Row Dashboard: Comprehensive command center showing Signal value, Phase classification, Candle Grade, HTF Bias, Streak, Velocity, Divergence status, and more.
Input Parameters
Oscillator Components:
BB Length (default 20), BB Multiplier (default 2.0)
CCI Length (default 23), ROC Length (default 50), RSI Length (default 14)
Individual toggles for each oscillator
Displacement Engine:
Signal Smoothing (default 5) — EMA period for the final signal
Volume Weight (default 0.3) — how much volume influences the score
Threshold Lookback (default 100) — period for adaptive threshold calculation
Threshold Multiplier (default 1.5) — sensitivity of threshold bands
Institutional Features:
Toggles for Impulse Signals, Divergences, Decay Zones, Accumulation Phases, Signal Crossovers, Velocity Channel, Exhaustion Markers, HTF Bias
HTF Timeframe (default 240 / 4H)
Accumulation Min Bars (default 8), Decay Min Bars (default 5)
Max Boxes (default 30), Divergence Pivot Length (default 5)
How to Use This Indicator
Step 1: Read the Phase
The dashboard shows the current displacement phase: IMPULSE BULL, IMPULSE BEAR, DRIFT BULL, DRIFT BEAR, DECAY, ACCUMULATION, or FLAT. This tells you the market's current displacement state at a glance.
Step 2: Watch for Impulse Signals
When the signal crosses the threshold with volume confirmation, an impulse label appears. These are the highest-conviction displacement events — institutional money is moving price.
Step 3: Monitor Decay and Exhaustion
After an impulse, watch for decay zones forming. If the signal was strong and starts declining, the move is losing institutional backing. Exhaustion markers confirm the reversal point.
Step 4: Confirm with HTF Bias
Check whether the HTF displacement aligns with the current timeframe. Aligned signals have higher follow-through probability.
Step 5: Use Divergences for Reversals
Regular divergences warn of potential reversals. Hidden divergences confirm trend continuation. Both are detected automatically.
Step 6: Identify Accumulation for Breakout Setups
When the indicator marks an accumulation phase (low displacement for extended bars), prepare for the next impulse. The breakout direction is often confirmed by the first impulse signal after accumulation ends.
Limitations
The indicator measures displacement intensity, not price direction prediction. Strong displacement can occur in both breakouts and fakeouts.
Volume data quality varies by instrument and exchange. Forex volume on PulseWire represents tick volume, not true volume.
HTF bias uses request.security() which may produce different results on different chart types.
Divergence detection requires sufficient pivot history — it will not fire on the first few hundred bars of a chart.
Exhaustion signals are intentionally rare (require 3 bars above threshold + 3 bars declining). They may not fire in fast-moving markets.
The indicator works best on liquid instruments with consistent volume patterns.
Past displacement patterns do not guarantee future price movement.
Originality Statement
This indicator is original in its unified displacement measurement approach. While individual oscillators (BB %B, CCI, ROC, RSI) are well-known, this indicator is justified because:
It normalizes four oscillators to a common scale using methods appropriate to each (adaptive scaling for ROC, division-based for CCI, remapping for RSI and BB %B) — not simply averaging raw values
The volume-weighted displacement component integrates candle body analysis with volume intensity, creating a measure that distinguishes institutional candles from retail noise
Adaptive threshold bands based on the signal's own standard deviation replace unreliable fixed thresholds
The Displacement Decay Zone concept — identifying the transition from impulse to drift before the signal crosses zero — is not available in standard oscillators
The Accumulation Phase Detector applies Wyckoff-inspired consolidation detection to a composite momentum score rather than price
The Institutional Candle Grading system scores every bar on three dimensions simultaneously (body, volume, displacement alignment)
The Velocity Channel measures the rate of change of displacement itself — a second derivative that reveals acceleration and deceleration of institutional activity
The combination of all these features with a comprehensive dashboard creates a unified displacement analysis system not available in any single existing indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
The displacement signal measures momentum intensity based on mathematical calculations of current and historical market data. It does not predict future price movement. High displacement does not guarantee profitable trades. Past displacement patterns do not guarantee future patterns.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions.
-Made with passion by officialjackofalltrades
Indicator

Trader in War(By Vahid.Jz)IR EnTrader in War (By Vahid.Jz) IR - Professional Trading Assistant
🎉 The first Persian indicator on PulseWire, released for free to celebrate my daughter's (Atena / Avina) birthday. 🎉
First in corona, next in war...
Trading Assistant (by Vahid.Jz) is an all-in-one professional tool designed to simplify market analysis and improve trading accuracy. It serves as an intelligent trading companion.
Key Features:
Advanced Market Structure Analysis
Multi-Timeframe “Third Eye” Trend Overview
Professional Order Blocks (Supply & Demand) Detection
Fair Value Gaps (FVG) Identification
Powerful Divergence Detector
Neo Elliott Wave Labeling
Highly Customizable Alerts System
Sections & Inputs Guide:
1. Trading Assistant (Range / Consolidation Zones)
Main activation switch. When turned on, it enables all visual signals, labels, and alerts. Optimized especially for range-bound and consolidation markets.
2. Market Structure
Mid-term: Controls swing-level structure display (All, Shift, Sharp Shift, Momentum, None).
Short-term / Range Zones: Manages internal structure behavior.
Third Eye: Shows market structure trend direction (Bullish or Bearish) across 7 timeframes (5m to 1W).
3. Order Blocks (Supply / Demand)
Show Max Zones: Sets the maximum number of visible Order Blocks.
Show Strongest Zones Only: Displays only the highest volume percentage zones.
Timeframe: Selects the calculation timeframe for Order Blocks.
Text Size: Adjusts the size of volume text on the zones.
4. Unfilled Gaps (FVG)
Hidden Gaps: Enables display of hidden Fair Value Gaps.
Timeframe: Selects the timeframe used for FVG detection.
Max Gaps: Maximum number of gaps to keep on the chart.
Max Gap Range: Maximum bar distance for valid gaps.
5. Advanced Ichimoku
Activates the enhanced Ichimoku Cloud with multi-timeframe capability, including Tenkan-sen, Kijun-sen, Chikou Span, and Senkou Spans.
6. Neo Elliott Waves
Show Wave Labeling: Automatically detects and labels Elliott Wave patterns (a, b, c).
Show Invalid Waves: Option to display broken or invalidated wave structures.
7. Divergence Detector
Advanced divergence detection using multiple oscillators.
Includes several signal types: Custom Divergence, Volume Divergence, Hidden Gap Divergence, Divergence in Trend, and Inverse Trend Divergence.
8. Smart Signals
Section for enabling and filtering different signal combinations with confirmation options (Ichimoku Cloud or Tenkan/Kijun).
9. Alerts
Fully customizable alert system covering structure changes, Order Block touches, strongest zones, Fair Value Gaps, and Elliott Wave detections.
Developed with love by Vahid.Jz — Trader and Pine Script enthusiast with over 10 years of real-market experience.
“Trading is not a destination; it’s the journey — a path of learning, growth, and experience.”
Final Message:
If this indicator helps you trade better and protects you from losses, please share it with your friends and fellow traders.
The more people use professional tools, the fewer losses they will suffer in the market.
Your support and sharing motivate me to release more hidden and powerful versions in the future.
Thank you for being part of this journey. Indicator
