Volatility Squeeze Oscillator [JOAT]Volatility Squeeze Oscillator
Introduction
Volatility does not move randomly. It compresses, coils, and then releases — and the magnitude of the release is frequently proportional to the depth and duration of the compression. This relationship between volatility contraction and subsequent expansion is one of the most durable patterns in market behavior across all asset classes and timeframes. The Volatility Squeeze Oscillator is built to quantify this relationship with precision, using a multi-layered analysis framework that goes well beyond standard squeeze detection.
At its core, the indicator uses an ATR compression ratio engine to measure the difference between a short-term and long-term ATR. When the short-term ATR is smaller than the long-term ATR, volatility is contracting — the market is coiling. When the short-term ATR expands beyond the long-term reference, the coil is releasing. This compression differential is normalized against the high-low range, making the oscillator comparable across different instruments and volatility regimes.
Three additional analytical layers are stacked on top of the compression engine. A cumulative delta proxy estimates buying versus selling pressure within each bar using range-based calculations — no Level 2 or order flow data required. A volume RSI module measures whether the current volume is elevated relative to its own history, providing a confluence filter that separates high-conviction from low-conviction squeeze releases. And a statistical deviation band system built on a 200-bar lookback marks the historically significant boundaries of the squeeze oscillator's own distribution, so traders can identify not just whether a squeeze is forming, but how extreme it is relative to its own history.
Core Concepts
1. ATR Compression Ratio Engine
The compression ratio is derived from two ATR calculations at different smoothing periods. Both use EMA smoothing rather than RMA (Wilder's method) to produce a more responsive and visually cleaner oscillator. The short-term ATR reflects current volatility conditions. The long-term ATR (calculated at double the base period) establishes the reference level representing the recent historical norm. The difference between these two — long minus short — is the squeeze value: positive when the market is contracting (short ATR below long-term baseline), negative when expanding.
trueRange = ta.tr(true)
atrShort = ta.ema(trueRange, len)
atrLong = ta.ema(atrShort, len * 2)
sqzRaw = atrLong - atrShort
hlRange = ta.highest(high, len) - ta.lowest(low, len)
sqzVal = hlRange > 0 ? sqzRaw / hlRange : 0
Normalizing by the HL range makes the oscillator dimensionless — a squeeze value of 0.3 carries the same meaning whether you are analyzing a $1 stock or a $50,000 Bitcoin contract. The signal line is an EMA of the squeeze value, used to detect the inflection point where the squeeze begins to build (sqzVal crossing above sqzSig) or release (sqzVal crossing below sqzSig).
2. Hyper-Squeeze Detection
A hyper-squeeze occurs when the squeeze value is not merely positive (compressing) but is actively rising for N consecutive bars — indicating an accelerating contraction rather than a stable one. Accelerating compression is particularly significant because it suggests market participants are increasingly reducing their activity, creating a coiled spring effect where the eventual release may be more forceful.
hyperSqz = sqzVal > 0 and ta.rising(sqzVal, hyperLen)
When a hyper-squeeze is active, a violet tint is overlaid on the oscillator background in addition to the regular delta-driven background color. The dashboard updates the hyper squeeze row to ACTIVE status. This dual visual layer makes extended compression phases immediately distinguishable from ordinary positive squeeze readings.
3. Cumulative Delta Proxy
Order flow analysis — understanding whether buyers or sellers are dominant within a given period — typically requires tick-level data or exchange-provided volume breakdown. This indicator constructs a proxy for cumulative delta using bar-level range analysis, making the information accessible without any data feed requirements.
barRange = high - low
bullPress = barRange > 0 ? (close - low) / barRange : 0.5
bearPress = barRange > 0 ? (high - close) / barRange : 0.5
deltaBar = bullPress - bearPress
deltaSma = ta.sma(deltaBar, deltaLen)
deltaPos = deltaSma > 0
A close near the high of the bar implies buyers dominated (bull pressure near 1.0). A close near the low implies sellers dominated (bear pressure near 1.0). The difference, smoothed over a configurable window, produces a normalized delta reading. When delta is positive during a squeeze, the compressed volatility is accumulating with a bullish lean. When negative, with a bearish lean. This directional information is used both in the histogram coloring (alpha derived from delta conviction) and in dashboard output.
4. Volume RSI Confluence
Volume RSI applies the standard RSI momentum formula to the volume series rather than price. This produces a normalized reading of whether current volume is elevated or depressed relative to its recent distribution. A high volume RSI (default threshold: 65) during a squeeze release indicates that the expansion is occurring on above-average participation — a meaningful distinction from low-volume releases that can quickly reverse.
volRsi = ta.rsi(volume, 14)
highVol = volRsi > volThresh
The volume RSI value and status are displayed in the dashboard. Alert conditions include a "high-volume release" alert specifically when both a squeeze release signal and elevated volume RSI occur simultaneously, providing a higher-conviction composite signal.
5. Statistical Deviation Bands
Rather than using fixed threshold lines at arbitrary values, the oscillator's own distribution is analyzed statistically using a 200-bar lookback. The mean and one and two standard deviation levels of the squeeze value over this window establish dynamically updating bands. These bands are filled with a gradient and rendered at adaptive transparency based on the current Z-score — as the oscillator approaches the 2σ band, the fill becomes more opaque, visually emphasizing extreme readings.
sqzMean = ta.sma(sqzVal, statLen)
sqzStd = ta.stdev(sqzVal, statLen)
band1Up = sqzMean + sqzStd
band2Up = sqzMean + 2 * sqzStd
band1Dn = sqzMean - sqzStd
band2Dn = sqzMean - 2 * sqzStd
zScore = sqzStd > 0 ? (sqzVal - sqzMean) / sqzStd : 0
A squeeze reading above the 2σ upper band is historically anomalous compression — significantly above what has been typical over the prior 200 bars. Such readings often precede the most explosive release moves.
6. Histogram Coloring and Background Rendering
The histogram bar colors encode two simultaneous dimensions. The base color is red when the squeeze is building (sqzVal above sqzSig) and teal when releasing (sqzVal below sqzSig). The alpha channel of each bar is modulated by the absolute value of the delta conviction — high delta conviction produces more saturated colors, while low-conviction delta (price closing near the bar midpoint) produces more transparent bars. The background color is a 93% alpha gradient driven entirely by delta: teal for bullish delta, red for bearish delta, with the hyper-squeeze violet tint layered on top when active.
Features
ATR Compression Ratio Engine: Measures the difference between short-term and long-term EMA-smoothed ATR, normalized by HL range for cross-instrument comparability.
Signal Line: EMA of the squeeze value provides the crossover reference for detecting compression buildup and release initiation.
Hyper-Squeeze Detection: Identifies accelerating compression phases where the squeeze is rising for N consecutive bars simultaneously.
Cumulative Delta Proxy: Bar-range-based buying and selling pressure estimate, smoothed and normalized, requiring no Level 2 data.
Volume RSI Confluence: RSI applied to volume series identifies above-average participation, separating high-conviction releases from low-volume ones.
Statistical Deviation Bands: 200-bar mean and sigma levels with gradient fill and adaptive transparency based on Z-score position.
Delta-Driven Alpha Histogram: Histogram color and opacity encode both squeeze direction and delta conviction simultaneously.
Layered Background Coloring: Delta-based background with hyper-squeeze overlay provides immediate pane-level context without requiring close inspection.
Signal Markers: Circle markers at oscillator bottom on squeeze cross and release cross events.
Seven-Row Dashboard: Real-time status covering state, hyper squeeze, volume RSI, delta bias, Z-score, and squeeze value.
Four Alert Conditions: Squeeze building, release detected, hyper squeeze active, and high-volume release composite signal.
Input Parameters
ATR Settings:
Base Length: Period for short-term ATR EMA and HL range lookback (default: 20)
Hyper-Squeeze Settings:
Hyper Squeeze Consecutive Bars: Number of consecutive rising bars required for hyper-squeeze (default: 3)
Delta Settings:
Delta Smoothing Window: SMA period for the delta bar average (default: 10)
Volume RSI Settings:
Volume RSI Period: RSI lookback applied to volume series (default: 14)
Volume RSI Threshold: Level above which volume is considered elevated (default: 65)
Statistical Bands Settings:
Statistical Lookback: Bar count for mean and standard deviation computation (default: 200)
Show Bands: Toggle deviation band fills (default: true)
Display Settings:
Show Background: Toggle delta and hyper-squeeze background coloring (default: true)
Show Signal Markers: Toggle circle markers at squeeze and release crosses (default: true)
Show Dashboard: Toggle the seven-row information table (default: true)
How to Use This Indicator
Step 1: Monitor the Squeeze State
The primary read from this oscillator is the current state displayed in the dashboard: SQUEEZING, RELAXING, or EXPANDING. Squeezing means the compression ratio is positive and rising — the market is actively coiling. Relaxing means the compression is positive but flattening or declining — the coil is beginning to unwind. Expanding means the oscillator has gone negative — volatility is actively expanding beyond the historical baseline. The transition from SQUEEZING to RELAXING is the early warning signal; the transition to EXPANDING is confirmation that the release has begun.
Step 2: Watch for Hyper-Squeeze Conditions
When the dashboard shows HYPER SQUEEZE: ACTIVE and the chart shows the violet tint overlay, the compression is accelerating — each bar the market is coiling tighter. These conditions historically precede more forceful releases. In hyper-squeeze conditions, position sizing on the anticipated breakout can be considered carefully, as the magnitude of the release may be larger than during ordinary squeeze exits.
Step 3: Check Delta Bias for Directional Lean
Before committing to a directional bias, check the delta row in the dashboard. Positive delta (bullish) during a squeeze indicates that even during compression, buyers have been closing bars near the upper portion of their range — a bullish accumulation signature. Negative delta (bearish) suggests the opposite. Delta bias does not guarantee direction, but it provides a useful lean when combined with the squeeze release signal.
Step 4: Require Volume RSI Confluence on Release
Not all squeeze releases produce sustained moves. Low-volume releases frequently reverse within a few bars. The "High-Volume Release" alert fires only when both a release cross and elevated volume RSI (above threshold) occur simultaneously. Waiting for this composite signal before acting on a release — rather than responding to the release cross alone — filters out a meaningful number of false expansion signals in low-participation environments.
Indicator Limitations
The ATR compression ratio measures relative volatility contraction but cannot determine the direction of the eventual breakout. This indicator identifies when a release is likely, not which way price will move. Directional analysis must come from structure, trend, or other contextual tools.
The delta proxy is a bar-level approximation of order flow. It does not access actual tick data, order book data, or trade-level information. In markets with high-frequency activity, the close-to-high/low ratio can systematically misrepresent actual buying and selling pressure.
The statistical deviation bands require 200 bars to be fully seeded. On instruments or timeframes with limited history, or immediately after loading a new chart, the bands may produce unreliable readings until sufficient data is available.
Volume RSI confluence is not applicable to instruments where volume data is unreliable, unavailable, or represents synthetic aggregation (some forex pairs, certain CFDs). In these cases, the volume RSI row should be treated as informational only.
The hyper-squeeze condition measures consecutive rising bars in the squeeze value. This makes it sensitive to the base period setting — shorter periods produce more variable squeeze values, leading to more frequent interruptions of the consecutive count.
This indicator operates entirely on the chart's native timeframe. It does not incorporate multi-timeframe squeeze data — a squeeze on a 15-minute chart may be occurring within the context of a much larger timeframe expansion that this indicator would not reflect.
Originality Statement
The Volatility Squeeze Oscillator is a purpose-built analytical instrument that combines techniques not previously assembled in this specific architecture.
The ATR compression ratio engine — using EMA-smoothed ATR at the base period versus double the base period, normalized by the HL range — is an original squeeze quantification method. It differs from the widely used Lazybear TTM Squeeze (which measures Bollinger Band width versus Keltner Channel width) by operating entirely within the ATR framework with range normalization.
The hyper-squeeze detection via ta.rising() on the already-positive squeeze value identifies accelerating compression as a distinct state separate from ordinary compression, a categorization not found in standard squeeze implementations.
The cumulative delta proxy using bar-range ratios (close minus low divided by range for bull pressure; high minus close divided by range for bear pressure), smoothed and normalized, provides order-flow-inspired information without any data dependency beyond OHLC — an original application of range analysis.
The integration of volume RSI as a confluence gate within the squeeze oscillator framework — not as a separate indicator but as an internal filter with dedicated dashboard output and composite alert conditions — is an original design choice.
The statistical deviation band system applied to the squeeze oscillator's own values (using a 200-bar SMA and StDev of the squeeze value itself) to create adaptive significance thresholds is an original meta-statistical layer not found in comparable oscillators.
Disclaimer
The Volatility Squeeze Oscillator is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Identifying squeeze conditions does not predict the direction or magnitude of subsequent price moves with any certainty. All trading involves risk of loss. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Regime & Structure Engine [JOAT]Regime & Structure Engine
Introduction
Markets do not move randomly — they cycle through defined behavioral states: trending phases where momentum compounds in one direction, and ranging phases where price consolidates before the next impulse. Identifying which state the market is currently in, and detecting when structural breaks signal a transition, is fundamental to any disciplined trading approach. The Regime & Structure Engine is built around that single core principle: before anything else, know your regime.
This indicator unifies three distinct analytical layers into a single overlay system. The first layer is the Hull-EMA Hybrid (HEMA), a custom moving average that resolves the trade-off between smoothness and responsiveness by combining double-weighted EMA calculation with a square-root length final smoothing. The second layer is a three-state confirmed regime engine that uses the relative alignment of three HEMA periods to classify market condition as bull, bear, or neutral — with a mandatory two-bar confirmation to eliminate false transitions. The third layer is a market structure engine based on classical swing pivot logic, capable of identifying Break of Structure (BOS) and Change of Character (CHoCH) events that signal genuine momentum shifts.
All of this is augmented by a Z-score cumulative impulse detector that quantifies the statistical significance of directional momentum streaks, a trend cloud that visually represents regime state through gradient fills, proximity-based bar coloring that encodes distance from the HEMA mid-layer, a configurable alert system, and a compact six-row dashboard. Every signal in this indicator is anchored to confirmed bars only, eliminating any look-ahead repainting.
Core Concepts
1. Hull-EMA Hybrid (HEMA) Moving Average
The foundational calculation of this indicator is the HEMA — a three-step smoothing function that delivers both noise reduction and lag compensation. A standard EMA applies uniform smoothing that creates meaningful lag on higher periods. Hull Moving Averages address lag through weighted differencing but can produce jagged outputs. The HEMA bridges this by constructing the Hull-style weighted difference first, then applying a square-root-period EMA as the final smoother.
f_hema(src, len) =>
ta.ema(2 * ta.ema(src, len / 2) - ta.ema(src, len), math.round(math.sqrt(len)))
Three instances are calculated at lengths 20, 50, and 100, producing a fast, slow, and macro trend layer respectively. The fast layer reacts to short-term price action, the slow layer represents the primary trend, and the macro layer anchors the broader structural bias. When all three are aligned in sequence (fast above slow above macro, or inverse), the trend is considered directionally clean.
2. Three-State Confirmed Regime Engine
Regime classification is determined by the ordinal alignment of all three HEMA layers. A raw bull signal requires hema1 greater than hema2, which must in turn be greater than hema3. The inverse defines raw bear. Any other arrangement is classified as neutral. To prevent rapid regime flipping on borderline conditions, a two-bar confirmation requirement is enforced: the raw signal must hold for at least two consecutive bars before the confirmed regime variable updates.
rawBull = hema1 > hema2 and hema2 > hema3
rawBear = hema1 < hema2 and hema2 < hema3
var int confirmCount = 0
var int confirmedRegime = 0
if rawBull
confirmCount := confirmCount + 1
else if rawBear
confirmCount := confirmCount - 1
else
confirmCount := 0
confirmedRegime := confirmCount >= 2 ? 1 : confirmCount <= -2 ? -1 : 0
This confirmation mechanism is critical in volatile markets where HEMA layers can briefly reorder on a single candle only to revert immediately. The two-bar requirement sacrifices minimal reaction speed in exchange for a meaningful reduction in false regime transitions.
3. Z-Score Cumulative Impulse Detection
Regime direction tells you the structural bias. The Z-score impulse system tells you when that bias is being expressed with statistical force. Rather than measuring a single bar's momentum, this system accumulates consecutive directional closes into a running streak — a cumulative bull or bear pressure counter — then normalizes that streak against its own historical mean and standard deviation.
cumBull = close > close ? nz(cumBull ) + (close - close ) : 0
cumBear = close < close ? nz(cumBear ) + (close - close) : 0
zBull = (cumBull - ta.sma(cumBull, zLen)) / ta.stdev(cumBull, zLen)
zBear = (cumBear - ta.sma(cumBear, zLen)) / ta.stdev(cumBear, zLen)
impulseUp = ta.crossover(zBull, zThresh) and barstate.isconfirmed
impulseDn = ta.crossover(zBear, zThresh) and barstate.isconfirmed
An impulse fires when the Z-score exceeds the user-defined threshold (default: 2.0 sigma). This ensures that only statistically unusual momentum streaks generate signals, filtering out the ordinary ebb and flow of price during low-conviction moves.
4. BOS and CHoCH Market Structure
Market structure tracking is built on classical pivot high/low detection using Pine Script's built-in ta.pivothigh and ta.pivotlow functions. A Break of Structure (BOS) occurs when price closes or wicks beyond the most recent swing high (bullish BOS) or swing low (bearish BOS). A Change of Character (CHoCH) is a BOS that opposes the direction of the prior BOS — indicating a potential regime reversal rather than continuation.
swingHigh = ta.pivothigh(high, swingLen, swingLen)
swingLow = ta.pivotlow(low, swingLen, swingLen)
lastSwingHigh = ta.valuewhen(not na(swingHigh), swingHigh, 0)
lastSwingLow = ta.valuewhen(not na(swingLow), swingLow, 0)
bosUp = barstate.isconfirmed and ta.crossover(close, lastSwingHigh)
bosDn = barstate.isconfirmed and ta.crossunder(close, lastSwingLow)
chochUp = bosUp and lastBOSDir == -1
chochDn = bosDn and lastBOSDir == 1
CHoCH events are particularly significant because they represent the market's first structural evidence of a trend change — not merely a continuation of prior momentum. Distinguishing BOS from CHoCH allows traders to calibrate their response: a BOS in trend direction is a continuation entry opportunity, while a CHoCH warrants reassessment of existing positions.
5. Trend Cloud and Proximity Bar Coloring
The trend cloud fills the space between the HEMA fast and slow layers. The fill color matches the confirmed regime — teal for bull, red for bear, gray for neutral — creating an immediate visual encoding of market state across the chart. Bar coloring is driven by a normalized proximity calculation using the 14-period ATR as a reference distance.
normProx = math.abs(close - hema2) / (atr14 * 3)
barAlpha = math.min(math.round(normProx * 200), 200)
Bars that are far from the HEMA slow layer receive more saturated coloring, while bars trading near the HEMA mid-line are rendered at reduced opacity. This creates an intuitive gradient where extreme dislocations are visually prominent.
Features
HEMA Triple Layer: Three independent Hull-EMA Hybrid instances at periods 20, 50, and 100 provide fast, primary, and macro trend context simultaneously.
Confirmed Regime State: Two-bar confirmation gate prevents false regime transitions on temporary HEMA crossovers, reducing noise on volatile instruments.
BOS Detection: Swing-based Break of Structure signals on both bullish and bearish side, drawn at confirmed bars only with no look-ahead.
CHoCH Detection: Change of Character identification when BOS direction opposes the prior structural break, highlighting potential trend reversal zones.
Z-Score Impulse: Statistically normalized cumulative momentum streaks that fire signals only when directional pressure reaches a configurable sigma threshold.
Gradient Trend Cloud: Dynamic fill between HEMA layers color-coded by regime for instant visual orientation on any timeframe.
Proximity Bar Coloring: ATR-normalized distance from HEMA mid controls bar color alpha, making dislocations visually distinct.
Six-Row Dashboard: Compact table displaying regime, last BOS direction, bull Z-score, bear Z-score, and HEMA layer alignment.
No Repainting: All signals gated behind barstate.isconfirmed — no signals are printed on unfinished bars.
Full Alert Coverage: Seven alert conditions covering BOS, CHoCH, impulse, and regime flip events.
Input Parameters
HEMA Settings:
Fast Length: Period for the HEMA fast layer (default: 20)
Slow Length: Period for the HEMA slow layer (default: 50)
Macro Length: Period for the HEMA macro layer (default: 100)
Source: Price source for all HEMA calculations (default: close)
Regime Settings:
Confirmation Bars: Number of consecutive bars required to confirm a regime change (default: 2)
Structure Settings:
Swing Length: Pivot lookback for swing high/low detection (default: 10)
Show BOS Labels: Toggle BOS annotation labels on the chart (default: true)
Show CHoCH Labels: Toggle CHoCH annotation labels on the chart (default: true)
Z-Score Settings:
Z Lookback: Rolling window for Z-score mean and standard deviation (default: 50)
Z Threshold: Sigma level required to fire an impulse signal (default: 2.0)
Display Settings:
Show Trend Cloud: Toggle the gradient fill between HEMA layers (default: true)
Show Bar Colors: Toggle proximity-based bar coloring (default: true)
Show Dashboard: Toggle the six-row information table (default: true)
How to Use This Indicator
Step 1: Establish Regime Context
Before analyzing any signal, check the dashboard and the trend cloud to identify the confirmed regime. A bull regime (all three HEMA layers in ascending order with a teal cloud) means the structural bias favors long positions. A bear regime (descending alignment with a red cloud) favors shorts. A neutral regime suggests consolidation — reduce position sizing or stand aside. The regime confirmation requirement means the dashboard will update one to two bars after alignment begins, giving you a cleaner entry rather than reacting to the first crossover.
Step 2: Wait for Structure to Break
Within the context of the confirmed regime, watch for BOS events in the trend direction. A bullish BOS during a bull regime is a continuation structure signal — it means price has broken above a prior swing high, suggesting the up-trend is extending. A bearish BOS during a bull regime, especially if classified as a CHoCH, is your first warning that the structure may be shifting. Use the BOS labels on the chart to track the sequence of structural breaks over time.
Step 3: Confirm with Z-Score Impulse
A BOS or CHoCH becomes significantly more actionable when accompanied by a Z-score impulse signal in the same direction. When the cumulative bull streak normalized to 2+ sigma fires at the same time as or immediately following a bullish BOS, the move is backed by sustained directional momentum — not a single large candle. When regime, structure, and impulse all align, the signal quality is at its highest.
Step 4: Manage Position with HEMA Proximity
Once in a position, the proximity bar coloring helps manage exits. Bars that are far from HEMA mid (highly saturated) represent extended conditions — areas where mean reversion risk is elevated. Bars near HEMA mid are in equilibrium. Exits on strength (closing during a high-saturation bullish bar after a BOS continuation trade) allow for locking in gains at points of extension rather than waiting for a reversal to develop.
Indicator Limitations
The two-bar regime confirmation introduces a brief delay relative to the actual HEMA crossover. On fast-moving instruments, this can mean a slightly later entry but provides meaningful protection against false transitions.
BOS detection is based on prior swing highs and lows defined by the swing length parameter. On very low swing length settings, minor highs and lows will be used as structure levels, potentially generating frequent BOS events of less structural significance.
Z-score impulse requires a sufficient lookback to establish a stable mean and standard deviation for the cumulative streak. In the first Z-lookback bars of any chart, signals may be less statistically reliable as the normalization period is not fully seeded.
The HEMA and all derivative signals are calculated on the chart's native timeframe. This indicator does not internally pull higher timeframe data — users who want multi-timeframe regime context should reference signals from higher timeframe chart instances.
Like all trend-following tools, this indicator will produce whipsaw signals in choppy, range-bound markets where neither bulls nor bears sustain momentum long enough to trigger clean regime confirmation.
Proximity bar coloring uses ATR as a normalizer. During volatility regime shifts (e.g., sudden spike in ATR), the alpha thresholds may temporarily misrepresent proximity distance.
Originality Statement
The Regime & Structure Engine is not a repackaging of any single existing indicator. It is a purpose-built synthesis of methodologies that individually exist in various forms but have not been combined in this specific architecture.
The HEMA function (Hull-inspired double-weighted EMA followed by square-root-period smoothing) is a custom construction that differs from both standard HMA and standard EMA in its layering approach and final smoothing step.
The three-state confirmed regime engine with mandatory multi-bar confirmation is an original state machine design. Most indicators display regime as a simple crossover condition; this system enforces a holding period before state transition.
The Z-score cumulative impulse system measures the statistical significance of a directional streak rather than the magnitude of a single bar move. This normalization approach — accumulating consecutive closes and comparing against rolling sma/stdev — is not a standard oscillator pattern.
The combination of HEMA-based regime with classical BOS/CHoCH structural analysis on top of Z-score momentum creates a three-dimensional signal framework that no single publicly available indicator replicates.
The proximity bar coloring system using ATR-normalized distance to the HEMA mid layer as the alpha channel driver is an original visual encoding not found in standard bar coloring implementations.
Disclaimer
The Regime & Structure Engine is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Past behavior of price relative to indicator signals does not guarantee future results. All trading involves risk, including the potential loss of principal. Users are solely responsible for their own trading decisions. Always conduct your own due diligence and consider consulting a licensed financial professional before making any investment decisions.
-Made with passion by officialjackofalltrades
Indicator

MTF Confluence Gauge [JOAT]MTF Confluence Gauge
Introduction
One of the most persistent challenges in technical analysis is the problem of timeframe conflict. A setup that looks perfectly constructed on a 15-minute chart can be swimming against a powerful current on the 4-hour chart, while simultaneously aligned with the daily trend. Traders who operate on a single timeframe are making decisions without full awareness of the forces acting on the instrument across the full spectrum of market participants — from short-term speculators to institutional position traders whose horizons span weeks or months.
The MTF Confluence Gauge addresses this challenge by simultaneously reading the HEMA (Hull-EMA Hybrid) trend state of up to 5 configurable assets across 5 configurable timeframes — producing 25 individual trend readings. Each reading is a directional vote: +1 for bullish HEMA alignment, -1 for bearish alignment, 0 for neutral. These 25 votes are summed into a raw score ranging from -25 to +25, normalized to a -100 to +100 scale, and further refined by local market modifiers including a delta proxy, volume RSI, volatility squeeze state, and local HEMA trend. The result is a composite gauge that represents the aggregate directional consensus across assets and timeframes simultaneously.
This multi-asset capability makes the indicator unique even among multi-timeframe tools. Most MTF indicators read a single instrument across multiple timeframes. The MCG reads multiple instruments across multiple timeframes — enabling users to understand whether a bullish signal on their primary instrument is supported by correlated assets (e.g., sector ETFs, index futures, correlated crypto pairs) or is an isolated move that runs counter to the broader market ecosystem. A long signal supported by bullish readings across correlated assets and multiple timeframes is fundamentally different in quality from one that is isolated to a single timeframe of a single instrument.
Core Concepts
1. HEMA Trend Function for MTF Reads
The HEMA trend function is the foundational building block of every cell in the 5×5 matrix. For each asset-timeframe combination, request.security() retrieves the HEMA values on that timeframe, and the relative alignment of the fast, slow, and macro HEMA layers determines the trend vote. The lookahead parameter is explicitly set to barmerge.lookahead_off to ensure no future data contamination — the trend reading reflects only information that was available at the close of the most recent completed bar of the target timeframe.
f_hema(src, len) =>
ta.ema(2 * ta.ema(src, len / 2) - ta.ema(src, len), math.round(math.sqrt(len)))
f_mtfTrend(sym, tf) =>
h1 = request.security(sym, tf, f_hema(close, hFast), lookahead=barmerge.lookahead_off)
h2 = request.security(sym, tf, f_hema(close, hSlow), lookahead=barmerge.lookahead_off)
h3 = request.security(sym, tf, f_hema(close, hMacro), lookahead=barmerge.lookahead_off)
h1 > h2 and h2 > h3 ? 1 : h1 < h2 and h2 < h3 ? -1 : 0
This function is called 25 times — once per cell in the matrix. The result for each call is stored in a 5×5 array of integers and subsequently used for both the raw score calculation and the table cell coloring.
2. Raw Score and Normalization
The 25 individual trend votes are summed to produce a raw score. This sum is then smoothed with a 3-bar EMA to reduce single-bar noise. Normalization to the range is achieved by dividing the smoothed raw score by 25 (the maximum possible absolute value) and multiplying by 100.
rawScore = 0
for r = 0 to 4
for c = 0 to 4
rawScore += trendMatrix.get(r * 5 + c)
smoothedRaw = ta.ema(rawScore, 3)
normalizedScore = smoothedRaw / 25 * 100
The normalized score forms the base for the histogram and is displayed in the dashboard as the "MTF Bias" value. By normalizing against the theoretical maximum, the scale is consistent regardless of how many assets are configured as neutral (0 votes) — the maximum expressible bull consensus is always +100 and the maximum bear consensus is always -100.
3. Local Score Modifiers
The raw MTF score represents the multi-asset, multi-timeframe consensus, but it does not account for the specific conditions of the primary chart instrument at the current moment. Four local modifier calculations adjust the score based on immediate market context. The local HEMA trend applies a ±10 point bonus. The delta proxy (bar-range-based buying/selling pressure) applies a ±5 point bonus. Volume RSI above threshold applies a ±5 point bonus in the direction of the local trend. The volatility squeeze state applies a ±5 bonus when the market is not squeezing (i.e., volatility is freely expressing direction). All individual bonuses are summed and the combined total is clamped to the range.
localBonus = localTrend * 10
deltaBonus = deltaPos ? 5 : -5
volBonus = highVol ? (localTrend > 0 ? 5 : -5) : 0
sqzBonus = squeezing ? 0 : localTrend * 5
totalScore = math.max(-100, math.min(100, normalizedScore + localBonus + deltaBonus + volBonus + sqzBonus))
displayScore = ta.ema(totalScore, 5)
The final display score is a 5-bar EMA of the adjusted total, providing visual smoothness in the histogram while retaining the responsiveness of the underlying calculations. Local modifiers mean the gauge can show strong bull bias from MTF readings while still being dampened by bearish local conditions — a useful warning mechanism.
4. The 5×5 Color-Coded Table
The visual centerpiece of this indicator is the 5×5 table rendered in the oscillator pane. Each of the 25 cells represents one asset-timeframe combination. Bullish cells are filled with teal and display an upward arrow (▲). Bearish cells are filled with red and display a downward arrow (▼). Neutral cells are filled with violet and display a dash (—). Row 6 of the table shows the column-sum score for each timeframe column, giving an immediate vertical read of how strongly any given timeframe is leaning across all configured assets. This allows traders to identify whether bias is uniform across timeframes or concentrated in specific horizons.
5. Histogram, Squeeze Background, and Reference Lines
The composite score is rendered as a histogram with gradient fill — teal shades above zero transitioning toward deep teal at maximum bull readings, red shades below zero deepening toward maximum bear. Reference lines at ±25 define the "bias threshold" — readings beyond this level indicate a meaningful multi-timeframe lean. Reference lines at ±60 define the "strong conviction threshold" — readings here suggest near-uniform agreement across the majority of configured cells. When the local volatility squeeze is active (detected via ATR compression), the oscillator pane background tints violet, visually indicating that the current score may be elevated or depressed relative to its normal expression due to compressed price action.
Features
25-Cell MTF Matrix: 5 configurable assets × 5 configurable timeframes, each independently returning a HEMA trend vote.
lookahead_off Security Calls: All request.security() calls use barmerge.lookahead_off to prevent future bar data contamination.
Smoothed Normalization: Raw score EMA-smoothed then normalized to for consistent cross-session comparability.
Four Local Modifiers: Local HEMA trend, delta proxy, volume RSI, and squeeze state each contribute bonus points to produce a context-aware composite score.
5×5 Color-Coded Table: Teal/red/violet cells with directional arrows and column score totals for immediate visual matrix reading.
Gradient Histogram: color.from_gradient fill above and below zero with reference lines at ±25 (bias) and ±60 (strong conviction).
Squeeze Background Tint: Violet overlay on oscillator pane background when local volatility compression is detected.
Nine-Row Dashboard: MTF bias label (six levels from STRONG BULL to STRONG BEAR), composite score, raw MTF score, squeeze state, Pearson R, delta bias, volume RSI, and local trend.
Six Alert Conditions: Cross above +25, cross below -25, cross above +60, cross below -60, cross above 0, cross below 0.
Input Parameters
Asset Configuration:
Asset 1-5 Symbols: Ticker symbols for each of the five configurable assets (defaults: current symbol, SPY, QQQ, GLD, TLT or equivalents)
Timeframe Configuration:
TF1-TF5: Five timeframe strings for the matrix columns (defaults: "15", "60", "240", "D", "W")
HEMA Settings:
Fast Length: HEMA fast period for all MTF reads (default: 20)
Slow Length: HEMA slow period for all MTF reads (default: 50)
Macro Length: HEMA macro period for all MTF reads (default: 100)
Local Modifier Settings:
Delta Window: Smoothing period for delta proxy calculation (default: 10)
Volume RSI Threshold: Level above which volume is considered high (default: 65)
ATR Squeeze Length: Period for local volatility compression detection (default: 20)
Display Settings:
Show Table: Toggle the 5×5 trend matrix table (default: true)
Show Histogram: Toggle the composite score histogram (default: true)
Show Dashboard: Toggle the nine-row information table (default: true)
Show Squeeze Background: Toggle the violet compression tint (default: true)
How to Use This Indicator
Step 1: Configure Assets for Your Trading Context
The indicator's value scales directly with the relevance of the configured assets to your primary instrument. For equity traders, configuring sector ETFs correlated with the primary stock (e.g., XLK for technology stocks, XLF for financials) alongside index instruments (SPY, QQQ, DIA) creates a meaningful consensus gauge. For crypto traders, configuring BTC, ETH, and leading altcoins provides an ecosystem-wide directional read. For forex traders, related currency pairs and safe-haven instruments (gold, bonds) capture macro correlation. Spend time selecting assets whose price behavior is structurally linked to your primary trading instrument.
Step 2: Use the Table for Timeframe Structure Analysis
Before looking at the composite score, read the table column by column. If the shorter timeframe columns (15m, 1H) are predominantly teal (bullish) but the longer timeframe columns (Daily, Weekly) are predominantly red (bearish), the market is in short-term counter-trend bounce territory — a higher-risk environment for long trades. Conversely, when both short and long timeframe columns are aligned in the same direction, the consensus is clean and structural. The column score row at the bottom of the table quantifies this alignment numerically.
Step 3: Interpret the Composite Score Levels
The ±25 threshold is the first meaningful level. A score above +25 indicates that more than half of the 25 cells are bullish (adjusted for local modifiers), suggesting a genuine bias rather than random noise. Between +25 and +60, the market has a directional lean but lacks uniform agreement. Above +60, the consensus is strong — the majority of assets across the majority of timeframes are in bullish alignment. The inverse applies below -25 and -60. Cross-zero signals (score moving from negative to positive) indicate a shift in aggregate consensus, which is often a leading indicator of trend changes on the primary instrument.
Step 4: Monitor Local Modifier Impact
The dashboard displays both the raw MTF score and the composite adjusted score. The difference between these two values reflects the cumulative impact of local modifiers. A large positive difference means local conditions (delta, volume, squeeze, HEMA) are amplifying the MTF signal. A large negative difference means local conditions are dampening it — the MTF matrix shows bulls, but the primary instrument itself is not confirming. In these cases, patience is warranted before entering.
Indicator Limitations
The indicator makes 25 request.security() calls plus additional local calculations. On crowded chart setups with many other indicators, this computational load may affect chart loading time. PulseWire enforces limits on request.security() calls per script; users should be aware of this limit if adding other indicators with security calls.
All 25 MTF trend readings update on the chart's native timeframe bars. Readings from higher timeframes update only when a new bar completes on that timeframe — the HEMA reading for a weekly timeframe, for instance, updates only at the weekly close. Between weekly closes, the weekly cell reading remains at the prior week's value.
HEMA calculations at very short periods on very high timeframes (e.g., period 20 on a Monthly timeframe) may have insufficient bars to produce statistically stable readings. Users should ensure the target instrument has sufficient history on all configured timeframes.
Asset correlation is dynamic — assets that are correlated in one market regime may decouple in another. A gauge configured for normal market correlation may produce misleading readings during crisis events when traditional correlations break down.
The local modifier adjustments (±10, ±5, ±5, ±5) are fixed contribution weights. They do not adapt to changing market conditions and may disproportionately influence the composite score during specific regimes.
The composite score is a simplified linear aggregation of heterogeneous signals. It treats a weekly HEMA reading as equivalent to a 15-minute HEMA reading in terms of contribution weight, which may not reflect the practical importance of longer timeframe trends.
Originality Statement
The MTF Confluence Gauge is an original multi-dimensional trend aggregation tool that differs meaningfully from existing multi-timeframe indicators.
The 5×5 asset-timeframe matrix — simultaneously reading five user-configurable assets (not just one instrument across five timeframes) across five user-configurable timeframes — is an original architectural choice that enables cross-asset consensus analysis not available in standard MTF indicators.
The HEMA-based trend vote function (requiring all three HEMA layers to be in sequence for a definitive +1 or -1 vote, otherwise returning 0) is a more stringent trend classification than simple moving average crossovers typically used in MTF dashboards.
The four-component local modifier system — HEMA bonus, delta proxy bonus, volume RSI bonus, and squeeze state bonus — applied as additive adjustments to the normalized MTF score before display is an original composite scoring architecture.
The six-level bias label system in the dashboard (STRONG BULL, BULL, SLIGHT BULL, SLIGHT BEAR, BEAR, STRONG BEAR) derived from the composite score threshold ranges provides a human-readable categorical summary not commonly implemented in MTF oscillators.
The visual integration of the 5×5 table within the oscillator pane (rather than as a separate overlay) alongside the gradient histogram, squeeze background tint, and reference lines at ±25 and ±60 represents a unified pane design not seen in comparable indicators.
Disclaimer
The MTF Confluence Gauge is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Multi-timeframe and multi-asset confluence does not guarantee trade success. Correlation between assets changes over time and cannot be relied upon to remain stable. All trading involves risk of loss. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Descriptive Statistics [Median, Quartiles, Outliers]This indicator seeks to provide insight to traders by modeling market structure using widely accepted statistical methods applied to price data. It does not predict direction; instead, it describes how current price behaves relative to its historical distribution.
It is built around non-parametric statistics, making it resistant to distortion from extreme price movements.
What it shows?
1. Median (Q2): The central equilibrium level of price distribution.
2. Quartiles (Q1, Q3): Boundaries of the “normal” trading range.
3. Interquartile Range (IQR): Measures the width of the core market structure.
4. Outlier Bands (1.5 × IQR rule): Statistical extremes where price becomes unusual relative to recent behavior.
How it works?
The indicator collects price data either through:
1. Reset Mode: Builds a new distribution each session (Daily, Weekly, Monthly, or chart timeframe).
2. Length Mode: Uses a rolling window of the last N candles.
All values are sorted to construct a real-time price distribution, from which median, quartiles, and outlier thresholds are derived.
How to use it?
1. Price inside Q1–Q3 range → normal market conditions
2. Price near Median → equilibrium / fair value zone
3. Price outside Outlier bands → statistically extreme conditions (potential exhaustion, expansion zones or news driven events)
4. Large expansions between Q1 and Q3 → increased volatility and potential momentum in either direction
Key concept?
This tool does not forecast price. It provides a distribution map of market behavior, helping traders understand structure, deviation, and statistical positioning of price.
⚠️ Note
This indicator is for educational and analytical purposes only and should not be used as standalone trading advice.
Author: TUGUME WILLIAM MUTARA Indicator

Liquidity Sweep Detector [QuantAlgo]🟢 Overview
The Liquidity Sweep Detector is a swing-based liquidity tracking tool that identifies moments when price wicks beyond a confirmed swing high or low and closes back inside, then tracks the remaining unswept levels as forward-projecting lines and zones on your chart. It classifies each event by direction (Bullish or Bearish) and maintains a running registry of swing levels that have not yet been visited by price, giving you a live map of where resting stop clusters may still be sitting across any timeframe and market.
🟢 How It Works
The indicator identifies swing highs and lows using a pivot detection window that requires a configurable number of bars to the left and right to confirm a valid structural point. The active pivot length and minimum wick penetration are resolved from the selected preset before any detection runs:
active_len = preset_config == 'Scalp' ? 5 : preset_config == 'Swing' ? 20 : pivot_len
active_min_pct = preset_config == 'Scalp' ? 0.0 : preset_config == 'Swing' ? 0.05 : min_wick_pct
A bearish sweep is confirmed when price wicks above the most recent swing high by at least the minimum penetration percentage and closes back below it. A bullish sweep mirrors this on the downside:
bearSweep = not na(lastSwingHigh) and high > lastSwingHigh * (1 + active_min_pct / 100) and close < lastSwingHigh
bullSweep = not na(lastSwingLow) and low < lastSwingLow * (1 - active_min_pct / 100) and close > lastSwingLow
Every confirmed swing point is simultaneously stored in an unswept level registry. Levels are removed when the full candle closes beyond them, or immediately when a sweep is confirmed on that level, so the chart only shows levels price has not yet visited:
if bearSweep and array.size(unsweptHighs) > 0
for i = array.size(unsweptHighs) - 1 to 0
if array.get(unsweptHighs, i) == lastSwingHigh
array.remove(unsweptHighs, i)
array.remove(unsweptHighBars, i)
break
The indicator also detects when price enters the zone around an unswept level without yet confirming a full sweep. Edge detection ensures the alert fires once on entry rather than on every bar price remains inside the zone:
buySideEntry = enteredBuySide and not enteredBuySide
sellSideEntry = enteredSellSide and not enteredSellSide
🟢 Key Features
▶ Three Preset Configurations: The indicator includes three presets that override the manual pivot length and minimum wick penetration settings.
1. Default/Custom: A general-purpose configuration suited to swing trading on 4H and daily charts. Confirms swing points that require a reasonable structural context before a sweep is flagged.
2. Scalp: A faster configuration for intraday charts from 1 minute to 15 minutes. Shorter pivot windows capture local swing points that form and get swept within a single session.
3. Swing: A more conservative configuration for daily and weekly charts that requires a more deliberate wick extension before confirming a sweep, filtering out shallow tags at swing levels.
▶ Built-in Alert System: Pre-configured alert conditions cover bearish sweeps, bullish sweeps, any sweep, price entering a buy-side zone, price entering a sell-side zone, and price entering any unswept zone.
▶ Visual Customisation: Choose from five colour presets (Classic, Aqua, Cosmic, Cyber, Neon) or set your own custom colours. Optional candle background highlighting marks sweep bars directly on the chart, and label text size is configurable across four options to suit different chart layouts.
🟢 Important Considerations
▶ Sweep detection references only the most recently confirmed swing high or low at the time each bar closes. On lower timeframes with frequent swing formation, raising the pivot length focuses detection on more structurally significant levels and reduces signal frequency on choppy charts.
▶ The indicator works best as a contextual layer within an existing trading framework. Sweep signals indicate that price has moved beyond a swing level and closed back inside, which is a useful data point, but should be read alongside your system and market context rather than used as a standalone trigger. Indicator

Liquidity Zone Harvester [JOAT]Liquidity Zone Harvester
Introduction
Institutional order flow leaves footprints in market structure. When a large buyer or seller places a significant order, the execution of that order creates an imbalance between supply and demand at a specific price level — and markets frequently return to these levels to test whether the original interest remains. These price areas are commonly referred to as order blocks or liquidity zones, and they form one of the core concepts in institutional and Smart Money trading methodology.
The Liquidity Zone Harvester is an automated order block detection and management system that identifies these zones using statistically validated momentum signals rather than arbitrary manual placement. Instead of drawing boxes wherever a trader's eye thinks supply or demand may exist, this indicator uses Z-score cumulative impulse detection to identify when directional momentum has reached statistically significant levels — and only then marks the most recent opposing-close candle as the source order block. Volume quality gates ensure that only high-participation impulses create zones, filtering out low-conviction moves that are less likely to represent genuine institutional activity.
What sets this indicator apart from standard order block tools is what happens after zone creation. Every active zone is tracked through a dual-mechanism aging system. The Bayesian exponential decay model progressively reduces zone visual intensity over time with a configurable half-life, providing a continuous probability signal about zone freshness. Simultaneously, a Kaplan-Meier survival analysis engine — borrowed from medical statistics — estimates the probability that a given zone will survive future price tests, based on the historical survival rates of all previously observed zones in the training window. Each zone displays both its current age and its estimated survival probability directly on the chart, turning static boxes into dynamically updated probability estimates.
Core Concepts
1. Z-Score Cumulative Impulse Detection
Zone creation is triggered only when directional momentum reaches a statistically defined threshold. The system accumulates a running streak of directional closes — when consecutive bars close higher than their open, the bull accumulator grows; when consecutive bars close lower, the bear accumulator grows. The streak resets when direction reverses. This cumulative streak is then normalized against its own rolling mean and standard deviation, producing a Z-score that measures how unusual the current momentum streak is relative to recent history.
cumBull := close > open ? nz(cumBull ) + (close - open) : 0
cumBear := close < open ? nz(cumBear ) + (open - close) : 0
zBull = (cumBull - ta.sma(cumBull, zLen)) / ta.stdev(cumBull, zLen)
zBear = (cumBear - ta.sma(cumBear, zLen)) / ta.stdev(cumBear, zLen)
bullEvent = ta.crossover(zBull, zThresh) and barstate.isconfirmed and volOK
bearEvent = ta.crossover(zBear, zThresh) and barstate.isconfirmed and volOK
When a bullEvent fires (bull Z-score crosses the threshold with volume confirmation), the system looks backward to find the most recent down-close candle — the last bar where sellers were dominant before the impulse began. This becomes the demand zone. Similarly, a bearEvent marks the most recent up-close candle as the supply zone.
2. Volume Quality Gate
Not all Z-score impulses are created equal. An impulse that occurs on abnormally low volume represents weak conviction — possibly a thin-market price drift rather than genuine institutional momentum. The volume gate applies RSI to the volume series to normalize it against its own history. Only when volume RSI exceeds the configurable threshold is the volOK condition true, enabling zone creation.
volRsi = ta.rsi(volume, 14)
volOK = volRsi > volThresh
This filter meaningfully reduces the number of zones created during low-participation conditions such as pre-market sessions, lunch hours, or holiday-period trading — precisely the times when order block levels are least likely to represent significant institutional interest.
3. Order Block Zone Construction
When a signal event is confirmed, the most recent opposing candle is identified using ta.valuewhen(). For a bullEvent, the system finds the most recent bar where close was less than open (a down candle) — its high and low define the demand zone boundaries. For a bearEvent, it finds the most recent up candle — its high and low define the supply zone boundaries. A box object is created spanning from that historical bar to the current bar, with height defined by the candle's actual high-low range.
lastDnHigh = ta.valuewhen(close < open, high, 0)
lastDnLow = ta.valuewhen(close < open, low, 0)
lastDnBar = ta.valuewhen(close < open, bar_index, 0)
if bullEvent
newBox = box.new(lastDnBar, lastDnHigh, bar_index, lastDnLow, ...)
bullBoxes.push(newBox)
4. Overlap Prevention (f_no_overlap)
To avoid cluttering the chart with redundant zones that occupy the same price territory, an overlap check function evaluates whether a proposed new zone overlaps with any existing zone of the same type. The function iterates over all existing bull or bear boxes and compares the new zone's top and bottom against each existing box's top and bottom. A guard condition (nBull > 0) prevents the iteration from running on an empty array, which would cause an index -1 crash.
f_no_overlap(newTop, newBot, boxes) =>
noOverlap = true
if boxes.size() > 0
for i = 0 to boxes.size() - 1
b = boxes.get(i)
if newTop >= box.get_bottom(b) and newBot <= box.get_top(b)
noOverlap := false
noOverlap
5. Bayesian Exponential Decay
Each zone's visual transparency is driven by an exponential decay function that represents the diminishing probability of zone relevance over time. The half-life parameter (default: 75 bars) defines how quickly a zone fades. At age 0, the zone is fully opaque. At age 75 bars, the zone is at 50% opacity. At age 150 bars, 25% opacity. This continuous decay — rather than a binary active/expired switch — provides an analog probability signal directly encoded in the zone's visual intensity.
decayFactor = math.exp(-0.693 * age / halfLife)
zoneAlpha = math.round(decayFactor * 200)
box.set_bgcolor(b, color.new(zoneColor, 255 - zoneAlpha))
6. Kaplan-Meier Survival Analysis
The Kaplan-Meier estimator is a nonparametric statistical method originally developed to measure survival probabilities in clinical trial data. In this indicator, "survival" is defined as a liquidity zone remaining unmitigated (not breached by a closing price on two separate occasions). Each time a zone is mitigated, it is recorded as a "death event" at its current age. Zones that expire by age limit without mitigation are recorded as "censored events" — incomplete observations. The KM formula multiplies survival probabilities across all observed events up to a given age.
// For each completed event (death at age t_i with n_i at-risk zones):
S_t := S_t * (1.0 - d_i / n_i)
// Product over all event times <= query age
For each active zone, the indicator queries the KM estimate at the zone's current age and displays the result as a percentage label. A zone at age 40 showing "Age 40 | 72%" means that historically, 72% of zones survived to at least 40 bars without being mitigated — giving traders a quantitative assessment of how likely the zone is to hold on the next test.
Features
Z-Score Cumulative Impulse: Statistical momentum threshold using normalized cumulative directional streaks to gate zone creation.
Volume Quality Gate: Volume RSI filter ensures only high-participation impulses create zones.
Precise Order Block Identification: Most recent opposing candle (last down-close for bull event, last up-close for bear event) defines zone boundaries.
Overlap Prevention: f_no_overlap function checks all existing zones before creating a new one, preventing chart clutter from redundant levels.
Bayesian Exponential Decay: Zone opacity decays over time with configurable half-life, encoding freshness as a visual probability signal.
Kaplan-Meier Survival Analysis: Medical-statistics survival estimator applied to zone longevity, displayed as a percentage probability label on each active zone.
Dynamic Zone Extension: Box right edge extends to the current bar on every update, keeping zones visually connected to the present.
Mitigation Tracking: Zones that are closed through twice are flagged as mitigated and removed, with the event recorded for KM analysis.
Seven-Row Dashboard: Active demand count, active supply count, bull Z, bear Z, volume RSI, KM training size, and signal status.
Two Alert Conditions: Zone created alert and zone rejection (price tests and bounces back) alert.
Input Parameters
Z-Score Settings:
Z Lookback: Rolling window for Z-score normalization (default: 50)
Z Threshold: Sigma level required to trigger an impulse event (default: 2.0)
Volume Gate Settings:
Volume RSI Period: RSI lookback for volume normalization (default: 14)
Volume RSI Threshold: Minimum volume RSI for zone creation eligibility (default: 55)
Zone Management Settings:
Max Zone Age: Maximum bars a zone remains active before forced removal (default: 300)
Mitigation Count: Number of closes through a zone required for mitigation (default: 2)
Max Active Zones Per Side: Maximum simultaneous demand or supply zones displayed (default: 5)
Decay Settings:
Decay Half-Life: Number of bars at which zone opacity reaches 50% of initial value (default: 75)
KM Settings:
KM Training Window: Bar lookback for Kaplan-Meier training data collection (default: 500)
Show Survival Labels: Toggle KM probability labels on active zones (default: true)
Display Settings:
Show Demand Zones: Toggle demand (bull) zone boxes (default: true)
Show Supply Zones: Toggle supply (bear) zone boxes (default: true)
Show Dashboard: Toggle the seven-row information table (default: true)
How to Use This Indicator
Step 1: Understand Zone Creation Conditions
Zones are not created on every bar — they are created only when a statistically significant directional impulse (Z-score above threshold) occurs on above-average volume. This selectivity is intentional. In any given trading session, you will likely see only a few zone creation events, each backed by a genuine momentum surge that suggests institutional participation. When you see a new zone appear, note the Z-score values in the dashboard and the volume RSI reading — higher values on both indicate a stronger impulse and more confident zone placement.
Step 2: Prioritize Fresh, High-Survival Zones
Not all zones on the chart are equally relevant. A fresh zone (low age, full opacity) at a KM survival rate of 80% is a far stronger candidate for price reaction than an old zone (high age, near-transparent) at 30% survival probability. Use both the visual opacity and the KM label together: as a zone ages and fades, reduce your expectation that it will provide meaningful support or resistance. When price approaches a zone that is both visually fresh and shows high KM survival probability, the statistical expectation of reaction is at its highest.
Step 3: Watch for Zone Rejection Alerts
The zone rejection alert fires when price tests a zone (enters the box boundary) and then closes back away from it without mitigating it. This is the core trade setup: price returning to the institutional order block level, briefly penetrating it, and then reversing. The rejection alert provides a timely notification for potential entries in the direction of the original impulse that created the zone, with the zone's near boundary serving as the natural stop-loss reference.
Step 4: Monitor KM Training Size for Statistical Validity
The dashboard displays the KM training sample size — the number of completed zone events (both mitigated and aged-out) available for the survival analysis. With fewer than 10 training events, the KM estimate has high variance and should be treated as rough guidance. With 30 or more training events, the estimate becomes statistically stable. On instruments or timeframes where the indicator has run for extended periods, the KM estimates become increasingly reliable as the training dataset grows.
Indicator Limitations
The Z-score cumulative impulse and volume gate require sufficient chart history for the rolling normalization periods to be seeded. In the first Z-lookback bars of a new chart, zone creation signals may be less reliable as the mean and standard deviation are not yet fully established.
Kaplan-Meier survival estimates are only as reliable as the training dataset. On instruments or timeframes that have not accumulated many completed zone events, the survival probabilities should be treated as rough estimates rather than statistically precise values.
The mitigation definition (two closes through the zone) is a configurable approximation. In real order block theory, mitigation can be defined in several ways; this indicator's specific definition may not match every trader's conceptual framework.
Zones are based on the most recent opposing candle at the time of the impulse event. In fast markets where multiple large candles cluster closely together, the marked candle may not represent the most significant institutional order location.
This indicator requires volume data. On instruments where volume is unavailable or unreliable (some synthetic indices, certain forex pairs), the volume gate will not function as intended and should be disabled or its threshold lowered significantly.
The exponential decay model assumes a constant half-life across all market conditions. In reality, zone relevance can be regime-dependent — a zone formed during a trending market may remain relevant longer than one formed during a range, or vice versa.
Maximum active zones per side is a hard limit. If the limit is reached, new valid zone creation events will be rejected until an existing zone is mitigated or aged out.
Originality Statement
The Liquidity Zone Harvester is a genuinely original indicator that applies statistical and mathematical frameworks from outside the trading domain to a problem common in technical analysis.
The Z-score cumulative impulse detection — using consecutive close-open accumulation normalized against rolling sma/stdev — as the primary trigger for order block marking is an original signal architecture. Most order block indicators use visual pattern matching (e.g., a large candle followed by a gap) rather than statistical significance thresholds.
Applying the Kaplan-Meier survival estimator — a nonparametric method from biostatistics — to estimate the probability that a liquidity zone will survive future price tests is a novel application of medical statistics to market analysis. This provides a mathematically grounded probability estimate that no standard order block indicator offers.
The Bayesian exponential decay applied to zone visual transparency — using a configurable half-life to continuously encode zone freshness as opacity — is an original visual design that treats zone relevance as a continuously diminishing probability rather than a binary active/inactive state.
The overlap prevention function that iterates over all existing zone arrays before creating a new zone — with the index-crash guard for empty arrays — is a specific engineering solution to a concrete problem in box-based indicator design.
The volume RSI quality gate, applied specifically to filter Z-score impulse events rather than as a standalone signal, is an original confluence filter design that specifically addresses the problem of thin-market false signals in order block detection.
Disclaimer
The Liquidity Zone Harvester is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Liquidity zones and order blocks are analytical constructs; they do not guarantee price reactions. Past zone behavior as encoded in Kaplan-Meier estimates does not predict future zone performance. All trading involves risk of loss. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Fibonacci Volatility Cloud [JOAT]Fibonacci Volatility Cloud
Introduction
The relationship between price, trend, and volatility is the core equation of technical analysis — and most indicators address only one or two of its variables at a time. Moving averages define trend but ignore volatility structure. Bollinger Bands embed volatility but use static multipliers with no harmonic rationale. The Fibonacci Volatility Cloud addresses all three simultaneously: it defines trend direction through a triple-smoothed adaptive basis, measures volatility through a user-selectable ATR or standard deviation engine, and projects dynamic support and resistance zones using Fibonacci ratios (0.618, 1.0, 1.618, and 2.618) as the band multipliers.
The choice of Fibonacci ratios is not cosmetic. These values appear persistently in the mathematical structure of natural systems and have demonstrated consistent relevance as price reaction zones in financial markets across asset classes. By anchoring the band distances to these ratios rather than arbitrary integers, the cloud levels carry harmonic weight. A touch at the 1.618 extension is not the same as a touch at the 1.5 extension — the former sits at a recognized inflection ratio, and the indicator is designed to treat it as such.
Beyond the band framework, the indicator features a direction-conditional cloud: during bull trends, the lower (support) bands are filled; during bear trends, the upper (resistance) bands are filled. This directional fill logic means the shaded area of the chart always represents the most relevant zone given the current structural bias. An additional triple-smoothed signal line provides momentum context, and a seven-row dashboard tracks all key states simultaneously. Entry signals for both breakout and bounce conditions are included, along with configurable take-profit targets mapped to specific Fibonacci levels.
Core Concepts
1. Triple-Smoothed Basis
The foundation of every calculation in this indicator is a triple-layered EMA applied to the HLC3 midpoint. Applying a single EMA to price introduces lag proportional to the period length. Applying a second EMA to the result further smooths transient noise while preserving directional information. The third application produces a basis line that is highly resistant to single-candle spikes and short-duration noise patterns while remaining responsive to genuine trend development.
basis = ta.ema(ta.ema(ta.ema(hlc3, len), len), len)
Because the triple smoothing applies the same period three times, the effective lag is higher than a single EMA of the same length — but this is intentional. The basis is not meant to hug price; it is meant to define the structural center of gravity around which volatility bands expand. Users should select the period (default: 20) based on the timeframe and the degree of noise filtering desired.
2. Volatility Measurement Engine
Volatility in this indicator is not fixed. Users choose between ATR (Average True Range) and Standard Deviation as the volatility measure. ATR captures range-based volatility and responds to gap behavior and intraday extremes, making it better suited for instruments with frequent gaps or aggressive wick behavior. Standard Deviation measures the statistical dispersion of the price source around its mean, which is more appropriate for instruments with smooth, continuous price action.
vol = volType == "ATR" ? ta.atr(volLen) : ta.stdev(hlc3, volLen)
The selected volatility value is then multiplied by each Fibonacci ratio to establish the four band distances. This means the bands breathe dynamically with the market — contracting during low-volatility consolidation and expanding during high-volatility trending phases.
3. Fibonacci Band Construction
The four bands are constructed by adding and subtracting the Fibonacci-weighted volatility from the basis. Each ratio carries a distinct behavioral expectation. The 0.618 band is the nearest zone — frequently tested during shallow pullbacks. The 1.0 band (equal to raw volatility) is a neutral midpoint. The 1.618 band represents the primary extension zone and is most frequently associated with momentum reversals. The 2.618 band represents extreme extension, typically only reached during impulsive, high-velocity moves.
f1 = 0.618
f2 = 1.0
f3 = 1.618
f4 = 2.618
upperFib1 = basis + vol * f1
upperFib2 = basis + vol * f2
upperFib3 = basis + vol * f3
upperFib4 = basis + vol * f4
lowerFib1 = basis - vol * f1
lowerFib2 = basis - vol * f2
lowerFib3 = basis - vol * f3
lowerFib4 = basis - vol * f4
The gradient fill between the 0.618 and 2.618 bands is rendered using color.from_gradient, creating a visual intensity gradient where proximity to the extreme band is immediately apparent.
4. Non-Repainting Trend State Machine
Trend direction is determined from the basis line's own slope — not from any external indicator or price crossover. If the current basis is above the previous bar's basis, the trend state is 1 (up). If below, the state is -1 (down). If equal (rare on continuous data), the state persists from the prior bar. Crucially, the state variable is declared with `var` and updates only when a directional change is confirmed — making it a true state machine with no look-ahead dependency.
var int trend = 0
trend := basis > basis ? 1 : basis < basis ? -1 : trend
This approach prevents the trend direction from changing retroactively on historical bars when future data is loaded, which is the core cause of repainting in many similar indicators.
5. Direction-Conditional Cloud Fill
During a bull trend, the cloud fills the lower Fibonacci bands (below basis), shading the support zone where price is expected to find demand. During a bear trend, the upper bands (above basis) are filled, shading the resistance zone where selling pressure is expected. This conditional rendering ensures that the visually dominant cloud region always represents the high-probability reaction zone given the current bias.
cloudFillLow1 = trend == 1 ? lowerFib1 : na
cloudFillLow4 = trend == 1 ? lowerFib4 : na
cloudFillHigh1 = trend == -1 ? upperFib1 : na
cloudFillHigh4 = trend == -1 ? upperFib4 : na
6. Proximity Bar Coloring and Signal Line
Bar colors are driven by the normalized distance from the basis to the 2.618 band. As price approaches the outer Fibonacci boundary, bar colors become more saturated — providing an immediate visual cue of extension. Near the basis, bars fade toward transparency. The signal line is a triple-smoothed version of the basis itself at a configurable signal period, with a gradient fill rendered between basis and signal using color.from_gradient to encode momentum direction.
normDist = math.abs(close - basis) / (vol * f4)
barAlpha = math.min(math.round(normDist * 65), 65)
sig = ta.ema(ta.ema(basis, sigLen), sigLen)
7. Entry Signals and Take-Profit Modes
Two entry signal types are provided per direction. Breakout entries fire when the basis crosses above (long) or below (short) the prior bar's basis value — a trend initiation signal based on the basis itself turning directional. Bounce entries fire when price wicks below the basis during a bull trend but closes back above it — a mean-reversion entry at the structural center. Take-profit aggressiveness maps to Fibonacci levels: Low targets the 2.618 band (letting winners run far), Medium targets the 1.0 band, and High targets the 0.618 band (quick, conservative profit-taking).
longEntry = ta.crossover(basis, basis )
longBounce = trend == 1 and low < basis and close > basis
shortEntry = ta.crossunder(basis, basis )
shortBounce = trend == -1 and high > basis and close < basis
Features
Triple-Smoothed Basis: Three sequential EMA applications to HLC3 produce a low-noise structural centerline that resists single-candle spikes.
Switchable Volatility: ATR or Standard Deviation mode allows the volatility engine to be matched to the instrument's price behavior characteristics.
Four Fibonacci Bands: Harmonic multipliers (0.618, 1.0, 1.618, 2.618) produce band distances grounded in natural ratio mathematics.
Non-Repainting State Machine: Trend direction stored in a var variable updates only on slope changes, ensuring historical plots never shift retroactively.
Direction-Conditional Cloud: Lower bands filled in bull trend, upper bands filled in bear trend — the relevant zone is always the visible one.
Gradient Fill: color.from_gradient between 0.618 and 2.618 bands provides depth perception of extension without cluttering the chart.
Proximity Bar Coloring: Distance to outer Fibonacci band drives bar color alpha, making extreme extensions visually prominent.
Triple-Smoothed Signal Line: EMA applied twice to the basis at a separate signal period creates a momentum crossover reference.
Four Signal Types: Long entry, long bounce, short entry, short bounce — covering both trend continuation and mean-reversion approaches.
Configurable TP Tiers: Three aggressiveness modes map take-profit targets to specific Fibonacci bands.
Seven-Row Dashboard: Real-time display of trend, basis value, distance from basis, current Fibonacci zone, volatility type, TP mode, and signal status.
Input Parameters
Basis Settings:
Basis Length: Period for the triple EMA smoothing (default: 20)
Volatility Type: ATR or StDev (default: ATR)
Volatility Length: Period for volatility calculation (default: 20)
Signal Settings:
Signal Length: Period for the signal line double-EMA (default: 9)
TP Aggressiveness: Low (2.618 target), Medium (1.0 target), High (0.618 target) (default: Medium)
Display Settings:
Show Cloud Fill: Toggle the directional Fibonacci band fill (default: true)
Show Signal Line: Toggle the triple-smoothed signal line (default: true)
Show Entry Signals: Toggle entry and bounce signal markers (default: true)
Show Bar Colors: Toggle proximity-based bar coloring (default: true)
Show Dashboard: Toggle the seven-row information table (default: true)
How to Use This Indicator
Step 1: Identify Trend State from the Cloud
The first check is always the cloud. When the lower Fibonacci bands are shaded (bull trend), the market is expected to support price from below. When the upper bands are shaded (bear trend), the market is expected to cap price from above. This orientation tells you which type of trade to look for: in bull trend, prioritize longs on basis or lower band touches; in bear trend, prioritize shorts on upper band touches or basis resistance.
Step 2: Enter on Breakout or Bounce
Two entry strategies are available and can be used independently or in combination. Breakout entries (basis crossover/crossunder) are momentum-based — they capture the early stage of a new directional basis move. Bounce entries are mean-reversion based — they exploit temporary dislocations where price dips below basis in a bull trend and recovers. The bounce condition (low below basis, close above basis) ensures the recovery is already occurring at signal time, not merely predicted.
Step 3: Manage Exits with Fibonacci Targets
Once entered, the Fibonacci band levels serve as structured exit targets. In Low aggressiveness mode, the target is the 2.618 band — appropriate for trending markets where the volatility expansion phase is expected to carry price far. In High aggressiveness mode, the 0.618 band is the target — suitable for choppy or ranging conditions where overextension is quickly reversed. The chosen TP level is shown in the dashboard.
Step 4: Monitor Dashboard for Contextual Data
The seven-row dashboard provides quantitative context that is not immediately visible from the chart alone. The "% from basis" row shows how extended price is as a percentage of the basis value. The "Fib Zone" row identifies which band pair price is currently between (e.g., between 1.0 and 1.618). This allows precise assessment of where price sits within the volatility structure without manually measuring band distances.
Indicator Limitations
The triple-smoothed basis introduces significant lag relative to the raw price. On short timeframes or fast-moving instruments, the basis will react to trend changes later than a single EMA of equivalent period. This is by design — users seeking faster response should reduce the basis length, accepting more noise in return.
Fibonacci ratios are not guarantees of price reaction. While these levels carry historical significance, markets do not mechanically respect any fixed level. The bands define zones of elevated probability, not certainties.
ATR volatility mode can be distorted by gap events (overnight gaps, earnings). In instruments prone to large gaps, the ATR will temporarily inflate, expanding all bands significantly for the ATR lookback period.
The trend state machine can remain in a prior trend state for extended periods when the basis is flat. During prolonged sideways markets, the cloud fill will reflect the last directional bias rather than the current neutral condition.
Bounce signals require price to wick below (for longs) or above (for shorts) the basis within a single bar. On higher timeframes where candles cover extended periods, this condition can mask the timing of the actual intrabar touch.
The signal line is derived entirely from the basis and shares the same lag characteristics. It should not be treated as an independent data source.
Originality Statement
The Fibonacci Volatility Cloud is an original integration of techniques that individually exist in various forms but have not been assembled in this specific combination or with these specific design choices.
The triple-smoothed EMA basis (EMA of EMA of EMA of HLC3) is a deliberate architectural choice that differs from standard Bollinger Band centerlines (single SMA), Keltner Channel basis (single EMA), and Donchian midpoints. The three-layer approach creates a distinctly different noise-filtering characteristic.
Using Fibonacci ratios (0.618, 1.0, 1.618, 2.618) as band multipliers rather than standard integer multiples (1, 2, 3) is an original application that connects the volatility channel framework to harmonic ratio analysis.
The direction-conditional cloud fill — where the visible fill switches between support bands and resistance bands based on current trend state — is an original visual design not found in standard volatility channel implementations.
The combination of ATR/StDev switchable volatility, triple-smoothed basis, Fibonacci multipliers, directional cloud, triple-smoothed signal line, proximity bar coloring, and a configurable TP tier system in a single cohesive indicator is not replicated by any publicly available PulseWire indicator.
The bounce signal definition (low penetrates basis, close recovers above basis within same bar, during confirmed bull trend) is a precise, self-confirming condition that reduces false signals without requiring additional confirmation from a second indicator.
Disclaimer
The Fibonacci Volatility Cloud is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. No indicator can predict future market behavior with certainty. Past signal performance does not guarantee future results. All trading involves risk of loss. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Confluence Matrix [JOAT]Confluence Matrix
Introduction
Every component in a professional trading system should serve a purpose, and ideally, no single component should bear the entire weight of decision-making alone. The best entries occur when multiple independent analytical methods all point in the same direction simultaneously — a confluence event that dramatically raises the probability that the observed setup reflects genuine market structure rather than random noise. The Confluence Matrix is built around this philosophy, integrating six distinct analytical modules into a single, cohesive overlay indicator with a unified seven-point scoring framework that gates every trade entry.
The six integrated modules are: HEMA regime analysis (three-layer Hull-EMA Hybrid with two-bar confirmation), Break of Structure and Change of Character market structure (swing pivot-based BOS and CHoCH detection), a triple-smoothed Fibonacci channel (0.618, 1.618, and 2.618 bands around a triple-EMA basis), an ATR compression detection engine (volatility squeeze state), Z-score cumulative impulse detection (statistically significant momentum streaks), and an OLS linear regression combined with cumulative delta proxy and volume RSI. Each module contributes one integer point to a directional score. Entries require a minimum score threshold — meaning price must be supported by a configurable number of simultaneously aligned modules before a position is opened.
Beyond signal generation, the indicator includes a simulated position tracking system that monitors open virtual positions with defined entry prices, take-profit levels, stop-loss levels, and a trailing stop mechanism. This system does not execute real trades — it visualizes what a rule-based system following the indicator's own signals would have done, providing an educational and contextual layer that helps users understand how the signals sequence in live trading conditions. All trade signals are confirmed-bar only, with no look-ahead repainting. The fifteen-row dashboard, ten alert conditions, and extensive visual customization options make this the most comprehensive single-overlay indicator in the JOAT suite.
Core Concepts
1. HEMA Three-Layer Regime with Two-Bar Confirmation
The HEMA (Hull-EMA Hybrid) forms the structural backbone of the regime assessment. Three independent HEMA instances at periods 20, 50, and 100 represent the fast, mid, and slow trend layers. Full bull regime requires ascending order of all three (fast above mid above slow). Full bear regime requires descending order. The two-bar confirmation state machine requires two consecutive bars of raw alignment before the confirmed regime variable updates — preventing rapid back-and-forth flipping on borderline crossovers.
f_hema(src, len) =>
ta.ema(2 * ta.ema(src, len / 2) - ta.ema(src, len), math.round(math.sqrt(len)))
hema1 = f_hema(close, 20)
hema2 = f_hema(close, 50)
hema3 = f_hema(close, 100)
rawBull = hema1 > hema2 and hema2 > hema3
rawBear = hema1 < hema2 and hema2 < hema3
confBull = rawBull and rawBull
confBear = rawBear and rawBear
The CHoCH (Change of Character) logic builds directly from this: a bullish BOS that occurs while confBear is true represents structural bullish momentum emerging from within a confirmed bear regime — the first evidence of potential regime reversal.
2. BOS and CHoCH with Visual Lines
Break of Structure detection uses ta.pivothigh and ta.pivotlow to track prior swing levels. BOS events draw labeled lines on the chart: teal/red for standard BOS continuation, violet-dashed for CHoCH. All line drawing uses line.new() with fixed coordinates on confirmed bars, and extends the right endpoint to the next BOS event for visual continuity across the chart.
chochUp = bosUp and confBear
chochDn = bosDn and confBull
lineStyle = (chochUp or chochDn) ? line.style_dashed : line.style_solid
lineColor = chochUp ? color.purple : bosUp ? color.teal : chochDn ? color.purple : color.red
3. Triple-Smoothed Fibonacci Channel
The Fibonacci channel applies the same triple-EMA smoothing used in the FVC indicator to produce a noise-resistant basis line, then projects Fibonacci-ratio bands (0.618, 1.618, 2.618) both above and below using ATR or standard deviation as the volatility measure. Within the Confluence Matrix, the channel serves a dual purpose: its own slope defines the "fib trend" score contribution, and its band levels serve as reference zones for proximity analysis.
basis = ta.ema(ta.ema(ta.ema(hlc3, basisLen), basisLen), basisLen)
fibTrend = basis > basis ? 1 : basis < basis ? -1 : 0
The 0.618 and 1.618 inner bands are filled with a gradient between basis and inner band, with the fill opacity tied to the confirmed regime — teal fills in bull regime, red fills in bear regime, gray in neutral.
4. ATR Squeeze Detection
The ATR squeeze module uses the same compression ratio logic as the VSO indicator: comparing a short-term EMA-smoothed ATR against a longer baseline to determine whether volatility is contracting or expanding. When volatility is contracting (squeezing), the squeeze score contribution is zero — the market is not yet expressing directional energy. When volatility is expanding, the module contributes to the appropriate directional score.
atrShort = ta.ema(ta.tr(true), sqzLen)
atrLong = ta.ema(atrShort, sqzLen * 2)
squeezing = atrLong > atrShort
sqzOK = not squeezing
5. Z-Score Cumulative Impulse
The Z-score impulse module tracks separate cumulative bull and bear momentum streaks, normalizes them against rolling sma/stdev, and marks statistically significant events with diamond markers (◆) plotted above and below the price bars. These markers are displayed at confirmed bars only. The Z-score values for both directions are shown in the dashboard and contribute one point each to the long and short scores when their respective thresholds are exceeded.
cumBull := close > close ? nz(cumBull ) + (close - close ) : 0
cumBear := close < close ? nz(cumBear ) + (close - close) : 0
zBull = (cumBull - ta.sma(cumBull, zLen)) / ta.stdev(cumBull, zLen)
zBear = (cumBear - ta.sma(cumBear, zLen)) / ta.stdev(cumBear, zLen)
6. OLS Regression, Delta Proxy, and Volume RSI
The sixth analytical layer combines three sub-components. The OLS linear regression (using the same manual implementation as the ARO indicator) provides the Pearson R correlation quality metric and theta angle, which together determine whether the regression score contributes. The cumulative delta proxy (bar-range-based buying/selling pressure estimate) determines the delta directional score. Volume RSI (RSI applied to volume series) provides the volume quality gate. All three sub-components are evaluated in the context of long or short scoring.
regressionScore = pearsonR > minR and math.abs(theta) > minTheta ? (theta > 0 ? 1 : -1) : 0
deltaScore = deltaPos ? 1 : -1
volumeScore = highVol ? (localBull ? 1 : -1) : 0
7. Seven-Point Confluence Scoring
Each of the six modules contributes one integer point to either the long score or the short score (some modules contribute to both). The seven scoring variables (ls1 through ls7 for long, ss1 through ss7 for short) are summed individually so each module's contribution is transparent and auditable. The minimum score threshold (default: 5 of 7) gates entry conditions.
ls1 = confBull ? 1 : 0 // HEMA regime
ls2 = lastBOSDir == 1 ? 1 : 0 // Last BOS direction
ls3 = fibTrend == 1 ? 1 : 0 // Fibonacci channel trend
ls4 = sqzOK ? 1 : 0 // Squeeze OK (not compressing)
ls5 = regressionScore == 1 ? 1 : 0 // Regression + Pearson
ls6 = deltaPos ? 1 : 0 // Delta proxy bullish
ls7 = highVol and localBull ? 1 : 0 // Volume RSI + local trend
longScore = ls1 + ls2 + ls3 + ls4 + ls5 + ls6 + ls7
8. Simulated Position Tracking with Trailing Stop
The position tracker uses persistent var variables to track open trade state. Entry occurs when a BOS trigger or HEMA crossover fires, the score meets the minimum threshold, the bar is confirmed, and no position is currently open in that direction. Stop-loss is set at ATR below the entry for longs (above for shorts). Take-profit is set at a multiple of ATR from entry. The trailing stop mechanism moves the SL to breakeven once the position has moved one ATR in the favorable direction — locking in capital protection once momentum is confirmed.
var int posDir = 0
var float openTP = na
var float openSL = na
var float entryPx = na
longEntry = (bosUp or hemaXover) and longScore >= minScore and barstate.isconfirmed and posDir <= 0
if longEntry
posDir := 1
entryPx := close
openTP := close + atr14 * tpMult
openSL := close - atr14 * slMult
// Trailing stop to breakeven
if posDir == 1 and high - entryPx > atr14
openSL := math.max(openSL, entryPx)
Exits occur on TP hit, SL hit, or confirmed regime flip opposing the position direction (confBear while long, confBull while short).
9. Proximity-Gradient Bar Coloring
Bar colors are driven by the distance between the current close and the HEMA mid layer (hema2), normalized by the range between the fast and slow HEMA layers. This produces a bar coloring scheme that reflects not just direction but the degree of extension relative to the HEMA structure's own internal spread — a more dynamically calibrated proximity measure than a fixed ATR reference.
hemaRange = math.abs(hema1 - hema3)
hemaDist = hemaRange > 0 ? math.abs(close - hema2) / hemaRange : 0
hemaProxAlpha = math.min(math.round(hemaDist * 60), 75)
Features
Six Integrated Modules: HEMA regime, BOS+CHoCH structure, Fibonacci channel, ATR squeeze, Z-score impulse, and OLS regression+delta+volume all active simultaneously.
Seven-Point Scoring System: Each module contributes one point to a transparent, auditable confluence score with configurable minimum threshold for entry.
Two-Bar HEMA Confirmation: Prevents false regime transitions on single-bar HEMA crossovers.
CHoCH Detection: BOS events opposing the confirmed regime are classified as Change of Character and drawn with violet dashed lines.
Z-Score Diamond Markers: Statistically significant momentum streak markers displayed as ◆ above and below bars on confirmed events.
Triple-Smoothed Fibonacci Channel: 0.618, 1.618, and 2.618 bands with regime-conditional gradient fills.
Simulated Position Tracking: Virtual positions with TP, SL, and trailing stop to breakeven — visualizing the signal system in action.
Proximity-Gradient Bar Coloring: HEMA-internal-range-normalized distance drives bar color alpha for structure-relative visual encoding.
BOS Lines: Teal/red for continuation BOS, violet dashed for CHoCH — drawn at confirmed bars with horizontal extensions.
Fifteen-Row Dashboard: Position direction, regime, last BOS, CHoCH state, fib trend, volatility, Pearson R, theta, bull Z, bear Z, volume RSI, delta proxy, long score, short score, and minimum score threshold.
Ten Alert Conditions: Long entry, short entry, long exit, short exit, CHoCH up, CHoCH down, bull impulse, bear impulse, BOS up, BOS down — all as constant string alerts.
Input Parameters
HEMA Settings:
Fast/Mid/Slow Lengths: HEMA layer periods (defaults: 20, 50, 100)
Structure Settings:
Swing Length: Pivot lookback for BOS/CHoCH detection (default: 10)
Fibonacci Channel Settings:
Basis Length: Triple-EMA period (default: 20)
Volatility Type: ATR or StDev (default: ATR)
Volatility Length: Period for volatility measure (default: 14)
Z-Score Settings:
Z Lookback: Rolling window for normalization (default: 50)
Z Threshold: Sigma level for impulse trigger (default: 2.0)
Regression Settings:
Regression Length: Bar count for OLS calculation (default: 50)
Min Pearson R: Minimum |R| for regression score contribution (default: 0.6)
Min Theta: Minimum angle for regression score contribution (default: 5)
Entry/Exit Settings:
Minimum Score: Points required for entry (default: 5)
TP Multiplier: ATR multiple for take-profit level (default: 2.0)
SL Multiplier: ATR multiple for stop-loss level (default: 1.0)
Display Settings:
Show HEMA Layers: Toggle individual HEMA line visibility (default: true)
Show Trend Cloud: Toggle HEMA gradient fill (default: true)
Show Fibonacci Channel: Toggle Fibonacci band fills (default: true)
Show BOS Lines: Toggle structural break lines (default: true)
Show Z Markers: Toggle diamond impulse markers (default: true)
Show Position Lines: Toggle TP/SL/entry lines (default: true)
Show Bar Colors: Toggle proximity gradient bar coloring (default: true)
Show Dashboard: Toggle the fifteen-row table (default: true)
How to Use This Indicator
Step 1: Read the Score Before Acting on Any Signal
The most important discipline when using the Confluence Matrix is to check the long score or short score before taking any action on a signal. A BOS up event alone carries one point; it does not guarantee a high-probability setup. A BOS up event accompanied by a score of 6 or 7 — meaning five or six other modules are simultaneously aligned — is a materially different situation. Begin each analysis session by reading the dashboard scores and understanding which modules are contributing and which are not.
Step 2: Use the CHoCH for Regime Change Awareness
CHoCH events are the most important structural signals in the indicator. A CHoCH up (bullish BOS during a confirmed bear regime) does not mean immediately go long — it means the structural assumption of the prior bear regime is being challenged. Wait for the regime confirmation to update, watch for the long score to rise as modules align with the new potential bull regime, and then consider entry on the next confirmed BOS in the bull direction backed by a high score. The sequence matters: CHoCH first, then regime confirmation, then high-score entry.
Step 3: Let the Simulated Position Tracker Teach Pattern Recognition
The position tracker lines (entry, TP, SL) on the chart are an educational tool. Over time, reviewing where simulated positions were opened and closed relative to the subsequent price action reveals patterns about which score thresholds, which module combinations, and which entry triggers produce the cleanest outcomes on the specific instrument you are analyzing. Use this visual feedback to calibrate your own minimum score setting and module weighting preferences.
Step 4: Manage Visual Complexity Through Selective Display
Six integrated modules produce a significant amount of simultaneous chart information. New users should start with all display elements enabled to understand the full system, then progressively toggle off elements they are not actively using for a given analysis. The dashboard always reflects the underlying calculations regardless of display settings — so even with Fibonacci fills and BOS lines hidden, the score, regime, and all module states remain visible in the dashboard.
Indicator Limitations
The simulated position tracking system is a visual and educational tool only. It does not place real orders, cannot account for slippage, spread, or commission costs, and its results should never be used as a basis for financial decisions. Simulated performance and real-world trading performance are categorically different.
The seven-module scoring system assigns equal weight to all contributing modules. In practice, some modules (e.g., HEMA regime) may carry more structural significance than others (e.g., volume RSI). The equal-weight assumption is a simplification.
Six integrated modules means six sets of parameters to configure. The default settings are calibrated for daily and 4-hour chart analysis on liquid instruments. Heavy optimization of all parameters to historical data risks overfitting — the resulting configuration may perform well on history but fail on new data.
The OLS regression component requires sufficient bars to produce stable Pearson R and theta values. In the first regression-length bars of any chart session, these values will be based on very short windows and should not be treated as reliable quality filters.
All modules operate on the chart's native timeframe. The indicator does not incorporate multi-timeframe analysis internally — users seeking MTF context should reference the MCG indicator in combination.
Proximity bar coloring uses the HEMA internal range (hema1 minus hema3) as the normalizer. When all three HEMA layers are closely clustered (flat, sideways market), this range approaches zero, which can cause division instability in the proximity calculation. A guard for this case is included but the coloring will be less informative during flat HEMA conditions.
The trailing stop to breakeven mechanism fires when the position has moved one ATR in the favorable direction. In very high-volatility conditions with large ATR values, this may mean the SL does not move to breakeven until the position is significantly extended, reducing capital protection in fast-moving markets.
Originality Statement
The Confluence Matrix is the most comprehensive indicator in the JOAT suite and represents an original architectural achievement in the design of multi-module overlay indicators.
The seven-point confluence scoring system — where six independent analytical modules each contribute a single integer vote, and entry is gated by a minimum aggregate threshold — is an original framework for combining heterogeneous technical signals into a unified, transparent decision criterion.
The combination of HEMA regime, BOS/CHoCH structure, Fibonacci channel, ATR squeeze, Z-score impulse, and OLS regression+delta+volume in a single non-repainting overlay indicator with no external indicator dependencies is an original integration not replicated by any single publicly available PulseWire indicator.
The simulated position tracking system with trailing stop to breakeven — driven entirely by the indicator's own scoring and signal conditions, visualized directly on the chart — is an original self-contained feedback mechanism for understanding the system's real-time behavior.
The CHoCH classification (BOS event opposing the confirmed two-bar regime, not merely the raw regime) adds a confirmation layer to the standard CHoCH definition that reduces false change-of-character signals during borderline regime periods.
The proximity bar coloring normalized by the internal HEMA range (hema1 minus hema3) rather than by a fixed ATR reference creates a structure-relative alpha calculation that adapts to the current degree of HEMA layer separation — a more contextually aware coloring approach than fixed-reference alternatives.
The use of ten constant-string alert conditions (not dynamic or computed strings) ensures full compatibility with PulseWire's alert system, including webhook delivery and multi-condition alert construction.
Disclaimer
The Confluence Matrix is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. The simulated position tracking feature is for educational visualization only and does not represent actual trade results. No scoring system or multi-indicator confluence framework can guarantee profitable trading outcomes. All trading involves risk, including the potential loss of principal. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Anchored Regression Oracle [JOAT]Anchored Regression Oracle
Introduction
Linear regression is one of the most powerful tools in statistical analysis, yet its application in most trading indicators is limited to a fixed rolling window applied to closing prices — a single-dimensional view of a multi-dimensional problem. The Anchored Regression Oracle extends classical Ordinary Least Squares regression in four distinct ways: it supports both logarithmic and linear price scaling, it offers multiple anchor modes (fixed bar count or calendar-period anchoring), it computes a full set of deviation, Fibonacci, and extreme projection levels above and below the regression line, and it incorporates the Pearson R correlation coefficient and theta angle as real-time quality metrics that control signal eligibility.
The fundamental insight motivating the log/linear duality is that financial prices grow multiplicatively, not additively. A $10 move from $100 is a 10% change; a $10 move from $1000 is a 1% change. Fitting a straight line through raw prices on a linear scale treats these as equivalent. Fitting through log-transformed prices treats them as proportionally equivalent — and for equities, cryptocurrencies, and other compounding instruments, the log-space regression is often the more meaningful representation of trend. The indicator handles both cases transparently, transforming all calculation into log space when selected and back-transforming all output levels to price space for display.
The calendar anchoring system adds a dimension that pure bar-count indicators cannot provide: the ability to reset and recalculate the regression window at the start of each new trading day, week, month, or other period — automatically. This makes the regression channel contextually anchored to the current period's price action rather than an arbitrary historical bar count, without any manual intervention.
Core Concepts
1. Manual OLS Linear Regression
The indicator implements the full Ordinary Least Squares regression formula manually rather than using Pine Script's built-in ta.linreg(). This is a deliberate choice: the manual implementation supports both logarithmic transformation and expanding anchor windows, neither of which the built-in function accommodates. The calculation accumulates bar-level sums across the current window to derive the exact OLS slope and intercept.
slope = (n * sumXY - sumX * sumY) / (n * sumXX - sumX * sumX)
intercept = (sumY - slope * sumX) / n
lrValue = intercept + slope * n
Where n is the current window size, sumXY is the sum of bar-index times price products, sumXX is the sum of squared bar indices, and sumX and sumY are the simple sums of indices and prices respectively. In log mode, all price values entering the sums are first transformed via math.log(), and all output levels are back-transformed via math.exp() before rendering on the chart.
2. Pearson R Correlation Coefficient
After computing slope and intercept, the Pearson R coefficient is derived from the same accumulated sums. R measures the linearity of the relationship between bar index and price — essentially, how well the regression line fits the actual price path. Values near 1.0 or -1.0 indicate strong linear trends where the regression line is a reliable representation. Values near 0 indicate that price is moving chaotically relative to a linear model.
dxt = sumXX - sumX * sumX / n
dyt = sumYY - sumY * sumY / n
pearsonR = (sumXY - sumX * sumY / n) / math.sqrt(dxt * dyt)
The dashboard displays Pearson R with color coding: teal for |R| ≥ 0.8 (strong fit), orange for |R| ≥ 0.5 (moderate fit), red for |R| below 0.5 (weak fit). When the Pearson filter is enabled, only readings with |R| above the user threshold are eligible for signal generation — preventing trades on regression lines that do not actually describe the price behavior.
3. Theta Angle
The slope of the regression line is an abstract mathematical quantity that is not intuitively interpretable. Converting it to a theta angle using the arctangent function produces a human-readable degree value: a steeply rising trend shows a large positive angle, a flat trend shows near-zero degrees, and a declining trend shows a negative angle. The minimum theta filter allows users to exclude signals from very shallow trends — requiring a minimum degree of directional conviction before entries are considered.
theta = math.atan(-slope) * 180 / math.pi
Note that the negative sign before slope accounts for the inversion between mathematical y-axis convention (upward) and screen y-axis convention (downward in most chart implementations), ensuring the displayed angle intuitively matches the visual slope direction on the chart.
4. Window Modes: Rolling vs. Anchored
The "Bar" mode uses a fixed rolling window of N bars — the regression line covers exactly the last N candles regardless of calendar position. All period-based modes ("Minute", "Hour", "Day", "Week", "Month") use an expanding anchor: a bar counter resets to zero each time a new period begins (detected via timeframe.change()), and the regression window expands from that anchor point through the current bar. This means on day anchoring, the regression always describes the current day's price action from the first bar to now — expanding as the day progresses and resetting at the start of each new day.
var int windowBars = 0
periodChanged = timeframe.change(targetTF)
windowBars := periodChanged ? 1 : windowBars + 1
effectiveLen = windowMode == "Bar" ? barLen : windowBars
5. Deviation and Fibonacci Projection Levels
Six lines are drawn on the chart, all updated on barstate.islast to avoid performance overhead. The center line is the regression line itself. The upper and lower deviation lines are offset by user-configurable standard deviation multiples. A Fibonacci level is plotted at 1.618 standard deviations. Historical high and low lines track the maximum deviation point actually reached by price above and below the regression line over the window — providing empirical rather than statistical bounds.
f_lvl(base, std, mult) =>
logMode ? math.exp(math.log(base) + std * mult) : base + std * mult
upperDev = f_lvl(lrValue, stdDev, upperMult)
lowerDev = f_lvl(lrValue, stdDev, lowerMult)
fibLevel = f_lvl(lrValue, stdDev, 1.618)
In log mode, the offset is applied additively in log space (equivalent to multiplicative scaling in price space), ensuring the deviation levels remain proportionally consistent with the log-scale price representation.
6. Five Signal Modes
The signal system offers five distinct behavioral modes. "None" disables signals entirely. "Deviation|Breakout" fires when price crosses above the upper deviation (long) or below the lower deviation (short). "Deviation|MeanReversion" fires when price crosses back inside the deviation bands after an excursion outside. "Extreme|Breakout" uses the historical high and low deviation lines as the reference. "Extreme|MeanReversion" fires when price returns inside the historical extremes. "Theta-Only" generates signals based solely on the theta angle crossing the minimum threshold, regardless of price position relative to deviation levels.
Features
Full Manual OLS Regression: Complete Ordinary Least Squares implementation supporting both log and linear price scaling without any ta.linreg() dependency.
Log/Linear Scale Toggle: Log mode transforms all prices via math.log before regression and back-transforms all output levels, producing proportionally correct channels for compounding instruments.
Multiple Window Modes: Fixed bar count or calendar-anchored expanding windows (Minute, Hour, Day, Week, Month) that reset automatically on period transitions.
Pearson R Coefficient: Real-time correlation quality metric with color-coded dashboard display and optional signal eligibility filter.
Theta Angle: Human-readable trend angle from arctangent of slope with optional minimum threshold signal filter.
Six Regression Lines: Center regression line, upper and lower user-configured deviation bands, 1.618 Fibonacci level, and historical high/low deviation extremes.
Five Signal Modes: Deviation breakout, deviation mean-reversion, extreme breakout, extreme mean-reversion, and theta-only — covering different trading philosophies.
Historical Ghost Plots: Non-repainting semi-transparent historical regression and deviation plots for visual context of prior channel positions.
Efficient Line Updates: All six lines are updated on barstate.islast only, maintaining performance even on long chart histories.
Seven-Row Dashboard: Pearson R (color-coded), theta with sign, direction, signal mode, window type, standard deviation, and window size.
Four Alert Conditions: Long entry, short entry, long exit, short exit — all gated by optional Pearson and theta filters.
Input Parameters
Regression Settings:
Window Mode: Bar, Minute, Hour, Day, Week, or Month (default: Day)
Bar Length: Fixed window size when mode is "Bar" (default: 100)
Target Timeframe: Calendar period string used in timeframe.change() for anchored modes (default: "D")
Log Mode: Enable logarithmic price transformation (default: false)
Deviation Settings:
Upper Deviation Multiplier: Standard deviation multiple for upper channel boundary (default: 2.0)
Lower Deviation Multiplier: Standard deviation multiple for lower channel boundary (default: 2.0)
Show Fibonacci Level: Toggle the 1.618 StdDev Fibonacci projection line (default: true)
Show Historical Extremes: Toggle the historical high/low deviation lines (default: true)
Signal Settings:
Signal Mode: None, Deviation|Breakout, Deviation|MeanReversion, Extreme|Breakout, Extreme|MeanReversion, Theta-Only (default: Deviation|Breakout)
Minimum Theta: Minimum absolute angle in degrees required for signal eligibility (default: 5)
Pearson Filter: Enable Pearson R minimum threshold (default: false)
Min Pearson R: Minimum |R| required when filter is active (default: 0.7)
Display Settings:
Show Historical Plots: Toggle ghost regression and deviation plots (default: true)
Historical Alpha: Transparency level for historical plots (default: 75)
Show Dashboard: Toggle the seven-row information table (default: true)
How to Use This Indicator
Step 1: Select the Appropriate Window Mode
Start by choosing the window mode that matches your analytical context. For intraday trading, Day anchoring is most natural — it resets the regression at the start of each session, showing how the current day's price action trends from the open. For swing trading, Week or Month anchoring provides a broader structural perspective. Bar mode is appropriate when you want consistent lookback regardless of calendar, for example in crypto markets that trade continuously without session boundaries.
Step 2: Evaluate Regression Quality Before Trusting Signals
Check the Pearson R value in the dashboard before interpreting any signal. A strong R (teal, ≥ 0.8) means price has been moving in a well-defined linear trend — the regression line is descriptively accurate and signals from it carry more weight. A weak R (red, < 0.5) means price has been choppy and non-linear; the regression line is fitting noise, and deviation-based signals will be unreliable. If the Pearson filter is enabled, signals will simply not fire when R is below threshold, automating this quality check.
Step 3: Choose a Signal Mode Matching Your Strategy
Breakout modes are suited for momentum strategies — they enter when price is moving away from the regression mean with statistical force. Mean-reversion modes are suited for range-expansion strategies — they enter when price returns inside the channel after an excursion, betting on a return to mean. The Extreme modes use the actual historical high/low deviations rather than the fixed multiplier, making them adaptive to the specific price behavior observed in the current window.
Step 4: Apply Theta and Pearson Filters for Quality Control
Enable the minimum theta filter to avoid trading very shallow trends. A trend angled at 3 degrees has minimal directional conviction — the regression line is nearly horizontal, and any deviation signals from it may be as much noise as signal. Setting a minimum of 10-15 degrees for active entries ensures you are trading genuine directional moves rather than sideways grinding. Combine this with the Pearson filter for the highest-quality signal subset.
Indicator Limitations
Linear regression assumes the relationship between time and price is fundamentally linear during the window. In strongly trending markets this is approximately true; in markets with curves, accelerating trends, or parabolic moves, the linear model will systematically underfit the actual trajectory.
The OLS calculation accumulates sums over the entire window on every bar. On very long bar counts or in expanding anchor modes late in a long session, this can affect script execution time, particularly when combined with other indicators on the same chart.
Calendar anchoring uses timeframe.change() which is resolution-dependent. If the chart timeframe is coarser than the anchor period (e.g., viewing a weekly chart with day anchoring), the anchor period may not transition as expected.
Pearson R measures linear correlation specifically. A price series that follows a consistent curve will produce a lower R than one that follows a straight line, even if the curve describes a very orderly trend. In log mode, this issue is partially mitigated for exponentially trending instruments.
Historical ghost plots are informational only and represent completed regression windows. They do not update after their respective periods close.
In log mode, the volatility measure used for deviation computation is the standard deviation of log-transformed prices, which is equivalent to a percentage standard deviation. For very short windows, this measure can be highly sensitive to individual bar outliers.
Signals on the current (incomplete) bar are not displayed, as all signal conditions require barstate.isconfirmed to prevent look-ahead.
Originality Statement
The Anchored Regression Oracle is a substantially original analytical tool that addresses specific limitations of existing regression-based indicators on PulseWire.
The manual OLS implementation (computing slope, intercept, and Pearson R from accumulated sums without ta.linreg()) enables the log-space calculation that built-in functions do not support — allowing mathematically correct regression channels for compounding assets.
The calendar-anchored expanding window system (using timeframe.change() to reset a bar counter and grow the regression window from a fixed calendar point) is an original approach to making regression contextually meaningful for session-based or period-based analysis.
Computing and displaying the theta angle (arctangent of slope in degrees) as a real-time trend steepness metric, with a configurable minimum threshold that gates signal eligibility, is an original signal quality framework not found in standard regression channel indicators.
The five-mode signal system — providing breakout and mean-reversion variants for both statistical deviation levels and empirical historical extremes, plus a theta-only mode — covers a range of trading philosophies from a single indicator, rather than requiring separate indicators for each approach.
The combination of log/linear duality, calendar anchoring, Pearson quality gating, theta filtering, Fibonacci projection at 1.618 StdDev, and historical ghost plots in a single indicator represents an integration of features not available in any single existing PulseWire regression tool.
Disclaimer
The Anchored Regression Oracle is provided for educational and informational purposes only. It is a technical analysis tool and does not constitute financial advice. Statistical measures such as Pearson R and regression slope describe historical relationships and do not predict future price behavior. All trading involves risk of loss. Users are solely responsible for their own trading decisions. Please consider your individual risk tolerance and consult a licensed financial professional before engaging in any trading activity.
-Made with passion by officialjackofalltrades
Indicator

Syndicate Confluence [JOAT]Syndicate Confluence
Introduction
Syndicate Confluence is an open-source overlay indicator that unifies three independent analytical engines into a single spatially organized visual system. Engine 1 is an adaptive Kalman filter with a Supertrend ratchet trail — it classifies the macro directional regime and generates a triple-glow neon trail on the chart. Engine 2 is an institutional order block zone mapper — it identifies swing-pivot order blocks, classifies them by trading session, and renders them as persistent box-based zones with session-colored borders and labeled displacement ratios. Engine 3 is an HMA pressure trail paired with a custom volume-weighted MFI — it classifies each bar into bull pressure, bear pressure, or neutral states.
The three-layer visual architecture ties all three engines together: an outer ATR cloud communicates the macro volatility context of the Kalman filter; a corridor fill between the Kalman Supertrend line and the HMA trail communicates whether both engines are aligned in the same direction; and a core gradient fill between the HMA trail and the candle mid-body communicates the intensity of the current pressure state. When all three layers are saturated in the same color, the confluence is at its strongest. When they are fragmented, the market is transitioning.
The highest-confidence signal — the starred HC Long or HC Short label — fires only when a trail flip, Kalman direction, and order block proximity all coincide simultaneously. This triple-engine intersection is the indicator's primary setup, and the remaining visual layers exist to help traders evaluate whether conditions are building toward or away from that state.
Core Concepts
1. Adaptive Kalman Regime Engine
The Kalman filter maintains a running estimate and error variance. Each bar, the gain is computed as err / (err + noise), where noise = alpha * period. The estimate is updated toward close proportional to the gain, and the error variance self-adjusts — expanding when prediction is poor (high responsiveness), contracting when the filter tracks well (high smoothness). A Supertrend ratchet is applied to the Kalman value: ATR-scaled upper and lower bands drift with a direction-persistence rule — the upper band can only fall, the lower band can only rise. Direction flips when the Kalman value closes through the active band. Applying the ratchet to a Kalman-smoothed price removes the micro-fluctuations that cause excessive flips in price-based systems.
2. Session-Colored Order Block Zones
When a swing pivot low is confirmed, the indicator searches back for the last bearish candle before the pivot. If the subsequent displacement exceeds ATR * dispMult, that candle becomes a bull order block. The zone is drawn at the candle's midpoint with ATR-scaled height. Zone border color is determined by the birth session: London = blue (#60a5fa), NY = pink (#f472b6), Asia = green (#34d399). The label shows type, session, displacement ratio (e.g., "▲ BULL LON 1.8x 5030.41"), and updates its x-position every bar to track the right edge of the chart. Border thickness scales with displacement ratio — zones from 2x+ displacement moves get thicker borders.
3. HMA Pressure Trail and Volume-Weighted MFI
An HMA ratchet trail determines directional commitment. The custom volume-weighted MFI sums volume * hlc3 on rising bars (positive flow) and volume * hlc3 on falling bars (negative flow), normalizes with the RSI formula, and smooths with an HMA. Bull pressure is active when the trail is bullish AND the smoothed MFI exceeds the bull threshold. Bear pressure when trail is bearish AND MFI below the bear threshold. The pressure strength percentage tracks the rolling 50-bar proportion of bars spent in an active pressure state.
4. Three-Layer Visual Architecture
Outer ATR Cloud: k_val ± cloudMult * ATR filled with directional color at near-full transparency — communicates macro volatility context and Kalman regime at a glance
Corridor Fill: The zone between the Kalman Supertrend line and the HMA trail — fills cyan when both agree bullish, rose when both agree bearish, neutral gray when diverging. When the corridor narrows and both trails converge in the same direction, confluence is building
Core Pressure Gradient: Between the HMA trail and the candle mid-body — transparent at the HMA, saturated at the body, colored by pressure state. Deep color indicates active, volume-backed directional pressure
5. Signal Hierarchy
★ HC Long / ★ HC Short: Trail flip + Kalman direction + OB proximity — the highest-confidence setup. Starred label with colored background
Trail flip arrows: Triangle up/down when trail flips in Kalman direction with MFI above/below 50 — standard entry signal
MFI cross-50 triangles: Small triangles on the Kalman trail when MFI crosses the 50 level in the trail direction — momentum regime shift marker
TP labels: Fire when MFI reaches overbought or oversold extremes in the trail direction
K▲ / K▼ labels: Mark the exact bar where the Kalman Supertrend direction flips
Squeeze diamond / circle: Diamond on squeeze start, circle on squeeze release
Volume impulse labels: "1.8x vol" label on high-volume directional bars above the configured multiple
Proximity diamonds: Fire on the first bar where price enters the OB proximity buffer
Features
Adaptive Kalman Filter: Self-calibrating gain updates noise estimate each bar — faster during impulses, smoother during consolidation
Supertrend Ratchet on Kalman: Direction-persistent bands applied to the filtered price — stable, low-whipsaw regime signal
Triple-Layer Kalman Glow: Widths 9/5/2 with decreasing transparency create a neon halo effect on the Supertrend trail
Outer ATR Volatility Cloud: Wide envelope around the Kalman value, gradient-filled by regime direction
Corridor Fill (Kalman ST ↔ HMA Trail): The alignment region between both trails — fills directionally when confluent, neutral when diverging
Core Pressure Gradient Fill: HMA-to-mid-body gradient colored by active pressure state
Session-Colored OB Zone Borders: London blue / NY pink / Asia green borders encode session context directly in the zone visual
OB Zone Labels: Type, session, displacement ratio, and price level — updated live at right chart edge
★ HC Long / HC Short Labels: Triple-confluence signal fired when trail flip, Kalman direction, and OB proximity align
Trail Flip Arrows: Triangle up/down entry signals when trail flips in Kalman direction with MFI midline confirmation
MFI Cross-50 Markers: Small triangles on the trail at momentum regime shifts
TP Overbought/Oversold Labels: Fire at MFI extremes in trail direction
K▲/K▼ Kalman Flip Labels: Pinpoint the exact bar of each Kalman regime change
Squeeze Detection: Diamond on Kalman band compression start, circle on release
K-Velocity Dots: Brightness-scaled dots on the trail communicating momentum acceleration
Volume Impulse Labels: Ratio labels on high-volume directional bars
Proximity Diamonds: Alert when price first enters the OB proximity buffer
Regime Transition Circles: Fire at every Kalman regime change on the trail line
Gradient Bar Coloring: Saturates with MFI intensity when Kalman and trail agree, fades to neutral otherwise
13-Row Dashboard: K-Regime, Trail, Pressure state, Zone proximity, Confluence, MFI, P-Strength %, Squeeze state, Band Width, Trend Bars, K-Velocity %, ATR
9 Alertconditions: Long/short signals, HC signals, TP signals, squeeze release, Kalman flips
Input Parameters
Regime Engine:
Kalman Alpha: Base noise smoothing — lower = smoother, more lag (default 0.02)
Kalman Beta: Error variance recovery rate (default 0.10)
Kalman Period: Gain magnitude scaler (default 50)
ST Factor: ATR multiplier for Supertrend bands on Kalman (default 1.5)
ST ATR Length: ATR lookback for band calculation (default 10)
Cloud ATR Width: Outer cloud multiplier (default 2.5)
Squeeze Threshold %: Band width below this % of SMA triggers squeeze (default 80%)
Zone Engine:
Swing Length: Pivot confirmation lookback (default 5)
OB Lookback: Bars searched for qualifying order block candle (default 20)
Displacement ATR Mult: Minimum move to validate an OB (default 0.8)
Zone ATR Width: Zone height as ATR fraction (default 0.75)
Max Active OBs / Side: Oldest zones trimmed beyond this limit (default 8)
Proximity Buffer (ATR): Approach detection radius (default 1.5)
Momentum Engine:
MFI Length: Volume-weighted money flow lookback (default 14)
MFI Smooth: HMA smoothing on raw MFI (default 5)
Trail HMA Length: HMA period for pressure trail (default 14)
Trail ATR Mult: Trail band width (default 1.5)
MFI Bull/Bear Thresholds: Pressure activation levels (default 58/42)
Signals:
TP Overbought / Oversold: MFI extremes for TP labels (default 78/22)
Impulse Vol Multiplier: Volume multiple for impulse labels (default 1.5)
How to Use This Indicator
HC Signal Setup:
The ★ HC Long / HC Short label is the primary setup. It fires when the trail flips in the Kalman direction while price is within proximity of an active order block. Enter on the labeled bar. Trail your stop at the HMA trail line. Look for the TP label or pressure state deactivation as an exit reference.
Corridor Fill as Trend Quality Gauge:
When the corridor between the Kalman trail and HMA trail is narrow and saturated with color, both trend systems are locked in the same direction — this is the highest-confidence trending condition. When the corridor is wide or neutral gray, the two systems are diverging — reduce size or wait for re-alignment.
Reading the Signal Hierarchy:
Start with the Kalman regime (K▲/K▼ label and trail color) for macro direction. Add the trail flip arrow for timing. Confirm with MFI cross-50 triangle. Check if an OB zone is nearby for HC bonus. Exit on TP label or when the corridor fill turns neutral.
Squeeze Breakout Setup:
When the golden diamond squeeze marker fires, the Kalman bands are compressing. Wait for the circle squeeze release marker. If the trail is aligned with the Kalman regime at release, the first trail flip after the release is a high-quality breakout entry.
Indicator Limitations
Order block detection requires a confirmed swing pivot, which in Pine Script v6 is offset by swingLen bars — zones are created after the fact relative to the actual pivot candle
The corridor fill between the Kalman trail and HMA trail can produce wide fills on instruments with large spread between the two systems — this is informational, not a defect, but may visually dominate the chart on some timeframes
HC signals require all three conditions simultaneously. On instruments with sparse order block formation, HC signals may be infrequent compared to standard trail flip arrows
The volume-weighted MFI requires volume data. On instruments with unreliable volume reporting, the pressure engine may be less meaningful than on equities or futures
Squeeze detection uses 80% of the 20-bar SMA as the threshold. On instruments that are persistently low-volatility, this threshold may trigger continuously — adjust the squeeze percentage parameter upward for such instruments
Originality Statement
This indicator is original in its three-engine confluence architecture, the corridor fill system between the Kalman Supertrend and HMA trail, and the session-colored OB zone integration with the starred HC signal. The publication is justified because:
The corridor fill between the Kalman Supertrend trail and the HMA pressure trail creates a novel visual quality gauge — the width and saturation of the corridor communicates alignment strength between macro regime and near-term pressure in a single spatial layer
Session-colored OB zone borders encode institutional session context directly into the zone visual without requiring a separate session indicator, making the chart self-contained for context-aware zone evaluation
The HC signal requires three independent engine conditions to coincide: Kalman regime direction, trail flip timing, and OB proximity. This triple-gate structure is a more restrictive and higher-quality filter than any two-condition confluence approach
The three-layer visual architecture (outer cloud, corridor fill, core pressure gradient) creates a spatially organized picture where the distance between layers communicates regime context, trail alignment, and pressure intensity at different spatial scales simultaneously
The K-velocity dot brightness system embeds momentum acceleration directly into the trail visualization without requiring a separate panel — the trail itself communicates direction, state, and rate of change simultaneously
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Structural Momentum Gauge [JOAT]Structural Momentum Gauge
Introduction
Structural Momentum Gauge is an open-source overlay indicator that fuses an adaptive Kalman filter with a Supertrend ratchet trail and a WMA-based volatility envelope to produce three clearly defined regime states: Bull Trend, Bear Trend, and Range-Bound. Rather than relying on a fixed moving average, the Kalman filter continuously self-calibrates its noise estimate each bar, delivering a smoothed price proxy that adapts to changing market conditions without introducing unnecessary lag. The Supertrend ratchet applied directly to the Kalman value — rather than to a raw price midpoint — generates directional bias changes that are markedly more stable than those produced by conventional price-based systems.
The core problem this indicator addresses is that most trend-following tools either repaint (flipping signals on the same bar as price reverses) or commit to a direction far too slowly. The Kalman filter's gain calculation absorbs noise on low-momentum bars while remaining sensitive during genuine impulses. Layering an envelope breach condition on top means both the Kalman direction and price location relative to the volatility band must agree before a trend regime is confirmed — a dual-gate that substantially reduces false readings on choppy, sideways charts.
Core Concepts
1. Adaptive Kalman Filter
The Kalman filter maintains two persistent state variables: the current estimate (k_est) and the error variance (k_err). Each bar the Kalman gain is computed as k_err / (k_err + noise), where noise equals kAlpha * kPeriod. The gain controls how much the estimate shifts toward the current close. After updating the estimate, the error variance is revised: (1 - gain) * k_err + kBeta / kPeriod. This means a large prediction error pushes the variance higher, increasing the gain on the next bar and making the filter more responsive. When price action settles, the gain contracts and the filter smooths out. The result is a price proxy that is neither the fixed-lag of a simple moving average nor the noise sensitivity of a raw close.
2. Supertrend Ratchet on Kalman
ATR-scaled upper and lower bands are applied around the Kalman value rather than the raw hl2. The ratchet rule then applies: the upper band can only move down (or reset when the Kalman value crosses above it), and the lower band can only move up (or reset when the Kalman value crosses below it). Direction flips when the Kalman value closes through the active band. Applying the ratchet to a pre-filtered price removes the micro-fluctuations that cause excessive direction changes when using hl2 directly.
3. WMA Volatility Envelope
A WMA of the high-low range, multiplied by the deviation parameter, defines half the envelope width. The envelope upper and lower levels are placed symmetrically around the Kalman value. An extended outer cloud — 1.35x the inner envelope — is plotted for spatial context. A price close above the upper envelope sets the range state to 1; a close below the lower sets it to -1. Regime confirmation requires both the Kalman Supertrend direction and the envelope range state to agree in sign:
4. Regime Classification
combined = kBias * rState, where kBias is +1 when the Kalman Supertrend is bullish and rState is +1 when close is above the upper envelope. combined == 1 with kBias == 1 is a confirmed bull trend. combined == 1 with kBias == -1 is a confirmed bear trend. All other states are range or opposing. A rolling 50-bar history computes what percentage of recent bars were in a trending state, producing a Trend Strength percentage.
5. K-Velocity
The rate of change of the Kalman value over three bars, normalized by the current ATR, yields a K-Velocity score from 0 to 1. Velocity dots appear on the Kalman line when the score exceeds 0.5, with their transparency inversely proportional to the velocity — faster moves produce more saturated dots. This creates a visual intensity signal on the trail itself, communicating acceleration and deceleration without a separate panel.
Features
Adaptive Kalman Filter: Self-calibrating price proxy with alpha and beta gain controls — responds faster during impulses, smooths more during consolidation
Supertrend Ratchet on Kalman: Direction-persistent trail applied to the Kalman value, eliminating noise-driven flips on raw price crossovers
Outer Envelope Cloud: Wide ATR envelope filled directionally, providing spatial context at a glance
Inner Envelope Fill: Standard WMA envelope bands with conditional fills that activate in range regime
Triple-Layer Kalman Glow: Three stacked plots at widths 9, 5, and 2 with decreasing transparency create a neon glow shadow effect on the Kalman line
Gradient Core Fills: 6-argument fill() between Kalman and candle mid-body, transparent at the Kalman line and saturated at the body — colored by confirmed regime
K-Velocity Dots: Pulsing circles on the trail during high-velocity trend bars, intensity scales with normalized velocity score
Regime Transition Circles: Circle marker fires at every confirmed regime change — immediate visual alert to state transitions
Bull/Bear Trend Start Arrows: Triangle up/down plotshape fires at the exact bar where both Kalman direction and envelope breach first agree
Trend End Marker: X marker fires when the trending regime ends, helping traders tighten stops or close positions
Kalman Flip Labels: K▲ / K▼ labels placed below/above the Supertrend level when the Kalman bias flips direction
Envelope Squeeze Marker: Golden diamond when envelope width drops below 80% of its recent SMA — flags compression before potential breakout
Gradient Bar Coloring: Bars saturate based on distance from Kalman within envelope range, fading to neutral in range-bound conditions
10-Row Dashboard: Regime state, K-Trend direction, Kalman price, upper/lower band levels, trend bar count, T-Strength %, K-Velocity %, volatility state
Input Parameters
Kalman Filter:
Alpha (Smoothing): Controls base noise level — lower values produce a smoother, higher-lag filter (default 0.01)
Beta (Adapt Rate): Controls how quickly error variance recovers after a large miss — higher values make the filter adapt faster (default 0.10)
Period: Normalises the gain magnitude — acts as a scaling factor on both noise and beta (default 77)
Supertrend:
ST Factor: ATR multiplier for the ratchet bands around the Kalman value (default 0.7)
ST ATR Length: ATR lookback for the Supertrend band calculation (default 7)
Volatility Envelope:
Envelope WMA Length: Lookback for the WMA of high-low range (default 200)
Envelope Deviation: Multiplier on the WMA to set envelope half-width (default 1.2)
Visuals:
Toggles for Supertrend line, envelope bands, gradient fills, Kalman glow, envelope cloud, and dashboard
Bull Color (default cyan #22d3ee), Bear Color (default rose #f43f5e), Range Color (default slate #94a3b8)
How to Use This Indicator
Primary Setup — Trend Confirmation Entry:
Wait for a trend start arrow (triangle up or down) to fire. This marks the bar where the Kalman Supertrend direction and the envelope breach state first agree. Enter in the arrow direction. Trail your stop below the Kalman line for longs or above it for shorts. Exit on a Trend End X marker or when the K▲/K▼ flip label fires against your position.
Using K-Velocity for Sizing:
When velocity dots are dense and bright, momentum is expanding — the trending move is accelerating. When dots thin out or disappear, momentum is fading even if the regime has not changed yet. Reduce size on fade or tighten stops before the trend end marker appears.
Squeeze Setup:
When the golden diamond squeeze marker fires, the envelope is compressing. Wait for price to break the envelope band in either direction. If a trend start arrow follows within the next few bars, this is a high-probability breakout entry aligned with both volatility expansion and regime confirmation.
Reading the Dashboard:
T-Strength above 60% indicates a mature, sustained trend. Values below 30% indicate the regime state is new or unstable — the trend is young and position sizing should reflect that uncertainty.
Indicator Limitations
The Kalman filter's gain is bounded by the alpha and beta parameters. Very low alpha values may make the filter too sluggish to capture short, sharp reversal moves before the ratchet trail catches them
The envelope breach condition for regime confirmation means the indicator will not register a trend until price has already moved far enough from the Kalman center to exit the band — entries will not be at the very start of a move
On instruments with consistently narrow true range (low-liquidity futures, off-hours sessions), the WMA envelope may be so tight that price is rarely inside the band, causing permanent range state classification
The Kalman filter uses close-to-close data and has no concept of intrabar price action; on daily charts, a spike high that closes near the open may produce a different Kalman trajectory than on a lower timeframe
Trend Strength is a rolling 50-bar measure. On very fast timeframes, 50 bars may represent only minutes, making the percentage less meaningful as a maturity gauge
Originality Statement
This indicator is original in its application of a Kalman filter as the supertrend base, the dual-gate regime confirmation system, and the K-velocity visual intensity layer. The publication is justified because:
Applying the Supertrend ratchet to a Kalman-filtered price rather than raw hl2 produces direction changes that are measurably more stable — the Kalman pre-filters noise that would otherwise cause excessive band crossings
The dual-gate regime system (Kalman direction AND envelope breach must agree) produces a stricter trending classification than any single-condition approach, reducing false trend readings in sideways conditions
The K-velocity normalization layer embeds a momentum acceleration measure directly into the trail visualization without requiring a separate panel, communicating both direction and rate-of-change simultaneously
The envelope squeeze detection integrated with trend start arrows identifies the specific condition where compressed volatility resolves into a confirmed regime shift — a novel combination for a Kalman-based system
The Trend Strength rolling percentage provides a trend maturity measure that distinguishes freshly flipped regimes from mature, sustained trends, enabling differentiated position sizing without a separate indicator
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Statistical Zone Engine [JOAT]Statistical Zone Engine
Introduction
Statistical Zone Engine is an open-source overlay indicator that builds pivot-cluster support and resistance zones with walk-forward statistical scoring. Each zone is backed by a full expected value computation: the indicator counts historical touches and bounces from the zone's price range over a configurable lookback, computes a win rate, and derives an EV score in units of R. Zones are tiered into four strength categories — Weak, Moderate, Strong, and Institutional — based on their live touch count, with border thickness and fill opacity scaling proportionally to the EV and tier. Labels display R:R, win rate, EV, and touch count, all updated live each bar.
The core problem this indicator solves is that conventional support and resistance drawing tools are entirely qualitative — the trader decides what is significant by eye. The SZE replaces that subjective judgment with a quantitative framework: zone strength is computed from actual price behavior over the lookback window, not from the visual prominence of the swing. A zone that has been tested eight times with seven bounces carries an objectively different statistical weight from one that was tested twice with one bounce, and the SZE communicates that difference through its tier system, border rendering, and live EV label. Cluster merging prevents adjacent pivots at nearly the same price from spawning overlapping zones that would misrepresent true strength.
Core Concepts
1. Pivot Cluster Zones
The indicator uses ta.pivothigh and ta.pivotlow with a configurable swing length. When a new pivot high is confirmed and no existing resistance zone is within ATR * clusterTol of the pivot price, a new zone is created. The cluster merge check prevents nearby pivots from generating duplicate zones at the same structural level — if a zone already exists within the tolerance radius, no new zone is spawned. This means zones represent genuinely distinct price levels, not just the most recent pivot above an existing zone.
2. Walk-Forward Expected Value Computation
For each new zone, the indicator scans the prior lookback bars and counts every bar where the high-low range overlapped with the zone. For each touch, it checks whether the close exited the far side of the zone — if so, it counts as a bounce. Win rate = bounces / touches. EV = winRate * tpRR - (1 - winRate) * slRR. A positive EV means the zone has historically resolved in the bounce direction more often than not, weighted by the configured R:R ratio.
3. Four-Tier Strength System
Zone tier is determined by live touch count:
Weak: 1-2 touches — thin border (width 1), low opacity fill
Moderate: 3 touches — medium border (width 1), moderate opacity fill
Strong: 4-5 touches — thicker border (width 2), more opaque fill
Institutional: 6+ touches — widest border (width 3), most opaque fill
Both the border width and the border transparency scale with tier, producing a visual system where the most historically significant zones dominate the chart. The fill opacity also scales with EV — zones with positive EV are more opaque, zones with negative EV are more transparent.
4. Live Label Updates
Each zone carries a label at its right edge displaying: type (RES/SUP), tier name, touch count, win rate percentage, and EV in R units. The label is recalculated and updated every bar when price is inside the zone, ensuring the statistics reflect current behavior. The label text color also scales with tier — more significant zones use brighter text.
5. Sweep Detection
When price closes fully through a zone boundary — above the top for resistance, below the bottom for support — the zone is marked as mitigated. If volume exceeds 1.4x the SMA(20) at the mitigation bar, a BREAK label fires above or below the zone. The total sweep count accumulates in the dashboard. After a break, zone fill fades to near-transparent, clearly communicating that the level has been closed through.
Features
Pivot-Cluster Zone Detection: Swing-pivot based zone creation with ATR-cluster merge deduplication — nearby pivots do not spawn overlapping zones
Walk-Forward EV Computation: Historical touch/bounce counting over configurable lookback produces win rate and R-unit EV scores for each zone
Four-Tier Strength System: Weak / Moderate / Strong / Institutional tiers based on touch count — border width and opacity scale with tier
EV-Scaled Fill Opacity: Positive EV zones are more opaque, negative EV zones are more transparent — fill intensity communicates statistical quality
Live Label Updates: Type, tier, touch count, win rate %, and EV in R units update every bar when price is inside the zone
Sweep Detection with Volume Filter: BREAK label fires on zone close-through when volume exceeds 1.4x SMA(20)
Post-Break Zone Fade: Broken zones fade visually, clearly delineating active versus mitigated levels
Proximity Markers: Diamond plotchar fires when price first enters a zone neighborhood
Min Touches Filter: Only zones with at least the configured minimum historical touches are displayed, eliminating freshly-formed single-touch zones
Zone Trim Management: Oldest zones are removed when arrays exceed the maximum zone count, keeping memory bounded
9-Row Dashboard: Active resistance and support zone counts, near-zone states, total sweep count, TP and SL R:R ratios, ATR
4 Alertconditions: Zone entry for resistance and support, new zone creation for both sides
Input Parameters
Zone Detection:
Swing Length: Pivot confirmation lookback period — higher values detect fewer, more significant pivots (default 10)
Cluster ATR Tolerance: Pivots within ATR * this of an existing zone are merged rather than spawning a new zone (default 0.4)
Zone ATR Width: Half the zone height as an ATR multiple — controls vertical thickness (default 0.35)
Max Active Zones: Maximum concurrent zones per direction before oldest are trimmed (default 12)
Min Touches To Show: Minimum historical touches required to display a zone (default 2)
Statistics:
EV Lookback (bars): Historical bar window for touch/bounce counting (default 200)
TP R:R Ratio: Take-profit distance in R units used for EV calculation (default 2.0)
SL R:R Ratio: Stop-loss distance in R units used for EV calculation (default 1.0)
Visuals:
Toggles for zone labels, sweep labels, and dashboard
Resistance Color (default orange #f97316), Support Color (default sky blue #38bdf8)
How to Use This Indicator
Primary Setup — Statistical Zone Entry:
Look for Institutional or Strong zones with positive EV — these are the levels with the longest bounce history weighted by your R:R parameters. When price enters a zone, the live label shows the current win rate. Enter at the zone edge with a stop beyond the far edge and a target at your TP R:R ratio from entry.
EV as a Selection Filter:
Multiple zones may be on the chart simultaneously. Prioritize zones with positive EV labels (e.g., EV: 1.25R) over zones with negative EV. A zone with 4 touches and 75% win rate at 2R:1R produces an EV of +1.25R per trade — objectively worth trading. A zone with 3 touches and 33% win rate at the same R:R produces EV of -0.33R — not worth trading regardless of how prominent it looks.
Using the Sweep Count:
The total sweep count on the dashboard accumulates every time a zone break is detected with high-volume momentum. Rising sweep counts in one direction indicate the market is consistently breaking through levels on that side — a sign of trending pressure rather than range behavior. Adjust bias accordingly.
Cluster Merge and Fresh Zones:
When a new pivot forms near an existing zone and is merged rather than spawning a new zone, the existing zone's historical statistics remain unchanged. A fresh zone with no historical data will show EV close to 0 — treat these as unproven until more touches accumulate.
Indicator Limitations
EV computation scans up to the full lookback on every qualifying pivot — on very long lookback settings and active pivot instruments, this can increase calculation time
The walk-forward EV uses the same zone size (ATR * width at creation time) for historical counting. If ATR changes significantly between creation time and the historical scan, the touch count may include bars where the equivalent zone boundaries would have been different
Cluster merging uses the current ATR at detection time. In periods of sharply rising or falling ATR, two zones that appear to merge at one ATR level may have been distinct at a different level, potentially underrepresenting zone density
The touch count displayed on the label is the live count updated each bar. The historical bounce count used for EV is computed at creation time and is not re-scanned dynamically — the label win rate reflects creation-time statistics
The minimum touches filter removes zones with fewer historical touches than the threshold. On fresh instruments or small lookbacks, most zones may be filtered out, especially on less-traded timeframes
Originality Statement
This indicator is original in its walk-forward EV scoring framework, four-tier visual strength system driven by live touch counts, and the cluster merging deduplication approach. The publication is justified because:
Walk-forward EV computation in R units provides a quantitative quality signal not found in standard support/resistance tools — each zone is backed by a historically derived expected value, enabling objective zone selection
The four-tier visual system (border width and opacity scaling with tier and EV) embeds the statistical quality directly into the zone appearance, eliminating the need to read labels to gauge significance
ATR-cluster merge deduplication prevents pivot-dense markets from generating overlapping zones at the same structural level, producing a cleaner, more meaningful map than raw pivot-based zone tools
Live label updates during zone interaction show the evolving win rate and EV as each new touch is counted, providing real-time statistical feedback not present in static zone indicators
The post-break fade combined with the total sweep count dashboard provides a structural memory of how many levels have been invalidated, enabling a directional bias gauge derived from zone lifecycle data
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Liquidity Architecture Scanner [JOAT]Liquidity Architecture Scanner
Introduction
Liquidity Architecture Scanner is an open-source overlay indicator that maps equal high and equal low liquidity pools — price levels where two consecutive highs or lows are within an adaptive tolerance of each other — into persistent box-based zones with session-colored borders, RSI-strength opacity, intrazone volume POC lines computed from lower-timeframe data, retest tracking with progressive border brightening, and volume-filtered sweep labels. The system continuously monitors active zones for retests and sweeps, maintains live sweep counts on the dashboard, and applies a gradient barcolor that deepens when price is inside or approaching a zone.
The core problem this indicator addresses is that equal highs and equal lows represent clusters of resting limit orders placed by traders defending the same price twice — the institutional order flow concept of liquidity pools. When price sweeps through these levels, it typically triggers those orders and may reverse sharply. Standard equal-level detection tools use a fixed pip tolerance, which breaks down across instruments and timeframes. The LAS uses an EMA-normalized adaptive tolerance derived from recent bar-to-bar variance, making the detection self-calibrating. Layering a RSI filter ensures the equal high is detected above a bull momentum threshold and the equal low is detected below a bear threshold — filtering out levels formed in the wrong momentum context.
Core Concepts
1. Adaptive Tolerance
The tolerance level that determines whether two consecutive highs (or lows) are "equal" is computed from the EMA of average bar-to-bar absolute variance: barVar = avg(|high - high |, |low - low |), smoothed over the configurable EMA length. This variance-normalized tolerance automatically tightens in low-volatility environments and widens in high-volatility ones, ensuring equal-level detection remains meaningful across instruments, timeframes, and market regimes without manual parameter adjustment.
2. RSI Momentum Filter
An equal high only registers if the RSI is above the bull threshold (default 55) at detection time. An equal low only registers if the RSI is below the bear threshold (default 45). This dual-gate ensures that EQH zones are detected during upside momentum — when resting sell orders above the market are the relevant liquidity pool — and EQL zones are detected during downside momentum. Equal highs formed with a weak RSI below 55 represent a different structural context and are excluded.
3. Lower-Timeframe Volume POC
The indicator requests intrabar close and volume data from a lower timeframe via request.security_lower_tf(). For each zone's price range, the algorithm distributes intrabar volume into bins across the zone's height and identifies the bin with the highest cumulative volume — the Point of Control (POC). A dotted line is drawn at the POC price inside each zone box. This provides a volume-based reference level within the zone: the price at which the most trading activity occurred inside the equal-level band. Traders can use the POC as a more precise entry or target reference than the zone midpoint.
4. Session-Colored Borders and RSI Opacity
Each zone's birth session is stored and used to color its border: London zones receive a blue border (#60a5fa), NY zones a pink border (#f472b6), Asia zones a green border (#34d399), and off-hours zones a lighter gray. The zone fill opacity is derived from the RSI distance from the relevant threshold at the time of detection: the farther RSI is from the threshold, the more opaque the fill, communicating higher-conviction detections with stronger visual presence.
5. Retest Tracking and Sweep Logic
Each bar, the indicator checks whether price has entered a zone it was previously outside of. On first retest entry, the border width and brightness increase. On subsequent retests, the border continues brightening and a "RETEST n" label fires at the zone edge. When price closes fully through a zone — above the top for EQH, below the bottom for EQL — the zone is marked as swept, the sweep counter increments, and optionally a "SWEPT" label appears (subject to a volume filter that requires volume > SMA(20) * 1.3 for label display).
Features
Adaptive EMA-Normalized Tolerance: Equal-level detection threshold adjusts automatically to recent bar-to-bar variance, remaining calibrated across all instruments and timeframes
RSI Momentum Gate: EQH only detected when RSI is above bull threshold; EQL only detected when RSI is below bear threshold — filters out levels formed in wrong momentum context
Lower-TF Volume POC: Intrabar volume profiling using request.security_lower_tf() identifies the highest-volume price bin inside each zone
Box-Based Zone Rendering: Solid box fills with configurable session-colored borders and RSI-strength opacity
Session-Colored Borders: London blue / NY pink / Asia green — session context encoded directly in the zone visual
RSI-Strength Opacity: Fill transparency inversely proportional to RSI distance from threshold — stronger momentum detections are more visually prominent
Zone Midpoint Reference Line: Dotted midpoint line inside each zone for quick visual reference of the level center
Retest Tracking: Progressive border brightening and border width increase with each confirmed retest entry; RETEST n label fires on each new entry
Volume-Filtered Sweep Labels: SWEPT labels appear when price closes through a zone, optionally filtered to only show when volume exceeds 1.3x the SMA(20)
Formation Signals: Small EQH/EQL labels fire at the bar of each confirmed zone detection
Proximity Approach Markers: Diamond markers when price first enters within ATR * proximity buffer of a zone edge
Gradient Bar Coloring: Bars deepen in zone color when inside a zone, lighter when approaching, trend-tinted otherwise
Zone Expiry: Zones older than the configurable max age are automatically removed
10-Row Dashboard: Liquidity trend direction, active EQH/EQL counts, sweep counts per side, in-zone state, session, RSI, adaptive tolerance level
6 Alertconditions: Zone formation, zone entry, and liquidity trend flip alerts for both EQH and EQL
Input Parameters
Equal Levels:
EQ Tolerance Multiplier: Scales the adaptive tolerance — higher values allow wider "equal" windows (default 0.05)
Tolerance EMA Length: Smoothing period for the variance normalization EMA (default 500)
RSI Length: RSI lookback for the momentum filter (default 14)
RSI Bull Threshold: Minimum RSI for EQH detection (default 55)
RSI Bear Threshold: Maximum RSI for EQL detection (default 45)
Zone Max Age (bars): Zones older than this are deleted (default 300)
Proximity Buffer (ATR): Approach detection buffer as ATR multiple (default 0.5)
Volume Profile:
Lower TF (Volume): Intrabar timeframe for volume profiling — must be below the chart timeframe (default 3)
POC Bin Count: Number of price bins in the volume profile (default 7)
Visuals:
Toggles for POC line, zone midline, labels, formation signals, sweep labels, sweep volume filter, and dashboard
EQH Color (default violet #a78bfa), EQL Color (default teal #34d399)
How to Use This Indicator
Primary Setup — Liquidity Sweep Entry:
When price sweeps through a zone and a SWEPT label fires, watch for a reversal candle on a lower timeframe. The sweep has collected the resting orders; the price may reverse sharply. Enter on the first opposing candle after the sweep close with a stop beyond the swept level.
Retest Entry:
When price returns to a zone from the opposite direction after having moved away, watch for the RETEST label. Zones that have survived multiple retests (bright borders, high retest count) with no sweep are demonstrating price respect. Enter at the zone edge on the retest candle, stop beyond the far edge.
POC as Precision Reference:
The POC line marks where the most intrabar volume concentrated inside the zone. If price is approaching from below an EQL zone, the POC is a more precise target than the zone top. If price is inside the zone and stalling at the POC, this may be the key inflection level.
Liquidity Trend:
The dashboard Liq Trend shows BULLISH after an EQH sweep (sell-side liquidity was taken, likely pushing price up) and BEARISH after an EQL sweep (buy-side liquidity taken). Using this as a directional bias filter on lower-timeframe setups adds context from the liquidity architecture.
Indicator Limitations
Equal level detection requires consecutive bars with nearly identical highs or lows. In fast, impulsive markets where equal highs/lows rarely form, zone detection frequency will be low regardless of tolerance setting
Lower-timeframe volume profiling adds security calls per bar. On very high-frequency timeframes or instruments with large lower-TF arrays, this may slow indicator rendering
The RSI filter will prevent zone detection in any momentum condition that does not meet the threshold, which means zones formed during neutral RSI readings (45-55) are not mapped — these may still represent meaningful liquidity
Sweep detection requires a confirmed close through the zone boundary. Intrabar wicks that sweep through a level but close back inside will not register as a sweep, despite triggering orders in live trading
Zone expiry by age removes all zones older than the max age parameter regardless of whether they remain structurally significant — very long-lived confluence levels may be deleted in trend-persistent market conditions
Originality Statement
This indicator is original in its adaptive EMA-normalized tolerance, RSI-gated liquidity detection, lower-timeframe volume POC integration, and progressive retest border feedback system. The publication is justified because:
EMA-normalized adaptive tolerance makes equal-level detection self-calibrating across instruments and timeframes without manual adjustment — a significant improvement over fixed-pip tolerance approaches
RSI-gated zone detection filters equal levels by momentum context, ensuring only liquidity pools formed in the correct directional bias are mapped — a filtering mechanism not present in standard equal-level tools
Lower-timeframe volume POC computation inside each zone adds a volume-based precision reference that identifies the intrazone price with the highest transaction concentration — combining liquidity structure with volume analysis in a single overlay
Progressive border brightening as a retest counter provides an ever-updating interaction history on the zone visual itself, eliminating the need for a separate touch-count display
The sweep counter and liquidity trend directional state provide a market microstructure bias indicator derived purely from liquidity pool dynamics, without using any traditional trend filter
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Institutional Zone Mapper [JOAT]Institutional Zone Mapper
Introduction
Institutional Zone Mapper is an open-source overlay indicator that detects swing-pivot order blocks — the last impulsive candle preceding a significant price displacement — and renders them as persistent box-based zones with session-color-coded borders, a four-component strength score from 0 to 10, touch-count tracking, and a configurable mitigation lifecycle. The indicator identifies the candle immediately before a confirmed swing pivot, verifies that a meaningful ATR-scaled displacement followed, and places a zone around that candle's midpoint. Zones are born with a strength score derived from displacement magnitude, session context, age, and zone height — allowing traders to instantly distinguish premium, high-conviction zones from weak, low-probability ones.
The core problem this indicator solves is that most order block tools place zones mechanically without quality filtering, flooding the chart with dozens of marginal levels that have little predictive value. The IZM's four-component scoring system ensures only zones with meaningful institutional characteristics survive on the chart. A minimum strength filter removes everything below the user-defined threshold, and the mitigation system automatically removes, stops extending, or fades zones that have been closed through — maintaining a clean, current map of active supply and demand.
Core Concepts
1. Swing Pivot Detection
The indicator uses ta.pivothigh and ta.pivotlow with a configurable swing length. A pivot high confirmed at bar_index means a price high existed swingLen bars ago that was higher than the swingLen bars on either side of it. When a pivot low is confirmed, the indicator looks back through a configurable candle lookback window to find the last bearish close candle before that pivot — this is the bullish order block candidate. The displacement check ensures the move from that candle to the pivot was at least ATR * dispMult, filtering out low-momentum pivots that are unlikely to represent genuine institutional accumulation.
2. Four-Component Strength Scoring
Each zone receives a score between 0 and 10 from four additive components:
Displacement Score (0-3): The ratio of the displacement to ATR is binned — larger moves score higher, capped at 3.0
Session Score (0-2): London and NY session zones score 2.0, Asia zones score 1.0, off-hours score 0.5
Age Score (0-2): Freshly formed zones (under 30 bars) score 2.0; zones over 150 bars old score 0.5
Zone Height Score (0-3): Zones whose ATR-normalized height falls in a sweet spot (0.5 to 2x ATR) score 3.0 — too tight or too wide zones score lower
The minimum strength filter (default 3.0/10) removes zones that fail to meet the threshold, keeping the chart uncluttered.
3. Session Classification and Color-Coded Borders
Each zone's birth session is stored and used to color its border: London zones receive a blue border (#60a5fa), NY zones a pink border (#f472b6), Asia zones a green border (#34d399), and off-hours zones a gray border (#64748b). The session is detected from the candle's timestamp using UTC hours, mapping to standard London (08:00-17:00 UTC), New York (13:00-22:00 UTC), and Asia (00:00-09:00 UTC) windows. This allows traders to immediately gauge which market session was active when institutional activity was registered.
4. Mitigation Lifecycle
When price closes through a zone — below the bottom of a bull OB, or above the top of a bear OB — the zone is considered mitigated. Three mitigation behaviors are available:
Delete: Zone is removed entirely from the chart
Stop Extending: Zone stops extending to the right and fades to near-transparent (zone box is fixed at the current bar)
Keep: Zone remains but fades visually to indicate mitigation
Touch counting is separate from mitigation — each confirmed close inside the zone increments the touch count, and the border progressively darkens with each retest to communicate how many times price has interacted with the level.
5. Proximity Detection
A configurable ATR buffer defines a proximity zone above each bull OB and below each bear OB. When price enters this buffer without yet entering the zone, the dashboard shows "NEAR" and proximity diamonds appear on the chart. This gives an early warning that price is approaching an active level before the actual retest occurs.
IZM showing the proximity diamond markers appearing as price approaches a bull OB from above, the info label updating with live age and touch count, and a faded zone after mitigation with the Stop Extending behavior active
Features
Swing Pivot Order Block Detection: Locates the last impulsive candle before a confirmed swing high or low with ATR-scaled displacement verification
Four-Component Strength Score (0-10): Displacement, session, age, and zone height combine into a single quality score — only zones above the minimum threshold are displayed
Session-Colored Borders: London blue / NY pink / Asia green / Off gray borders identify which session birthed each zone at a glance
Box-Based Zone Rendering: Solid box fills with session-colored borders — substantially more visible than linefill-based zone systems
Touch Count Darkening: Zone border opacity increases with each confirmed retest, visually communicating how frequently price has revisited the level
Three Mitigation Behaviors: Keep, Stop Extending, or Delete — each with optional fade-on-mitigation toggle
Proximity Markers and Dashboard State: Diamond markers and NEAR/ACTIVE dashboard state when price enters or approaches active zones
Info Labels: Dynamic text labels at zone right edge showing type, strength score, session, age in bars, zone height in pips/ticks, and touch count
Position Filter: Optional toggle to show only bull OBs below current price and bear OBs above, removing zones that are contextually irrelevant to the current price location
Max Active OBs: Oldest zones are trimmed when the array exceeds the configured maximum, keeping memory usage bounded
9-Row Dashboard: Active bull/bear OB counts, touch states (ACTIVE / NEAR), current session, ATR, minimum displacement distance, minimum strength threshold
6 Alertconditions: Zone entry, proximity approach, and new zone creation alerts for both bull and bear sides
Input Parameters
Order Block Detection:
Swing Length: Pivot confirmation lookback — higher values detect more significant, less frequent pivots (default 7)
OB Candle Lookback: How many bars back to search for the qualifying order block candle (default 20)
Displacement ATR Mult: Minimum displacement from OB candle to pivot, as a multiple of ATR (default 1.3)
Max Active OBs / Side: Maximum concurrent zones per direction before oldest are trimmed (default 5)
Min Strength Filter: Minimum strength score required to display a zone (default 3.0/10)
Zone Settings:
Zone ATR Width: Half the zone height expressed as ATR multiplier — sets the vertical thickness of zones (default 0.75)
Proximity Buffer (ATR): Distance above/below zone edge that activates the NEAR state (default 0.25)
Position Filter: When enabled, only shows zones on the correct side of current price (default off)
Mitigation:
On Mitigation: Keep / Stop Extending / Delete (default Stop Extending)
Fade On Mitigation: Whether to reduce zone opacity when mitigated (default on)
How to Use This Indicator
Primary Setup — Zone Retest Entry:
Look for price returning to an active zone (box fill area) after displacement away from it. When the dashboard shows ACTIVE and the zone has a high strength score (7+), this represents a high-quality retest opportunity. Enter in the zone's direction with a stop beyond the opposite edge of the box.
Reading the Strength Score:
Zones scoring 7-10 should be treated as premium levels — the displacement was large, the session was active, the zone is fresh, and the height is optimal. Zones scoring 3-5 are marginal. Use the minimum filter to remove low-quality zones entirely if the chart becomes cluttered.
Session Context:
London and NY zones (blue and pink borders) represent the most liquid, highest-participation session activity. An Asia-born zone that has not been retested by London or NY open is lower priority. A NY-born zone returning to price during the following London session is a high-context setup.
Proximity Workflow:
When a proximity diamond appears, price is approaching but has not entered a zone. This is the time to prepare your entry plan — set alerts using the Approaching alerts, watch for confirmation signals on a lower timeframe, and be ready when the NEAR state transitions to ACTIVE.
Indicator Limitations
Order block detection requires a confirmed swing pivot — pivot confirmation in Pine Script v6 is delayed by swingLen bars, meaning zones are created with a bar offset relative to the actual pivot price action
The displacement check uses the current-bar ATR, not the ATR at the time the zone was created — on rapidly expanding volatility environments this can temporarily raise the displacement threshold and filter out recent zones
The four-component scoring system uses static bin boundaries. Markets with unusually large or small ATR ranges may require tuning the displacement multiplier and zone width parameters to produce well-calibrated scores
Touch count increments on any confirmed close inside the zone, including the candle that originally created it. The first touch is therefore always the creation bar itself; meaningful retest context begins at touch count 2+
The mitigation logic detects a close through the zone edge, not an intrabar wick. Strong impulse candles that close back inside the zone will not trigger mitigation despite briefly penetrating the level
Originality Statement
This indicator is original in its four-component strength scoring system, session-colored border architecture, and touch-count border darkening feedback mechanism. The publication is justified because:
The four-component strength score (displacement, session, age, zone height) produces a quantitative quality ranking that is not present in standard order block tools, allowing the user to immediately identify premium versus marginal zones without manual evaluation
Session-colored borders encode institutional session context directly into the zone visual without requiring the user to maintain a separate session indicator, creating a self-contained contextual map
Touch-count border darkening provides a progressive visual feedback loop that communicates zone interaction history — the darker the border, the more times price has revisited the level
The proximity buffer and NEAR/ACTIVE dashboard state create a two-stage alert system that gives traders preparation time before an actual zone retest, reducing late entries
The mitigation lifecycle with fade-on-mitigation is a novel approach to zone management that preserves chart history while clearly delineating which zones remain actionable
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Adaptive Pressure Trail [JOAT]Adaptive Pressure Trail
Introduction
Adaptive Pressure Trail is an open-source overlay indicator that combines an HMA-based adaptive ratchet trail with a custom volume-weighted Money Flow Index to classify bars into bull pressure, bear pressure, and neutral states. The system uses a three-layer visual architecture — an outer volatility cloud, an inner ratchet band fill, and a core gradient pressure fill between the HMA baseline and candle mid-body — to create a clear, spatially organized picture of momentum and direction on any chart. Volatility squeeze detection identifies compression phases before potential breakouts, and high-confidence signals fire when a squeeze releases simultaneously with pressure alignment.
The core problem this indicator solves is that most trail-based systems are either too reactive (flipping constantly on noise) or too slow (missing meaningful moves). The HMA ratchet addresses this: the upper band only falls and the lower band only rises after a direction flip, preventing whipsaw while remaining responsive when momentum is genuine. Layering a volume-weighted MFI filter on top means a directional trail alone is not sufficient — volume-backed money flow must confirm the move before the indicator reports active pressure.
Core Concepts
1. HMA Adaptive Ratchet Trail
The trail baseline is computed using a Hull Moving Average, which provides low lag while remaining smooth. ATR-scaled upper and lower bands are applied around the HMA. The ratchet rule prevents band noise: the upper band can only move downward (or reset when price closes above it), and the lower band can only move upward (or reset when price closes below it). Direction flips when price closes through the active band. This creates a one-directional drift that is far more stable than a raw crossover trail:
The trail direction variable persists with var and updates each bar. Direction == 1 means the lower band is the active trail (bullish), direction == -1 means the upper band is the active trail (bearish).
2. Custom Volume-Weighted MFI
Rather than using a standard price-only momentum oscillator, the pressure engine uses a custom volume-weighted Money Flow Index. Positive flow is volume multiplied by HLC3 on bars where HLC3 increased; negative flow is volume multiplied by HLC3 on bars where HLC3 decreased. These are summed over the MFI length and converted to a 0-100 scale using the RSI formula. The result is smoothed with an HMA for responsiveness. This produces a momentum measure that is inherently volume-weighted — large-volume moves carry more influence than low-volume drift. The MFI is further smoothed to distinguish sustained pressure from transient spikes.
3. Pressure Regime Classification
Bull pressure is active when the trail direction is bullish AND the smoothed MFI is above the bull threshold. Bear pressure is active when the trail direction is bearish AND MFI is below the bear threshold. Neutral is everything else. This dual-condition structure means you need both directional commitment from the ratchet trail AND volume-backed momentum to enter a pressure state. Either condition alone is insufficient.
A rolling 50-bar history tracks what percentage of recent bars were in an active pressure state, producing a Pressure Strength percentage that indicates whether the current regime has been sustained or is a brief spike.
4. Squeeze Detection
Band width — the distance between the upper and lower ratchet bands — is compared to its own SMA. When band width drops below 72% of its recent average, the market is compressing. A squeeze start fires a golden diamond marker at the trail level. A squeeze release fires a larger circle marker. The high-confidence signal fires when a squeeze release coincides with an active pressure state, identifying the highest-probability setups where compressed volatility breaks out in a confirmed directional context.
5. Three-Layer Visual Architecture
The chart renders three nested visual layers:
Outer Cloud: The ATR envelope (cloudMult * ATR from HMA center) filled with a very transparent directional color — gives spatial context to where price is within the volatility range
Inner Band Fill: The ratchet upper and lower bands filled with medium transparency — shows the active directional channel
Core Pressure Fill: A gradient fill between the HMA baseline and the candle mid-body — transparent at the HMA, saturated at the body, colored by pressure state
The trail line itself uses three stacked plots at widths 10, 5, and 2 to create a neon glow shadow effect. Bar coloring uses color.from_gradient driven by MFI intensity, producing increasingly saturated candles as momentum builds.
Features
HMA Ratchet Trail with Triple-Layer Glow: Direction-persistent adaptive trail rendered as a neon glow (widths 10/5/2) using the bullish lime or bearish fuchsia color
Outer ATR Volatility Cloud: Wide ATR envelope filled directionally, providing spatial context at a glance
Inner Ratchet Band Fill: Gradient-filled active channel between upper and lower ratchet bands
Core Pressure Gradient: Background-to-body gradient between HMA and mid-body, colored by current pressure state
HMA Skeleton Reference: Subtle neutral line showing the raw HMA baseline beneath all fills
Volatility Squeeze Markers: Golden diamonds during compression, circle flash on breakout
High-Confidence Signal: Starred HC LONG / HC SHORT labels when squeeze releases into confirmed pressure alignment — the highest-quality setup the system produces
Volume Impulse Labels: When a strong directional candle exceeds the volume threshold, a label shows the volume ratio (e.g., 2.1x vol) at the bar
MFI Cross Markers: Small triangles on the trail when MFI crosses the 50 level, marking momentum regime shifts
TP Signals: Labeled plotshapes when MFI reaches overbought/oversold extremes in the trail direction
Pressure Strength Percentage: Rolling 50-bar % of time spent in active pressure — distinguishes sustained trends from brief spikes
Gradient Bar Coloring: color.from_gradient driven by MFI intensity — bars saturate as momentum builds and fade as it weakens
11-Row Dashboard: Pressure state, trail direction, MFI reading, pressure score, pressure strength %, volatility state, band width, trend bars, trail price, ATR
Input Parameters
Adaptive Trail:
Trail HMA Length: Period for the HMA baseline (default 21)
Trail ATR Multiplier: Width of inner ratchet bands (default 1.8)
Trail ATR Length: ATR lookback for band calculation (default 14)
Outer Cloud ATR Width: Outer envelope width multiplier (default 3.2)
Squeeze Reference Bars: SMA period for band-width baseline (default 20)
Pressure Filter:
MFI Length: Volume-weighted money flow lookback (default 14)
MFI Smoothing: HMA smoothing on raw MFI (default 7)
MFI Bull/Bear Thresholds: Activation levels for pressure states (default 62/38)
Signals:
TP Overbought/Oversold Levels: MFI levels that trigger TP signals (default 78/22)
Impulse Volume Multiplier: Volume multiple above SMA required for impulse label (default 1.3)
Visuals:
Toggles for entry signals, TP signals, glow, cloud, pressure fill, squeeze markers, and dashboard
Bull Color (default lime #a3e635), Bear Color (default fuchsia #e879f9), Neutral Color (default slate #94a3b8)
How to Use This Indicator
Primary Setup — Trend Following with Pressure Confirmation:
Look for the trail to flip direction (circle marker on trail). Wait for MFI to cross the bull or bear threshold, confirming the pressure state activates. Enter in the trail direction once the pressure fill color saturates. Trail your stop at the active trail line. Exit on a TP signal or when the pressure state deactivates.
High-Confidence Setup:
Wait for squeeze markers (golden diamonds) to appear, indicating compression. When the squeeze releases (larger circle flash) and the pressure state is simultaneously active, the HC LONG or HC SHORT label fires. These are the setups where compressed volatility breaks out with momentum behind it.
Filtering with Pressure Strength:
The dashboard Pressure Strength percentage tells you how sustained the current move has been. Values above 60% indicate a mature trend. Values below 30% indicate the pressure state is new or unstable. Adjust position sizing accordingly.
Reading Impulse Candles:
Volume impulse labels (e.g., "2.1x vol") mark bars where a strong directional move was accompanied by significantly elevated volume. These often mark the start or acceleration of a pressure phase and can serve as reference points for support/resistance.
APT dashboard showing bull pressure active, MFI at 71.2, P-Score 7.1/10, P-Strength at 64%, band width expanding after a squeeze release, and the trail at current price with ATR reference
Indicator Limitations
The ratchet trail requires a confirmed close through the active band to flip direction. On higher-timeframe charts with large candle bodies this can mean the flip is confirmed well after the actual turning point
The volume-weighted MFI requires volume data. On instruments with unreliable volume reporting (some forex pairs, synthetic indices) the pressure filter may be less meaningful than on equities or futures
Squeeze detection uses a 72% band-width threshold. In persistently low-volatility instruments this threshold may trigger too frequently; adjusting the Squeeze Reference Bars parameter can help
High-confidence signals require both a squeeze release and active pressure simultaneously. On trending markets with no compression phase, HC signals will be rare
MFI thresholds at 62/38 are defaults designed for balanced use; highly trending instruments may require raising the bull threshold and lowering the bear threshold to reduce false pressure activations
Originality Statement
This indicator is original in its combination of a ratchet-constrained HMA trail with a custom volume-weighted MFI, the three-layer nested visual system, and the squeeze-breakout confluence signal. While HMA trails and MFI oscillators exist independently, this publication is justified because:
The ratchet logic applied to HMA (rather than ATR midline or EMA) reduces lag while preventing the constant flipping common in standard trail indicators
The custom volume-weighted MFI differs from the standard MFI by using HLC3 as the price component with RSI-formula normalization, producing a smoother measure with better noise rejection
The three-layer nested fill architecture (outer cloud, inner band, core pressure gradient) provides a spatially organized visual system where the distance between layers communicates volatility context
Squeeze detection integrated with pressure confirmation for HC signals is a novel combination that identifies setups at the intersection of volatility compression and momentum alignment
The Pressure Strength rolling percentage provides a trend maturity measure not present in standard trail indicators
Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any financial instrument. Past performance of any pattern or signal does not guarantee future results. All trading involves substantial risk. Always use proper risk management and conduct your own independent analysis.
— Made with passion by officialjackofalltrades
Indicator

Vantage Protocol [JOAT]Vantage Protocol
Introduction
Vantage Protocol is an advanced open-source execution strategy that integrates regime classification, adaptive momentum filtering, volume confirmation, session timing, and ATR-based risk management into a unified NNFX-aligned trading engine. Rather than relying on a single entry signal, the strategy requires alignment across five independent subsystems — regime state, momentum direction, cumulative volume delta, volume presence, and session timing — before entering a trade. This multi-gate architecture is designed to filter out low-probability setups and only execute when multiple independent factors converge.
This strategy exists because most retail strategies fail for a predictable reason: they use one or two conditions for entry and ignore the broader market context. A moving average crossover in a choppy market produces losses. A momentum signal during a low-volume session lacks follow-through. An entry outside the active institutional window misses the liquidity needed for clean execution. Vantage Protocol addresses each of these failure modes with a dedicated subsystem, and only enters when all subsystems agree.
Important Note on Strategy Results
Backtesting results shown with this strategy are historical simulations and do not guarantee future performance. Markets change, and strategies that performed well historically may not perform well in the future. The default settings use realistic parameters: 2% of equity per trade, $100,000 initial capital, no pyramiding, and zero margin. Users should add commission and slippage appropriate for their broker and instrument in the strategy Properties dialog before evaluating results. The strategy is published with these defaults to provide a transparent starting point — users are expected to adjust parameters for their specific trading conditions.
Strategy Architecture
The strategy follows an NNFX (No Nonsense Forex) inspired architecture where each subsystem acts as an independent gate. A trade is only entered when all gates are open simultaneously.
Gate 1: Regime Engine
The regime engine determines whether the market is trending or ranging. It combines three independent measures:
H-Infinity Filter: An adaptive filter from control theory that tracks price under worst-case noise assumptions. The filter's slope determines directional bias — positive slope = bullish, negative slope = bearish
R-Squared Efficiency Gate: Measures how well price fits a linear regression. When R-squared exceeds an auto-calibrating threshold (rolling mean plus k standard deviations), the efficiency gate opens, indicating a trending market. A hysteresis band prevents flickering
Chop Score: Measures path efficiency — the ratio of net movement to total path length. High chop scores indicate choppy, non-directional markets where trend-following strategies fail
The regime is classified as trending (bullish or bearish) only when R-squared confirms efficiency AND chop score confirms directional movement. If either condition fails, the regime is classified as ranging and no entries are allowed.
bool regimeTrend = effOK and not isChoppy
int regimeBias = regimeTrend ? (hinfSlope >= 0 ? 1 : -1) : 0
Gate 2: Momentum Core
The momentum subsystem uses a Laguerre RSI processed through JMA adaptive smoothing. The Laguerre filter provides a smoother, less laggy momentum reading than standard RSI, and the JMA smoothing further reduces noise while preserving responsiveness to genuine momentum shifts.
Momentum must confirm the regime direction:
For long entries: JMA-smoothed Laguerre RSI must be above the bull threshold (default: 62)
For short entries: JMA-smoothed Laguerre RSI must be below the bear threshold (default: 38)
This prevents entries when momentum is neutral or contradicts the regime bias.
Gate 3: Volume Filter (CVD)
Cumulative Volume Delta tracks net buying versus selling pressure. The strategy requires the CVD slope (smoothed with an EMA) to confirm the trade direction:
For long entries: CVD slope must be positive (net buying pressure increasing)
For short entries: CVD slope must be negative (net selling pressure increasing)
Additionally, the current bar's volume must exceed a minimum ratio relative to the 50-bar average (default: 0.7x). This filters out entries during thin-liquidity periods where price moves lack conviction and slippage risk is elevated.
Gate 4: Session Filter
An optional session window filter restricts entries to a configurable time window (default: 0200-1200 New York time). This aligns trading with the London and New York sessions where institutional liquidity is deepest. Entries outside this window are blocked because low-liquidity sessions produce unreliable price action and wider spreads.
Gate 5: Cooldown
After any exit (whether by stop loss, take profit, or regime exit), a configurable cooldown period (default: 5 bars) must pass before a new entry is allowed. This prevents revenge trading and allows the market to establish a new setup after a position closes.
Entry and Exit Logic
Entry Conditions:
All five gates must be open simultaneously, and the strategy must be flat (no existing position):
bool longSetup = regimeBias == 1 and momBull and cvdBull and volOK and sessOK and cooldownOK
bool shortSetup = regimeBias == -1 and momBear and cvdBear and volOK and sessOK and cooldownOK
Stop Loss and Take Profit:
SL and TP levels are calculated using ZEMA-smoothed ATR multiplied by configurable factors:
Stop Loss: Entry price minus (ZEMA-ATR x SL Multiplier) for longs, plus for shorts (default SL multiplier: 1.8)
Take Profit: Entry price plus (ZEMA-ATR x TP Multiplier) for longs, minus for shorts (default TP multiplier: 2.8)
The default risk-reward ratio is approximately 1:1.56 (1.8 SL to 2.8 TP). ZEMA smoothing on the ATR removes noise from the volatility measure, producing more stable SL/TP levels than raw ATR.
Regime Exit:
If the regime flips to ranging or the opposite direction while a position is open, the strategy closes the position immediately with a "Regime Exit" comment. Additionally, if momentum deteriorates significantly (Laguerre RSI crossing back toward neutral), the position is closed. This prevents holding positions through regime changes where the original thesis is no longer valid.
Band Structure Visualization
The strategy plots a JMA baseline with regime-colored glow, and SL/TP bands around it:
SL bands (inner) shown in muted scarlet with fill zones
TP bands (outer) shown in muted jade with cross-style plotting
The baseline color shifts based on regime: green for bullish trend, red for bearish trend, purple for ranging
Bar coloring reflects the current position state: green when long, red when short, purple when ranging (no position allowed), and grey when flat in a trending regime.
Default Strategy Properties
These are the default values used in the strategy's Properties dialog:
Initial Capital: $100,000
Order Size: 2% of equity per trade
Pyramiding: 0 (no adding to positions)
Margin: Long 0%, Short 0% (cash account simulation)
Commission: Not set by default — users should configure this for their broker (typical values: 0.01-0.1% for crypto, $1-5 per contract for futures, 1-3 pips for forex)
Slippage: Not set by default — users should configure this for their instrument (typical values: 1-3 ticks for liquid instruments, more for illiquid ones)
Users are strongly encouraged to set realistic commission and slippage values before evaluating backtesting results. Results without commission and slippage will overstate performance.
Input Parameters
Regime Engine:
R-Squared Length (default: 30), R-Squared Threshold k (default: 0.8), Chop Length (default: 20), Chop Threshold (default: 0.55)
H-Infinity Order (default: 3), Noise (default: 0.5), Disturbance (default: 1.0)
Momentum Core:
Laguerre Alpha (default: 0.07), JMA Smooth Period (default: 8), Bull Threshold (default: 62), Bear Threshold (default: 38)
Volume Filter:
CVD Smoothing (default: 14), Min Volume Ratio (default: 0.7)
Band Structure:
JMA Period (default: 21), ATR Length (default: 14), SL Multiplier (default: 1.8), TP Multiplier (default: 2.8)
Session Filter:
Session Filter toggle (default: on), Active Window (default: 0200-1200), Timezone (default: America/New_York)
Risk Management:
Risk % (default: 1.5), Re-entry Cooldown (default: 5 bars)
How to Use This Strategy
Step 1: Configure for Your Instrument
Open the strategy Properties dialog and set commission and slippage values appropriate for your broker and instrument. Adjust the session window if you trade instruments with different liquidity patterns than the default London/NY window.
Step 2: Evaluate on Sufficient Data
Run the strategy on a dataset that produces at least 100 trades for statistical significance. Short datasets with few trades produce unreliable performance metrics. Use the strategy tester's detailed trade list to review individual trades.
Step 3: Monitor the Dashboard
The 9-row dashboard shows the state of every subsystem in real-time: regime classification, momentum reading, CVD direction, volume ratio, session status, current position, ATR value, and cooldown status. This transparency lets you understand exactly why the strategy is or is not entering trades.
Step 4: Understand the Regime Exit
The strategy will close positions when the regime changes, even if the SL/TP has not been hit. This is by design — holding a trend-following position through a regime change to ranging is a common source of losses. Regime exits may result in small wins or small losses, but they prevent the larger losses that come from ignoring changing conditions.
Step 5: Adjust Parameters Thoughtfully
If the strategy produces too few trades, consider lowering the momentum thresholds (bull from 62 to 58, bear from 38 to 42) or reducing the minimum volume ratio. If it produces too many losing trades, consider increasing the R-squared threshold k or the chop threshold. Each parameter change affects the trade-off between signal frequency and signal quality.
Strategy Limitations and Compromises
Trade Frequency: The five-gate architecture is deliberately selective. On many instruments and timeframes, the strategy may only produce a handful of trades per month. This is by design — fewer, higher-quality trades — but it means the strategy is not suitable for traders who need frequent activity
Regime Detection Lag: The regime engine uses lookback-based measures (R-squared, chop score) and persistence requirements. Regime changes are identified with a delay, which means the strategy may miss the first portion of a new trend or hold slightly into a regime change
CVD Approximation: The volume delta calculation (close > open = buying) is an approximation. True order flow requires Level 2 data not available in Pine Script. On instruments with unreliable volume data (forex with tick volume), the CVD gate may be less effective
Fixed SL/TP: Stop loss and take profit are set at entry and do not trail. In strong trends, the strategy may exit at the TP while the trend continues. A trailing stop modification could capture more of extended moves but would also increase the risk of giving back profits during pullbacks
Session Dependency: The default session filter is optimized for forex and futures with distinct London/NY sessions. Crypto and other 24/7 markets may benefit from disabling the session filter or adjusting the window
No Pyramiding: The strategy does not add to winning positions. This limits profit potential in strong trends but also limits risk exposure
Backtesting vs Live: Backtesting assumes fills at the close of the signal bar. In live trading, slippage, requotes, and execution delays may produce different results. Always paper trade before committing real capital
Originality Statement
This strategy is original in its multi-gate architecture that synthesizes five independent subsystems into a unified execution engine. While individual components (regime detection, Laguerre RSI, CVD, session filtering, ATR-based risk management) are established concepts, this strategy is justified because:
The five-gate entry architecture (regime + momentum + CVD + volume + session) provides a systematic approach to filtering low-probability setups that is not available in single-indicator strategies
The H-Infinity filter for regime detection applies control theory to market classification, providing a theoretically grounded alternative to simple moving average crossover regime detection
The triple-measure regime engine (R-squared + chop + H-Infinity slope) provides more robust regime classification than any single measure
The regime exit mechanism actively manages positions based on changing market conditions rather than relying solely on fixed SL/TP levels
The NNFX-inspired architecture with clearly separated subsystems (baseline, confirmation, volume, exit, session) provides a modular framework that traders can understand, evaluate, and modify
The cooldown mechanism prevents revenge trading after exits, addressing a common behavioral trading error
All subsystem states are displayed transparently in the dashboard, allowing traders to understand exactly why trades are or are not being taken
Disclaimer
This strategy 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.
Backtesting results are historical simulations based on past data. Past performance does not guarantee future results. The strategy's historical performance was generated under specific market conditions that may not repeat. Markets are dynamic, and strategies that worked historically may fail in the future.
The default strategy properties do not include commission or slippage. Users must configure these values for their specific broker and instrument to obtain realistic performance estimates. Results without commission and slippage will overstate actual trading performance.
Always use proper risk management, including position sizing appropriate for your account and risk tolerance. Never risk more than you can afford to lose. Consider paper trading this strategy extensively before using real capital. The author is not responsible for any losses incurred from using this strategy.
-Made with passion by officialjackofalltrades
Strategy

Indicator

Spectra Inflection [JOAT]Spectra Inflection
Introduction
Spectra Inflection is an advanced open-source momentum oscillator that replaces conventional RSI with a Laguerre-domain filter, applies Jurik Moving Average (JMA) adaptive smoothing, and overlays a Zero-Lag EMA (ZEMA) signal line to produce a momentum reading with substantially less lag and noise than standard oscillators. The indicator then layers on Schmitt trigger state transitions, dynamic VWMA bands, gradient histogram rendering, momentum divergence detection, velocity and acceleration tracking, squeeze detection, exhaustion signals, and a comprehensive 16-row dashboard — all in a single pane.
This indicator exists because traditional momentum oscillators like RSI suffer from two fundamental problems: lag and noise. Lag causes late entries and exits. Noise causes false signals in choppy markets. Spectra Inflection addresses both by combining a Laguerre filter (which compresses price history into a shorter effective window without losing smoothness) with JMA adaptive smoothing (which tracks fast moves closely while filtering out chop). The result is a momentum curve that responds to genuine trend shifts quickly while remaining stable during consolidation.
Core Concepts
1. Laguerre RSI Core
The Laguerre filter is a four-element recursive filter originally developed by John Ehlers. Unlike a standard RSI that uses a fixed lookback window, the Laguerre filter uses a damping factor (alpha) to create an exponentially-weighted cascade of four internal registers (L0 through L3). This produces a smoother, more responsive oscillator:
float gamma = 1.0 - alpha
L0 := alpha * close + 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 )
The cumulative up/down movements across all four registers are then computed to derive an RSI-like value scaled 0-100. Lower alpha values produce smoother output (more filtering), while higher values produce faster response. The default alpha of 0.07 provides a balance between responsiveness and noise rejection.
2. JMA Adaptive Smoothing
The raw Laguerre RSI output is then passed through a Jurik Moving Average, which is a proprietary-class adaptive filter. JMA uses a volatility-tracking mechanism to adjust its smoothing dynamically: when the input is volatile, JMA tracks more closely; when the input is stable, JMA smooths more aggressively. This means the momentum line hugs genuine reversals tightly while filtering out noise during consolidation. The JMA implementation uses three parameters: period (smoothing length), phase (lead/lag adjustment), and power (responsiveness curve).
3. ZEMA Signal Line
A Zero-Lag EMA is calculated on the JMA-smoothed momentum line. ZEMA works by computing two EMAs and extrapolating the difference to cancel out the inherent lag:
ema1 = ta.ema(src, len)
ema2 = ta.ema(ema1, len)
zema = ema1 + (ema1 - ema2)
Crossovers between the momentum line and the ZEMA signal line generate potential entry and exit signals. The indicator scores each crossover based on the angle of approach, distance from the midline, and volume context to produce a "cross quality" rating.
4. Schmitt Trigger State Machine
Rather than using simple threshold crossings (which produce whipsaws), the indicator uses a Schmitt trigger — a hysteresis-based state machine where the entry threshold differs from the exit threshold. For example, the momentum line must cross above 62 to enter a bullish state, but must drop below 55 to exit it. This prevents rapid flip-flopping in choppy conditions and produces cleaner, more tradeable state transitions.
5. Dynamic VWMA Bands
Volume-Weighted Moving Average bands are calculated around the momentum line. These bands expand when volume is high (indicating conviction) and contract when volume is low (indicating indecision). Price touching or exceeding the bands while momentum is extended signals potential exhaustion or continuation depending on the volume context.
Features
Gradient Histogram: A color-gradient histogram below the momentum line shows the distance from the midline (50). Colors shift smoothly from muted near the center to vivid at extremes, providing instant visual feedback on momentum intensity without cluttering the chart
Neon Glow Rendering: The main momentum line uses a multi-layer plot technique where progressively wider, more transparent copies of the line are stacked to create a subtle glow effect that intensifies with momentum strength
Momentum Divergence Detection: The indicator detects both regular and hidden divergences using fractal pivot anchoring. When price makes a new high but the Laguerre RSI makes a lower high (bearish divergence), or price makes a new low but the oscillator makes a higher low (bullish divergence), the indicator draws divergence lines and labels
Velocity and Acceleration Tracking: First and second derivatives of the momentum line are calculated and smoothed. Velocity shows the rate of momentum change; acceleration shows whether momentum is speeding up or slowing down. These are displayed in the dashboard
OB/OS Exhaustion Detection: When momentum reaches extreme overbought or oversold levels with declining velocity, the indicator flags potential exhaustion points where reversals are more likely
Cross Quality Scoring: Each momentum/signal crossover is scored 0-100 based on the angle of the cross, distance from the midline, and whether volume confirms the move. Higher scores indicate higher-conviction crosses
Band Squeeze Detection: When VWMA bands contract below a threshold, the indicator identifies a "squeeze" condition — compressed momentum that often precedes a sharp expansion move
Midline Conviction Signals: Crosses of the 50 midline are tracked with volume confirmation to identify shifts in the underlying momentum bias
Momentum Regime Classification: The dashboard classifies the current momentum state as Trending Bull, Trending Bear, Ranging, or Transitional based on the composite of all sub-systems
16-Row Dashboard: A comprehensive real-time table displays Laguerre RSI, JMA momentum, ZEMA signal, state, velocity, acceleration, cross quality, band width, squeeze status, divergence history, regime classification, and more
Input Parameters
Laguerre Core:
Alpha: Damping factor for the Laguerre filter (default: 0.07). Lower = smoother, higher = faster
JMA Smoothing:
Period: JMA smoothing length (default: 8)
Phase: Lead/lag adjustment from -100 to +100 (default: -50)
Power: Responsiveness curve (default: 0.6)
Signal Line:
ZEMA Length: Period for the zero-lag signal line (default: 13)
State Thresholds:
Bull Entry/Exit: Schmitt trigger thresholds for bullish state (default: 62/55)
Bear Entry/Exit: Schmitt trigger thresholds for bearish state (default: 38/45)
VWMA Bands:
Band Length: VWMA calculation period (default: 20)
Band Width: Multiplier for band distance (default: 1.5)
Visuals:
Toggles for histogram, glow, divergence lines, bar coloring, background zones, squeeze markers, and dashboard
How to Use This Indicator
Step 1: Identify the Momentum Regime
Check the dashboard's regime classification. In trending regimes, look for pullback entries in the direction of the trend. In ranging regimes, look for mean-reversion setups at the VWMA band extremes.
Step 2: Wait for Schmitt Trigger State Transitions
Rather than acting on every oscillator wiggle, wait for the Schmitt trigger to confirm a state change. A transition from neutral to bullish (momentum crossing above the bull threshold with hysteresis) is a higher-conviction signal than a simple RSI crossing 50.
Step 3: Confirm with Cross Quality
When a momentum/signal crossover occurs, check the cross quality score. Scores above 60 indicate strong, angled crosses with volume confirmation. Scores below 30 suggest weak, flat crosses that are more likely to fail.
Step 4: Watch for Divergences
Divergences between price and the Laguerre RSI often precede reversals. Regular divergences signal potential trend changes; hidden divergences signal trend continuation. Use these in conjunction with the regime classification for context.
Step 5: Monitor Squeeze and Exhaustion
Band squeezes indicate compressed momentum — prepare for a breakout. Exhaustion signals at OB/OS extremes with declining velocity suggest the current move is losing steam.
Indicator Limitations
Like all momentum oscillators, this indicator is a lagging derivative of price. It confirms moves rather than predicting them
The Laguerre filter's alpha parameter significantly affects behavior — values that work well on one timeframe or instrument may need adjustment for others
Divergence detection uses fractal pivots which require a right-bar confirmation delay (default 5 bars). Divergences are identified after the fact, not in real-time
The Schmitt trigger prevents whipsaws but also delays state transitions. In fast-moving markets, the state change may come after a significant portion of the move has already occurred
Volume-based features (VWMA bands, cross quality scoring) work best on instruments with reliable volume data. On forex or instruments with synthetic volume, these features may be less meaningful
This is a momentum tool, not a complete trading system. It should be combined with trend structure, support/resistance, and risk management for actual trading decisions
Originality Statement
This indicator is original in its synthesis of multiple advanced signal processing techniques into a unified momentum analysis system. While individual components (Laguerre filters, JMA smoothing, ZEMA, Schmitt triggers) are established concepts in technical analysis and signal processing, this indicator is justified because:
The Laguerre-to-JMA-to-ZEMA processing chain creates a momentum signal with properties not achievable by any single technique alone — the Laguerre provides the raw momentum extraction, JMA provides adaptive noise filtering, and ZEMA provides a lag-compensated reference
The Schmitt trigger state machine replaces simple threshold crossings with hysteresis-based transitions, substantially reducing false signals in choppy conditions
Cross quality scoring provides a quantitative measure of signal conviction that is not available in standard oscillator implementations
The integration of velocity, acceleration, exhaustion detection, squeeze detection, and divergence analysis into a single coherent pane eliminates the need for multiple separate indicators
Dynamic VWMA bands provide volume-contextual overbought/oversold boundaries rather than fixed levels
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. Past performance of any indicator does not guarantee future results. The momentum readings, state classifications, and signals displayed are mathematical calculations based on historical price data — they do not predict future price movement. Always use proper risk management and conduct your own analysis before making trading decisions. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

Meridian Scaffold [JOAT]Meridian Scaffold
Introduction
Meridian Scaffold is an advanced open-source volatility band structure that builds adaptive price envelopes around a Jurik Moving Average (JMA) baseline with integrated range-lock dampening. Unlike standard Bollinger Bands or Keltner Channels that use fixed statistical measures, this indicator constructs its bands using ATR-Fibonacci expansion levels with auto-calibrating width, overlays a ZEMA trend bias system, and includes a full volatility regime classification engine with hysteresis state transitions. The result is a band structure that adapts its behavior to the current market phase — compressing tightly during consolidation, expanding proportionally during trends, and providing clearly defined reaction levels at Fibonacci-derived distances from the adaptive baseline.
This indicator addresses a core problem with conventional band indicators: they treat all market conditions the same. A Bollinger Band expands and contracts based on standard deviation alone, with no awareness of whether the market is trending, compressing, or in a whipsaw phase. Meridian Scaffold solves this by fusing a volatility regime classifier (compression, normal, expansion) with adaptive band construction, so the bands behave differently depending on the detected market phase. During compression, the baseline locks to a simple average to prevent false signals. During expansion, the bands widen using Fibonacci ratios to project realistic target levels.
Core Concepts
1. JMA Adaptive Baseline with Range-Lock Dampening
The centerline of the band structure is a Jurik Moving Average — an adaptive filter that tracks price closely during fast moves and smooths aggressively during noise. The JMA implementation includes a full volatility tracking system that measures the relative volatility of the input signal:
// Relative volatility determines JMA responsiveness
float rv = math.min(math.max(avgVolty > 0 ? volty / avgVolty : 1.0, 1.0), maxPow)
float adaptiveAlpha = math.pow(beta, math.pow(rv, pow1))
When relative volatility drops below a configurable threshold (the "range lock" condition), the indicator switches from the JMA to a simple moving average. This prevents the baseline from oscillating during low-volatility chop, producing a flat, stable reference line that clearly communicates "no trend present." When volatility returns, the JMA resumes tracking.
2. ATR-Fibonacci Expansion Levels
Rather than using standard deviation (which assumes normal distribution) or fixed ATR multiples, the bands are constructed at Fibonacci-derived distances from the baseline. The ATR is first smoothed using a ZEMA technique (double-EMA extrapolation) to remove noise from the volatility measure itself:
float atrZ1 = ta.ema(atrRaw, 21)
float atrZ2 = ta.ema(atrZ1, 21)
float atrSmooth = atrZ1 + (atrZ1 - atrZ2)
This ZEMA-smoothed ATR is then multiplied by configurable inner and outer factors to create the band levels. The default inner band at 1.5x ATR captures normal price oscillation; the outer band at 2.8x ATR marks extended moves. Additional Fibonacci extension levels at 1.618x and 2.618x ATR provide projection targets for breakout moves.
3. Volatility Regime Classification
The indicator classifies the current volatility environment into three states using a hysteresis state machine:
Compression: ATR is significantly below its long-term average (ratio < 0.6). Bands contract, baseline locks. This phase often precedes breakouts
Normal: ATR is near its average. Standard band behavior applies
Expansion: ATR is significantly above its long-term average (ratio > 1.5). Bands widen, momentum signals are prioritized
The hysteresis mechanism prevents rapid switching between states. Entry into expansion requires a ratio above 1.5, but exit only occurs when the ratio drops below 1.2. This creates stable regime classifications that don't flicker on every bar.
4. ZEMA Trend Bias
A Zero-Lag EMA calculated on the baseline provides directional bias. When the baseline is above its ZEMA, the bias is bullish; below, bearish. The spread between the baseline and ZEMA quantifies the strength of the directional conviction. This bias colors the baseline and bands to provide immediate visual feedback on trend direction.
5. Band Squeeze Detection
The indicator monitors bandwidth (the percentage distance between outer bands relative to the baseline) against its own rolling average and standard deviation. When bandwidth drops below the average minus half a standard deviation, a squeeze condition is flagged. Squeezes represent compressed volatility that statistically tends to resolve with an expansion move.
Features
Slope-Aware Baseline Glow: The baseline renders with a multi-layer glow effect whose intensity scales with the normalized slope. Steeper trends produce more vivid glow; flat periods produce subtle, muted rendering
Regime-Adaptive Band Coloring: Band colors shift automatically based on the volatility regime — compression phases use iris/purple tones, expansion phases use ember/warm tones, and normal phases use neutral slate
Kaufman Efficiency Scoring: The Kaufman Efficiency Ratio (net price movement divided by total path length) is calculated and displayed, providing a 0-1 measure of how efficiently price is moving. Values above 0.4 indicate strong directional movement; below 0.2 indicates chop
Mean Reversion Signals: When price touches or exceeds the outer band and then re-enters the inner band, the indicator generates a mean-reversion signal. These are most reliable during normal and compression regimes
Breakout Signals: When price closes beyond the outer band during an expansion regime with volume confirmation, a breakout signal is generated. These indicate potential trend continuation
Trend Strength Composite: A composite score combining slope strength, Kaufman efficiency, R-squared linearity, and regime alignment provides a single 0-100 measure of overall trend quality
16-Row Dashboard: Displays baseline value, regime state, trend bias, bandwidth, squeeze status, Kaufman ER, slope strength, R-squared, trend composite score, band levels, regime duration, and position relative to bands
Input Parameters
Baseline:
JMA Period: Adaptive baseline smoothing length (default: 21)
JMA Phase: Lead/lag adjustment (default: 0)
JMA Power: Responsiveness curve (default: 0.45)
Range Lock Threshold: Relative volatility below which the baseline locks flat (default: 0.55)
Bands:
ATR Length: Period for ATR calculation (default: 14)
Inner Band Multiplier: ATR multiple for inner band (default: 1.5)
Outer Band Multiplier: ATR multiple for outer band (default: 2.8)
Regime:
Regime Lookback: Period for volatility regime classification (default: 50)
Visuals:
Toggles for bands, Fibonacci extensions, glow effects, squeeze markers, regime background, bar coloring, and dashboard
Zone opacity control for band fill transparency
How to Use This Indicator
Step 1: Identify the Volatility Regime
Check the dashboard or observe the band coloring. Compression (purple/iris bands) means prepare for a breakout — avoid trend-following entries. Expansion (warm/ember bands) means trend-following setups are favored. Normal (slate bands) means standard analysis applies.
Step 2: Read the Baseline Bias
The baseline color and ZEMA relationship tell you the directional bias. Only look for long setups when the baseline is above ZEMA (bullish bias) and short setups when below (bearish bias).
Step 3: Use Bands as Context Levels
The inner band defines the normal oscillation range. Price consistently above the inner upper band indicates strong bullish momentum. The outer band marks extended territory where mean-reversion risk increases. Fibonacci extensions at 1.618x and 2.618x provide projection targets for breakout moves.
Step 4: Trade Squeezes
When a squeeze is detected (gold dots on the baseline), wait for the squeeze to release. The direction of the first strong move out of the squeeze often sets the trend for the next phase. Combine with the ZEMA bias for directional confirmation.
Step 5: Monitor Trend Quality
The trend strength composite score tells you how clean the current trend is. Scores above 60 indicate high-quality trends worth riding. Scores below 30 suggest choppy conditions where band-based mean-reversion strategies may work better.
Indicator Limitations
The JMA baseline, while adaptive, still lags price during sharp reversals. The range-lock feature helps during consolidation but cannot eliminate lag during genuine trend changes
ATR-based bands assume volatility is relatively stable over the measurement period. During news events or gap openings, the bands may not accurately reflect the new volatility environment for several bars
The volatility regime classifier uses hysteresis which creates stability but also delays regime transitions. A compression-to-expansion shift may be identified several bars after the breakout begins
Fibonacci extension levels are mathematical projections, not guaranteed targets. Price may reverse before reaching them or blow through them entirely
Squeeze detection identifies compressed volatility but does not predict the direction of the subsequent expansion. Additional directional analysis is required
The indicator works best on liquid instruments with consistent volatility patterns. Thinly traded instruments may produce unreliable regime classifications
Originality Statement
This indicator is original in its integration of adaptive baseline technology with regime-aware band construction. While ATR bands and JMA are established concepts, this indicator is justified because:
The JMA range-lock mechanism that switches to SMA during low-volatility periods is a novel approach to preventing false baseline oscillations in chop — standard JMA implementations do not include this feature
ZEMA-smoothed ATR for band construction removes noise from the volatility measure itself, producing cleaner band edges than raw ATR
The three-state volatility regime classifier with hysteresis transitions provides context-aware band behavior not available in standard Bollinger or Keltner implementations
Fibonacci-derived expansion levels integrate harmonic ratio theory with volatility measurement, providing mathematically grounded projection targets
The trend strength composite score synthesizes multiple independent quality measures (slope, efficiency, linearity, regime) into a single actionable metric
Slope-aware glow rendering and regime-adaptive coloring provide instant visual feedback on market conditions without requiring dashboard reading
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. Band levels, regime classifications, and signals are mathematical calculations based on historical data and do not predict future price movement. Squeeze conditions do not guarantee subsequent breakouts, and breakout signals do not guarantee trend continuation. 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

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

Indicator

Killzone Cartograph [JOAT]Killzone Cartograph
Introduction
Killzone Cartograph is an advanced open-source session structure mapper built around ICT (Inner Circle Trader) concepts. It automatically detects and renders the major institutional trading sessions — Asia, London, New York, and London Close — as color-coded boxes on the chart, calculates deviation projections from session ranges, tracks the New York Midnight Open as a key reference level, measures session dominance, detects session overlaps, and provides session bias signals. The indicator transforms raw time-of-day data into a structured visual map of when and where institutional activity concentrates.
The reason this indicator exists is that price does not move randomly throughout the day. Institutional order flow clusters around specific session windows — the "killzones" — where liquidity is deepest and the largest moves originate. Retail traders who ignore session structure often enter during low-liquidity periods (getting chopped) or miss the high-probability windows entirely. Killzone Cartograph makes session structure visible so traders can align their activity with institutional timing.
Core Concepts
1. Session Killzone Detection and Rendering
Each session is defined by a time window and timezone. The indicator detects when the current bar falls within each session and renders a box from the session's high to low, extending as the session progresses:
Asia Session: Typically 2000-0000 NY time. Often establishes the initial range that London and New York will sweep
London Session: Typically 0200-0500 NY time. The first major liquidity injection of the day, frequently setting the daily direction
New York Session: Typically 0700-1000 NY time. The highest-volume window where the London move is either confirmed or reversed
London Close: Typically 1000-1200 NY time. A secondary window where institutional position management creates distinct price patterns
Each session box is rendered with a distinct color from a muted institutional palette — tyrian violet for Asia, cardinal for London, cerulean for New York, and gunmetal for London Close. Box borders use the session color while fills use high transparency to avoid obscuring price action.
2. Deviation Projections
Once a session's range is established, the indicator projects deviation levels above and below the session high and low. These projections use configurable multipliers of the session range to identify where price might reach if it breaks out of the session box. This concept is rooted in the ICT framework where session ranges serve as measuring sticks for subsequent moves:
float sessionRange = sessionHigh - sessionLow
float devUp = sessionHigh + sessionRange * deviationMult
float devDn = sessionLow - sessionRange * deviationMult
Deviation levels are drawn as dashed lines extending from the session box, providing visual targets for breakout moves.
3. New York Midnight Open Reference
The NY Midnight Open (the opening price at 00:00 New York time) is a key ICT reference level. It serves as a daily bias marker — price above the midnight open suggests bullish daily bias, below suggests bearish. The indicator tracks this level and draws it as a horizontal reference line across the chart. Many institutional algorithms reference this level for daily positioning decisions.
4. Session Dominance and Overlap Detection
The indicator tracks which session produces the largest range each day and identifies it as the "dominant" session. It also detects when sessions overlap (London/New York overlap is particularly significant as it produces the highest liquidity of the day). Overlap periods are highlighted because they often generate the most significant price moves.
5. Session Bias Signals
At the close of each session, the indicator evaluates the session's price action to determine bias:
If the session closed in its upper third with expanding range, bullish bias is assigned
If the session closed in its lower third with expanding range, bearish bias is assigned
Otherwise, neutral bias is assigned
These bias arrows appear at session boundaries to provide quick directional context for the next session.
6. Killzone Strength Scoring
Each killzone receives a strength score based on the session's range relative to the daily ATR, volume during the session, and whether the session produced a directional move or just chopped. Higher scores indicate more significant sessions that are more likely to set the tone for subsequent price action.
Features
Session Box Rendering: Automatically drawn boxes for each session with configurable colors, extending as the session progresses and finalizing at session close
Deviation Projection Lines: Dashed lines at configurable multiples of the session range, projecting potential breakout targets
NY Midnight Open Line: Persistent horizontal reference at the 00:00 NY open price, updated daily
Previous Day High/Low Levels: Horizontal lines marking the prior day's extremes as key support/resistance references
Session Overlap Highlighting: Background coloring during session overlap periods (particularly London/NY overlap)
Dominance Coloring: The dominant session's box receives enhanced visual treatment to stand out
Session Bias Arrows: Directional arrows at session boundaries indicating the session's concluded bias
Killzone Strength Score: Numerical score for each session displayed in the dashboard
Session Bar Coloring: Optional bar coloring that tints candles based on which session they belong to
16-Row Dashboard: Displays current session, session high/low/range, deviation levels, midnight open, daily bias, dominant session, overlap status, killzone scores, and previous day levels
Input Parameters
Session Windows:
Asia/London/New York/London Close session times: Configurable time windows in exchange timezone
Timezone: Timezone for session calculations (default: America/New_York)
Deviation:
Deviation Multiplier: Multiple of session range for projection lines (default: 1.0)
Show Deviations: Toggle deviation projection lines
Reference Levels:
Show Midnight Open: Toggle NY Midnight Open reference line
Show Previous Day H/L: Toggle prior day's high and low levels
Visuals:
Toggles for each session's box rendering, bias arrows, bar coloring, overlap background, and dashboard
Individual color inputs for each session
How to Use This Indicator
Step 1: Identify the Active Session
The colored box tells you which session is currently active. Focus your trading during the session windows where you have the most experience and where your strategy performs best.
Step 2: Use Session Ranges as Context
The Asia session range often serves as the "initial balance" for the day. Watch for London to sweep one side of the Asia range (a liquidity grab) before establishing the daily direction. The New York session then either confirms or reverses the London move.
Step 3: Trade Deviation Projections
When price breaks out of a session box, the deviation projection lines provide measured-move targets. These are not guaranteed levels but represent statistically common extension distances based on the session's own range.
Step 4: Reference the Midnight Open
Use the NY Midnight Open as a daily bias filter. If price is above the midnight open, favor long setups. If below, favor short setups. This simple filter aligns your trading with the daily institutional bias.
Step 5: Prioritize Overlap Windows
The London/New York overlap (typically 0700-1000 NY time) produces the highest liquidity and often the day's most significant move. This is the highest-probability window for directional trades.
Close-up of the London/New York overlap period showing session boxes overlapping, deviation projections extending from the London range, and the NY Midnight Open reference line with price reacting to it
Indicator Limitations
Session times are fixed inputs based on typical institutional schedules. During daylight saving time transitions, session windows may need manual adjustment depending on your broker's timezone handling
Session structure analysis is most relevant for forex, futures, and indices that have distinct session-based liquidity patterns. Crypto markets trade 24/7 with less distinct session boundaries
Deviation projections are statistical tendencies, not guaranteed levels. Price may fall short of or exceed projected deviations
The NY Midnight Open is a reference level, not a support/resistance level with inherent strength. Its significance comes from institutional algorithm behavior, which may vary
Session dominance and bias signals are determined after the session closes, making them useful for context but not for real-time entries within that session
On higher timeframes (4H, Daily), individual session boxes may not render meaningfully as multiple sessions fit within a single candle
Originality Statement
This indicator is original in its comprehensive integration of ICT session concepts into a unified mapping system. While session boxes and killzone detection exist in other scripts, this indicator is justified because:
The deviation projection system uses the session's own range as a measuring stick, providing context-specific targets rather than generic ATR-based projections
Killzone strength scoring quantifies session significance using range, volume, and directional metrics — providing an objective measure not available in simple session box indicators
Session overlap detection with visual highlighting identifies the highest-liquidity windows automatically
The integration of NY Midnight Open, previous day levels, session bias, and dominance tracking into a single tool eliminates the need for multiple separate session indicators
Session bias arrows provide actionable directional context at session boundaries based on multi-factor analysis of the concluded session
The muted institutional color palette and clean box rendering avoid the visual clutter common in session-based indicators
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. Session structures, deviation projections, and bias signals are based on historical patterns of institutional activity and do not guarantee future price behavior. Market conditions change, and sessions that historically produced strong moves may not always do so. 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

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
