[ A L P H A X ] PRISM - Adaptive Dual-Kernel Flow EngineAlphaX PRISM — Adaptive Dual-Kernel Flow Engine: Nadaraya-Watson Kernel Regression, Residual Band System, Pivot Divergence Detection, Z-Score Fade & 4-Setup Regime-Gated Confluence Engine
AlphaX PRISM is a professional-grade adaptive trend and mean-reversion system built on a mathematically distinct foundation from every other indicator in the AlphaX suite. Where VECTOR uses an Efficiency Ratio and Choppiness Index to classify regimes and a KAMA line as the trend reference, PRISM applies non-parametric kernel regression — specifically a Nadaraya-Watson weighted estimate — to compute a statistically optimal smooth estimate of the price process itself. The result is not a moving average in the traditional sense. It is a regression estimate that weights each historical price observation by its distance from the present using a configurable kernel function, producing a slow kernel (primary trend estimate) and a fast kernel (momentum layer) whose spread creates a real-time directional bias measure fundamentally different from EMA crossover systems. Residual bands built from the standard deviation of price minus the kernel estimate — not from the kernel itself — provide statistically grounded dynamic envelopes that scale with actual price noise rather than arbitrary ATR multiples. Four regime-gated setup types — Trend Flow Break, Kernel Pullback, Z-Score Fade, and Pivot Divergence Reversal — fire through a 7-layer confluence engine that checks both kernel-specific signals and macro filter alignment simultaneously. Designed for traders who want institutional-grade statistical price modeling applied to practical signal generation across crypto, forex, gold, and indices on any timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔬 The Kernel Engine — Nadaraya-Watson Regression
The foundational difference between PRISM and every other AlphaX indicator is the core price estimate. All other systems use variants of exponential or adaptive moving averages — weighted sums of past prices with exponentially decaying weights. PRISM uses a Nadaraya-Watson kernel estimator — a non-parametric regression technique that estimates the true underlying price process at any point as a kernel-weighted average of all observations in the lookback window.
What kernel regression actually does:
Standard moving averages assign weights by time elapsed — more recent bars get more weight, older bars get less, following an exponential decay curve. The NW estimator assigns weights by position — how many bars ago a price occurred relative to the current bar — using a smooth, symmetric kernel function. This produces an estimate that minimizes the squared distance between the estimate and all observed prices, weighted by position.
Why this produces a superior trend estimate: A kernel regression estimate adapts its response to the local density of price observations rather than following a fixed mathematical formula. In fast-moving price environments with large bar movements, the kernel naturally places more emphasis on nearby bars. In slow, thin environments, older observations carry more proportional weight. The result is an estimate that is simultaneously smoother than an EMA of the same effective period and more structurally faithful to the underlying price movement.
Three kernel types available:
Gaussian (default):
Uses the normal distribution probability density function as the weight function. Weights decay as a bell curve — bars near the center of the lookback carry the most weight, tailing off smoothly toward zero at the edges. The Gaussian kernel produces the smoothest estimate and is optimal for normally distributed price noise. It never fully zeroes out any observation in the window.
Epanechnikov:
A parabolic weight function — (1 - (i/h)²) — that reaches exactly zero at the bandwidth boundary. More computationally efficient than Gaussian and optimal in a mean-squared-error sense under certain assumptions. Produces a slightly sharper response to local price movements than Gaussian.
Tricube:
The weight function used in LOESS regression — (1 - |i/h|³)³. A smooth, zero-bounded kernel that falls off more steeply than Gaussian near the boundary, producing an estimate that is highly responsive to recent prices while cleanly ignoring anything beyond the bandwidth boundary.
The kernel type is selectable from settings. For most instruments and timeframes, Gaussian is recommended for its smoothness. Epanechnikov or Tricube may be preferable when faster response to recent price action is desired.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Adaptive Bandwidth — Scaling With Volatility
The bandwidth parameter h controls the effective "window width" of the kernel — how many observations contribute meaningfully to each estimate. Larger h = smoother, slower response. Smaller h = more reactive, noisier.
The fixed bandwidth problem: A bandwidth calibrated for a low-volatility environment is too reactive during high-volatility periods, producing noisy, whipsawing estimates. A bandwidth calibrated for high-volatility is too slow during quiet periods, lagging price movements significantly.
PRISM's adaptive bandwidth solution:
When Adaptive Bandwidth is enabled (default: on), the effective bandwidth is scaled by the current ATR's percentile rank relative to its own history over the configured lookback (default: 100 bars). The scaling formula produces:
Low ATR percentile (quiet market) — bandwidth scales down toward the Adaptive Min Scale (default: 0.80). The kernel becomes more responsive, tracking the slower price movement more closely
High ATR percentile (volatile market) — bandwidth scales up toward the Adaptive Max Scale (default: 1.25). The kernel becomes smoother, filtering out the larger noise inherent in high-volatility conditions
Bandwidth shift alert: When the effective bandwidth changes by 12% or more from the previous bar, a bandwidth shift event is detected and flagged on the dashboard. This indicates a significant volatility regime transition — the adaptive system is meaningfully adjusting its estimate parameters, which is itself information about the market's current character.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Dual-Kernel Architecture — Slow and Fast Estimates
PRISM runs two kernel estimates simultaneously, each with a different effective bandwidth:
Slow Kernel (Primary Estimate):
The primary trend estimate computed at the full adaptive bandwidth. This is the principal signal line — the statistically optimal estimate of the underlying price trend. The residual bands are built relative to the slow kernel. The pullback setup watches price return to the slow kernel. The slow kernel is plotted as a purple line in Bands and Line visual modes.
Fast Kernel (Momentum Layer):
A second kernel estimate computed at a fraction of the slow kernel's bandwidth (default: 0.55× the slow bandwidth). This produces a more reactive estimate that leads the slow kernel during momentum shifts. The fast kernel's proximity to or divergence from the slow kernel creates the Kernel Spread — the primary directional bias indicator in PRISM.
Kernel Spread:
`Kernel Spread = Fast Kernel − Slow Kernel`
When positive and growing (spreadBull): the fast kernel is above the slow kernel and the gap is widening — upward momentum is accelerating.
When negative and falling (spreadBear): the fast kernel is below and the gap is widening downward — bearish momentum is accelerating.
When near zero: the two estimates have converged — no directional momentum bias is present.
The spread is displayed on the dashboard with a + or - sign and colored by its directional state. It is a prerequisite for Setups A and B — trend-following entries only fire when the spread confirms the signal direction.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Residual Bands — Statistically Grounded Envelopes
The residual bands in PRISM are fundamentally different from standard Bollinger Bands or ATR bands. They are built from the residuals — the differences between actual price and the slow kernel estimate — not from the price series itself.
Residual = Close − Slow Kernel
The standard deviation of these residuals over the band lookback period (default: 24 bars) gives sigma — the statistically appropriate measure of how much price typically deviates from the kernel estimate. The bands are then:
Upper Band = Slow Kernel + (Band Multiplier × σ)
Lower Band = Slow Kernel − (Band Multiplier × σ)
Why residual-based bands are superior: Bollinger Bands are built from the standard deviation of price itself — which includes both the trend component and the noise component. In a strongly trending market, most of the "deviation" in Bollinger Bands is actually trend — the bands widen dramatically and the upper/lower band crossings lose their mean-reversion significance. PRISM's residual bands remove the trend component first and only measure the standard deviation of the remaining noise. This means the bands genuinely represent deviation from the estimated price trend, not deviation from a lagging average.
Z-Score:
The current residual divided by sigma: `Z-Score = Residual / σ`. A Z-Score of +1.35 means price is currently 1.35 standard deviations above the kernel estimate — more than one standard deviation above expected. This is the metric that gates Setup C (Z-Score Fade) — a configurable minimum Z-Score is required before a mean-reversion fade signal can fire.
σ Width:
The current sigma value is displayed on the dashboard — a real-time measure of the current price noise level relative to the kernel estimate. Rising sigma indicates price is deviating increasingly from the kernel trend, falling sigma indicates price is tightening around the kernel.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Regime Classification — Two-Metric System
PRISM uses two independent measurements to determine the current regime, augmented by the kernel spread itself.
Efficiency Ratio (ER):
Identical to the VECTOR implementation — net directional price change divided by total path traveled over the lookback period. High ER = efficient directional movement = trending. Low ER = inefficient oscillation = choppy or ranging.
Choppiness Index (CI):
The logarithmic measure of how efficiently the period's ATR sum is packed into the high-low range. Above the configured threshold (default: 61.0) = stand aside (CHOP regime), blocking all signals.
Kernel Spread as regime filter:
For PRISM's Trend regime classification, the kernel spread must also exceed a minimum threshold (0.15× sigma) to distinguish genuine momentum bias from flat spread near zero. This prevents Trend regime classification when the two kernels have converged — a state that typically precedes a direction change rather than a trend continuation.
Four regimes:
CHOP (0) — CI above threshold. All signals blocked. Dashboard: ⛔ CHOP
TREND BULL (1) — not chop, ER above trend minimum, kernel spread positive and above minimum. Dashboard: ▲ TREND BULL
TREND BEAR (2) — not chop, ER above minimum, kernel spread negative and below minimum. Dashboard: ▼ TREND BEAR
BALANCE (3) — not chop, ER or spread conditions for trend not met. Dashboard: ◆ BALANCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔀 Pivot Divergence Detection — Price vs Kernel
PRISM implements a pivot-based divergence system that is significantly more robust than the slope comparison divergence used in most oscillator-based indicators.
The pivot divergence method:
Standard divergence detection compares current price slope to current oscillator slope — a noisy, easily-fooled method that produces many false signals. PRISM instead identifies confirmed price pivots (using a configurable pivot length, default: 5 bars) and compares the price level at each new pivot to the slow kernel value at the same pivot bar.
Bullish pivot divergence:
Price forms a new pivot low lower than the previous pivot low — a genuine lower low in price
The slow kernel at the current pivot low bar is higher than it was at the previous pivot low — the kernel estimate is making a higher low while price makes a lower low
Price is currently near or below the lower residual band (within 1σ) — confirming the divergence is occurring at a structurally meaningful oversold level
Bearish pivot divergence:
Price forms a new pivot high higher than the previous pivot high — a genuine higher high in price
The slow kernel at the current pivot high bar is lower than at the previous pivot high — kernel making a lower high while price makes a higher high
Price is near or above the upper residual band
Why kernel-based divergence is more reliable than oscillator divergence: The slow kernel is a statistically optimal estimate of the price trend. When price makes a new extreme but the kernel's trend estimate does not confirm that extreme — actually reversing direction relative to the prior swing — it indicates that the underlying price process, stripped of noise, is already diverging from the price surface. This is a stronger divergence signal than any oscillator comparison because the kernel literally measures the same thing as price, just without noise.
Divergence cooldown: A minimum cooldown between consecutive divergence detections (default: 8 bars) prevents the same divergence condition from generating multiple signals during a prolonged extreme.
Divergence markers: Semi-transparent diamond shapes appear below (bull) or above (bear) bars where divergence is detected but a full entry signal has not fired. These allow you to track divergence conditions developing on the chart even before the complete signal conditions are met.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🏷 Four Regime-Gated Setup Types
PRISM implements four distinct entry setups, each gated to the appropriate regime state and designed to exploit a different market condition detected by the kernel system.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Setup A — Flow Break (Trend regime only)
A trend-following breakout entry that fires when price crosses through the residual band with kernel momentum confirmation.
Long conditions:
Regime is Trend Bull (regime == 1)
Price closes above the upper residual band — a statistically significant positive deviation from the kernel trend
Kernel spread is positive and accelerating (spreadBull) — fast kernel is above slow and the gap is widening, confirming the momentum behind the break
A qualifying bull rejection candle (close > open, lower wick above 52% of range) is present
The rationale: A close above the upper residual band in a Trend Bull regime means price has moved more than one standard deviation above the kernel trend estimate with directional kernel momentum behind it. This is not a mean-reversion setup — in a trending regime, upper band closes are continuation signals, not exhaustion signals. The kernel spread confirmation ensures the break has genuine momentum backing rather than being a noise spike into the band.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Setup B — Kernel Pullback (Trend regime only)
The primary pullback entry — price retracing to the slow kernel with momentum still intact.
Long conditions:
Regime is Trend Bull
Price touches the slow kernel from above — the low of the bar reaches within 0.25× ATR of the kernel line
Price closes above the kernel — confirming the touch was a rejection, not a breakdown through the kernel
Kernel spread is still positive and accelerating — the underlying momentum has not reversed despite the pullback
A qualifying bull rejection candle confirms
The rationale: In a trend regime, the slow kernel is the trend's statistical backbone — the optimal estimate of where the underlying price process is. A pullback to the kernel during a trend is the equivalent of pulling back to the trend's center — the lowest-risk continuation entry with the widest statistical support. The spread confirmation ensures the trend's momentum is intact at the time of the touch.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Setup C — Z-Score Fade (Balance regime only)
A statistically informed mean-reversion entry using the residual Z-Score to identify genuine band extremes.
Short fade conditions:
Regime is Balance (regime == 3)
Z-Score is above the configured minimum (default: 1.35) — price is more than 1.35 standard deviations above the kernel estimate, a statistically elevated extension
A qualifying bear rejection candle confirms the rejection at the extreme
Why the Z-Score threshold is the key gate: Any band touch could trigger a naive fade signal. The Z-Score requirement ensures only genuine statistical extremes are faded — points where price has deviated far enough from the kernel estimate that mean-reversion is statistically probable. The 1.35σ threshold balances frequency and quality — above this level, approximately 82% of normal distribution probability mass is below the current price, making continuation significantly less likely than reversion.
Balance-only gating: In a Trend regime, upper band touches in a bull trend are continuation signals, not exhaustion (as Setup A exploits). Setup C is therefore hard-gated to Balance regime only — mean-reversion entries are only valid when the market is genuinely ranging, not when a trend is carrying price to the band.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Setup D — Divergence Reversal (Balance or opposing Trend regime)
The highest-conviction reversal entry, combining the pivot divergence signal with a band extreme and rejection candle.
Long conditions:
A qualifying bullish pivot divergence has been detected (price lower low, kernel higher low, near lower band)
A qualifying bull rejection candle confirms on the divergence bar
Regime is Balance OR Trend Bear (regime == 3 or regime == 2) — the setup is intended for counter-trend reversals, not trend continuation
Why divergence setups fire in opposing trend or balance regimes: A bullish divergence at the lower band during a Trend Bear regime is a potential trend exhaustion and reversal signal. In Balance, it is a standard oscillation reversal. Both contexts are appropriate for a divergence-based entry. A bullish divergence during Trend Bull would be anomalous — if the kernel is making higher lows while price makes lower lows in a bull trend, the trend is likely still intact and the divergence is noise rather than reversal signal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 The 7-Layer Confluence Engine
Every signal across all four setup types is scored through the same 7-layer system. The default minimum is 5 of 7.
Layer 1 — Regime and Kernel Spread Direction (1 point):
Awards 1 point when either the regime confirms the signal direction (Trend Bull for longs, Trend Bear for shorts) or the kernel spread is directionally aligned. This layer is satisfied by either condition, making it achievable even in Balance regime when the spread is directional.
Layer 2 — Z-Score and Spread Positioning (1 point):
Awards 1 point when the residual Z-Score is positive (price above kernel) for longs, or negative for shorts; or when the kernel spread is directionally positive or negative respectively. Confirms the price is on the structurally correct side of the kernel estimate.
Layer 3 — HTF Bias (1 point):
Higher timeframe EMA alignment agrees with the signal direction. The macro institutional flow confirmation layer.
Layer 4 — Volume Expansion (1 point):
Current bar volume exceeds the volume moving average by the configured minimum multiplier (default: 1.05×). Confirms genuine participation on the signal bar.
Layer 5 — Rejection Candle (1 point):
A qualifying bull or bear rejection candle — bullish close with lower wick exceeding 52% of range, or bearish close with upper wick exceeding 52%. The candle quality confirmation that price genuinely rejected at the relevant level.
Layer 6 — Non-Chop Regime (1 point):
Market is not in Chop regime. Also enforced as a hard gate — no signal fires in Chop regardless of score.
Layer 7 — Setup Type Active (1 point):
Any of the four enabled setup types has fired on the current bar. Both a scoring layer and a hard prerequisite — at least one setup type must qualify for a signal to exist.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Live Dashboard
The 16-row real-time dashboard displays the complete internal state across four sections.
KERNEL
Regime — current regime: ⛔ CHOP, ▲ TREND BULL, ▼ TREND BEAR, or ◆ BALANCE
Kernel Type — the active kernel function: Gaussian, Epanechnikov, or Tricube
Bandwidth h — the current effective slow kernel bandwidth with "adap" suffix when adaptive scaling is active. Orange when a bandwidth shift event has been detected
Flow Spread — the current Fast Kernel minus Slow Kernel spread value with + or - sign. Yellow-green when spreadBull, red when spreadBear
BANDS
Z-Score — the current residual Z-Score. Orange when above the fade minimum threshold, indicating a statistically stretched condition
σ Width — the current sigma value in price terms — the standard deviation of residuals, displayed as a price distance
Divergence — ▲ BULL DIV or ▼ BEAR DIV when a pivot divergence is currently active, — otherwise
FILTERS
HTF Bias — ▲ BULL, ▼ BEAR, or — FLAT
Chop Index — live Choppiness Index value. Orange when in the stand-aside zone
CONFLUENCE
Bull Score — live 0–7 score. Background highlights yellow-green when threshold met and not in chop
Bear Score — live 0–7 score. Background highlights red when threshold met and not in chop
Live confluence label: During non-chop regimes, a small B x/7 · S x/7 label appears near the slow kernel line on the current bar, updating in real time.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 Chart Visual System — Three Visual Modes
PRISM provides three visual modes selectable from settings, allowing you to optimize the chart display for your preferred analysis style.
Bands Mode (default):
Shows both the slow kernel line and the upper/lower residual bands as a channel around the kernel. The band fill creates a purple-tinted envelope. Setup A and C reference levels are immediately visible. Best for band-aware trading and Z-Score fade entries.
Line Mode:
Shows only the slow kernel line without bands. Clean, minimal display for traders who prefer to use the kernel line purely as a trend reference and support/resistance level for pullback entries.
Flow Mode:
Shows both the fast and slow kernel lines simultaneously without the residual bands. The spread between the two lines is directly visible on the chart — the gap between cyan (fast) and purple (slow) is the visual representation of the Flow Spread. Best for traders who want to monitor momentum through the kernel spread rather than band positioning.
Additional visuals:
Slow Kernel Line (purple) — the primary trend estimate, primary reference for Setup B pullbacks
Fast Kernel Line (cyan, Flow Mode only) — the momentum layer, its position relative to the slow kernel shows the current spread
Upper/Lower Residual Bands — statistically computed envelopes around the kernel. Setup A crossovers and Setup C fade levels
Band Fill (purple tint) — semi-transparent fill between bands when enabled
▲ Triangle (below bar) — long signal. All conditions confirmed
▼ Triangle (above bar) — short signal
◆ Diamond (semi-transparent, below/above) — divergence detected but full signal not yet confirmed. Pre-signal awareness
SL Guide (red dotted circles) — stop loss below the lower band or bar low minimum, plus ATR buffer
TP Guide (yellow-green dotted circles) — dynamic R-multiple target
Bar coloring (optional, off by default) — bars colored by kernel bias direction when enabled
Live confluence label — B x/7 · S x/7 near the slow kernel on the current bar
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🚀 How to Trade with AlphaX PRISM — Step by Step
Step 1 — Check Regime and Kernel State
Dashboard Regime row is the first check. ⛔ CHOP means no trades. ▲ TREND BULL or ▼ TREND BEAR means Setup A and B are available. ◆ BALANCE means Setup C and D are available
Check Flow Spread — is it confirming the regime direction? In Trend Bull, the spread should be positive and yellow-green. A Trend Bull regime with a flat or negative spread is a weakening trend that may be transitioning to Balance
Note the Z-Score — is it near or beyond the fade threshold? A Z-Score above +1.35 in Balance regime means Setup C short fade conditions are approaching. Below -1.35 means Setup C long fade is approaching
Check Divergence row — if it shows ▲ BULL DIV or ▼ BEAR DIV, a reversal setup is potentially developing. Watch for the rejection candle confirmation
Step 2 — Identify the Active Setup Type
Trend Bull: watch for price to reach the slow kernel line from above (Setup B) or close above the upper band with spread confirmation (Setup A)
Balance: watch Z-Score. When it reaches ±1.35 and the rejection candle fires, Setup C is the play
Any regime where divergence is active: Setup D — the rejection candle at the band extreme is the trigger
Step 3 — Enter on the PRISM Signal
A ▲ triangle confirms the full confluence stack is met. The SL guide is below the lower band and bar low minimum — the structural invalidation level
The TP guide is at the R-multiple target. For Setup A trend breaks, consider extending the target toward previous swing highs if the trend is strongly established
For Setup D divergence entries, the target is typically the kernel line itself (the mean) — the Z-Score fading back toward zero is the natural first target
Step 4 — Manage with Kernel State
During a Trend regime trade, watch the Flow Spread on the dashboard. When the spread begins narrowing (converging toward zero), trend momentum is fading — begin preparing to exit
A bandwidth shift (Bandwidth h shows orange) during a trade means volatility is changing significantly. Reassess the trade's context — the kernel is recalibrating
If regime transitions to Chop during an open trade, close immediately — the market character no longer supports the setup's thesis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Identifying Low-Quality Conditions — When Not to Trade
Stand aside when:
Regime shows ⛔ CHOP — the Choppiness Index has crossed the stand-aside threshold. All signals are blocked. This is the most important dashboard reading in PRISM
Bandwidth h shows orange (bandwidth shift) — the adaptive bandwidth is shifting significantly, indicating a volatility regime transition. The kernel is recalibrating and its estimates may be temporarily less reliable
Flow Spread is near zero in either direction — when the fast and slow kernels have converged, there is no directional momentum bias. Setup A and B require a spreading kernel; a flat spread means the market has no directional commitment at the kernel level
Z-Score is between -1.0 and +1.0 in Balance regime — price is near the kernel estimate, well within one standard deviation. Setup C fade signals require statistical stretch beyond 1.35σ — entering fades too close to the kernel means the edge from Z-Score mean reversion is absent
Divergence markers appear but no rejection candle forms for multiple bars — a divergence without a confirming candle is a warning, not a signal. Do not enter on the divergence alone; wait for the full Setup D conditions including the rejection candle and minimum confluence score
Regime alternates rapidly between Trend Bull and Balance or Balance and Chop — unstable regime cycling indicates a transitional market where neither trending nor ranging playbooks have sustained applicability. Reduce size or wait for a clear, sustained regime
The ideal PRISM setup:
Trend regime sustained for 10+ bars with consistent spread direction
Flow Spread positive and growing (Trend Bull) — the momentum is actively building
HTF Bias aligned with regime direction
Price retracing cleanly to the slow kernel (Setup B) — touch within 0.25× ATR with a qualifying rejection pin bar
Volume above average, confirming institutional participation at the kernel level
Confluence score at 6/7 or 7/7
Z-Score near zero at the pullback bar — confirming the pullback reached the statistical center, not an overextended entry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ Key Features
🔬 Nadaraya-Watson kernel regression — non-parametric weighted estimate of the underlying price process using Gaussian, Epanechnikov, or Tricube kernel functions
⚙ Adaptive bandwidth scaling — effective bandwidth scales by ATR percentile rank, tightening in quiet markets and widening in volatile conditions
⚡ Dual-kernel architecture — slow kernel (primary trend estimate) and fast kernel (momentum layer) whose spread creates a real-time directional bias measure
📊 Residual-based bands — bands computed from the standard deviation of price-minus-kernel residuals, not from price itself. Statistically superior to ATR or price-deviation bands
📉 Z-Score display — live residual Z-Score showing how many standard deviations price has deviated from the kernel estimate, gating the mean-reversion fade setup
🔀 Pivot-based divergence detection — price pivot extremes compared to kernel estimate at same bar, more robust than oscillator slope divergence
◆ Divergence pre-signal markers — semi-transparent diamonds show developing divergence conditions before the full signal fires
🏷 Four regime-gated setup types — Setup A (Flow Break, trend only), Setup B (Kernel Pullback, trend only), Setup C (Z-Score Fade, balance only), Setup D (Divergence Reversal, balance or opposing trend)
📡 Bandwidth shift detection — alerts when adaptive bandwidth changes by 12%+ in a single bar, signaling a volatility regime transition
🎨 Three visual modes — Bands (channel display), Line (clean kernel only), Flow (dual-kernel spread visualization)
📊 Optional bar coloring — bars colored by kernel bias direction, off by default for chart cleanliness
🧠 7-layer confluence engine — Regime/Spread, Z-Score/Positioning, HTF Bias, Volume, Rejection Candle, Non-Chop, and Setup Type scored every bar
📊 16-row live dashboard — Regime, Kernel Type, Bandwidth h, Flow Spread, Z-Score, σ Width, Divergence, HTF Bias, Chop Index, and Confluence scores updated in real time
🔔 6 alert conditions — long/short entry, chop warning, bull/bear divergence, bandwidth shift
⚙ Fully configurable — kernel type, lookback window, base bandwidth, adaptive scaling range, output EMA smoothing, fast kernel bandwidth multiplier, residual band multiplier and lookback, Z-Score fade minimum, ER and CI regime thresholds, divergence pivot length and cooldown, all four setup enables, HTF timeframe and EMAs, volume filter, session, SL/TP parameters, visual mode, and all colors are independently adjustable
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Settings Reference
Kernel Engine
Kernel Type — Gaussian / Epanechnikov / Tricube. The weight function applied in the NW estimate
Lookback Window — the number of historical bars included in the kernel estimate (default: 40)
Base Bandwidth (h) — the base bandwidth parameter controlling effective kernel width (default: 6.0)
Adaptive Bandwidth (ATR percentile) — when on, scales h by ATR percentile rank (default: on)
ATR Length — lookback for the ATR calculation used in adaptive scaling (default: 14)
ATR Percentile Lookback — history window for ATR percentile rank (default: 100)
Adaptive Min Scale — minimum bandwidth multiplier in quiet markets (default: 0.80)
Adaptive Max Scale — maximum bandwidth multiplier in volatile markets (default: 1.25)
Output EMA Smooth — post-kernel EMA smoothing applied to both kernel outputs (default: 2)
Fast Kernel h Mult — bandwidth multiplier for the fast kernel relative to the slow (default: 0.55)
Residual Bands
Band Multiplier (σ) — number of residual standard deviations for the band boundaries (default: 1.0)
Residual σ Lookback — bars used to compute the residual standard deviation (default: 24)
Z-Score Min for Range Fade — minimum absolute Z-Score required for Setup C to fire (default: 1.35)
Regime & Divergence
Efficiency Ratio Length — ER lookback (default: 10)
ER Min (Trend) — minimum ER for trend classification (default: 0.32)
Choppiness Length — CI lookback (default: 14)
Chop — Stand Aside Above — CI threshold (default: 61.0)
Enable Pivot Divergence — toggle the divergence detection system
Divergence Pivot Length — bars on each side for pivot confirmation (default: 5)
Divergence Cooldown (bars) — minimum bars between divergence detections (default: 8)
Entries & Confluence
Setup A · Flow Break (trend) — toggle the trend band crossover setup
Setup B · Kernel Pullback — toggle the kernel touch pullback setup
Setup C · Z-Score Fade (balance) — toggle the balance mean-reversion setup
Setup D · Divergence Reversal — toggle the pivot divergence entry
Min Confluence Layers (of 7) — minimum score to fire a signal (default: 5)
Show Entry Signals — toggle signal triangles
Show Confluence Label — toggle the live B/S score label near the kernel line
Signal Cooldown (bars) — minimum bars between consecutive signals (default: 6)
Filters
HTF Trend Filter / HTF Timeframe / HTF Fast / HTF Slow EMA — higher timeframe bias parameters (defaults: on / 60-minute / 21 / 55)
Volume Confirm / Min Volume vs Avg / Volume Avg Length — volume expansion gate (defaults: on / 1.05 / 20)
Session Filter / Active Session — trading hours restriction (default: off)
Exit Guidance
Show SL / TP Guides — toggle stop and target circles
SL Distance (xATR) — ATR buffer beyond the lower band and bar low minimum (default: 1.0)
TP Reward (R) — take profit as risk × R multiple (default: 2.5)
Display
Visual Mode — Bands / Line / Flow. Selects which kernel components are rendered
Fill Residual Bands — toggle the purple band fill between upper and lower bands
Color Bars by Bias — toggle optional bar coloring by kernel spread direction (default: off)
Show Dashboard — toggle the full dashboard
Dashboard Position — Top Left / Top Right / Bottom Left / Bottom Right
Colors
Bull / Bull Bright — yellow-green family for bullish signals and indicators
Bear / Bear Bright — red family for bearish signals
Chop / Caution — orange for chop regime and bandwidth shift warnings
Kernel Line — purple for the slow kernel line and neutral band elements
Fast Kernel — cyan for the fast kernel line in Flow mode
SL Guide / TP Guide — stop and target circle colors
Dash Text / Dash BG / Dash Header / Dash Section / Dash Frame — full dashboard color control
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alert Conditions (6 total)
Entry Alerts
PRISM Long — all conditions confirmed. Long signal fired across any of the four setup types
PRISM Short — all conditions confirmed. Short signal fired
State Alerts
PRISM Chop Warning — market has entered the Chop regime. All signals blocked — stand aside
PRISM Bull Divergence — bullish pivot divergence confirmed at the lower band. Setup D long conditions developing — watch for rejection candle
PRISM Bear Divergence — bearish pivot divergence confirmed at the upper band
PRISM Bandwidth Shift — adaptive bandwidth shifted 12%+ in one bar. Volatility regime transition in progress
All alert messages are formatted as const strings for clean webhook and notification platform integration.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 Recommended Settings by Instrument & Timeframe
The default configuration is optimized for XAUUSD, major forex pairs, and crypto on M5–H1 :
Gaussian kernel — smoothest estimate, optimal for the normally-distributed noise of gold and forex price action
Lookback at 40 — sufficient history for a meaningful kernel estimate on intraday timeframes without excessive lag
Base bandwidth at 6.0 with adaptive scaling — allows the kernel to breathe with gold's characteristic alternation between tight ranges and explosive moves
Band Multiplier at 1.0σ — one standard deviation bands are sensitive to genuine residual extremes without requiring extreme extension
Z-Score minimum at 1.35 — approximately 82nd percentile of normal distribution — a meaningful but not excessive statistical stretch requirement
For other instruments or timeframes, adjust:
M1–M3 scalping — reduce Lookback to 25–30, reduce Base Bandwidth to 4.0–5.0, reduce Output EMA Smooth to 1, reduce Cooldown to 3, reduce TP to 2.0R
H4–Daily swing trading — increase Lookback to 60–80, increase Base Bandwidth to 8.0–12.0, increase ATR Percentile Lookback to 200, increase TP to 3.5–5.0R
Crypto (BTC, ETH) — increase Adaptive Max Scale to 1.40–1.50 for the wider volatility swings, consider Epanechnikov kernel for faster response to crypto's sharper price movements
Indices (NAS100, US30) — increase Z-Score minimum to 1.5–1.8 (indices can sustain higher Z-scores in trends before reverting), use session filter for cash market hours
More signals — lower Min Confluence to 4, reduce Z-Score minimum to 1.1, increase Base Bandwidth to produce wider bands that are touched more frequently
Fewer, highest-quality signals — raise Min Confluence to 6–7, increase Z-Score minimum to 1.6, reduce Fast Kernel multiplier to 0.45 for a slower fast kernel that only diverges from slow in strong trends
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👥 Who This Is For
🔬 Mathematically sophisticated traders — PRISM exposes the full statistical machinery of non-parametric kernel regression to traders who want more than a moving average but something grounded in rigorous statistical theory
📊 Band-based traders who struggle with Bollinger Bands — residual-based bands solve the core Bollinger Band problem: bands that widen dramatically in trends due to trend variance rather than noise variance. PRISM's bands measure only the noise
🎯 Divergence traders — the pivot-based kernel divergence system is the most robust divergence implementation in the AlphaX suite, comparing structural price pivots to the kernel's trend estimate rather than oscillator slopes
🧭 Regime-aware traders — like VECTOR, PRISM classifies the current market regime and selects the appropriate playbook automatically. Four distinct setup types cover trending, balanced, and reversal conditions
📈 Adaptive system traders — the adaptive bandwidth scaling means PRISM truly adapts to the current volatility environment without manual recalibration
🥇 Gold and forex intraday traders — the Gaussian kernel with adaptive scaling is particularly well-suited to gold's volatility patterns, and the default settings are calibrated for XAUUSD intraday conditions
🔀 Traders who use mean-reversion and trend-following simultaneously — PRISM's four setups cover both directions: momentum breaks and pullbacks in trends, fades and divergence reversals in balance. One indicator, complete market coverage across regimes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Notes
All signals are confirmed on bar close — the indicator is non-repainting by design. Kernel estimates, regime classification, divergence detection, and confluence scoring all finalize on confirmed bars
The kernel regression calculation requires all bars within the lookback window to produce its estimate. On charts with fewer bars than the Lookback Window setting, the kernel estimate may be imprecise during the warm-up period. Allow the chart to accumulate at least the full lookback period (default: 40 bars) before treating signals as reliable
Adaptive bandwidth scaling uses ATR percentile rank, which itself requires the ATR Percentile Lookback period to calibrate. On fresh chart loads, the adaptive scale may not reflect the full historical context until sufficient bars have accumulated
The divergence system compares to the most recently confirmed pivot high or low. On timeframes where pivots form infrequently (H4+), the prior pivot reference may be many bars old and the divergence comparison less temporally relevant. Reduce the divergence pivot length on higher timeframes for more frequent reference points
The bandwidth shift alert fires when the bandwidth changes by 12%+ between consecutive bars. On very fast timeframes with high ATR volatility, this threshold may be crossed frequently — increase the threshold or disable the bandwidth shift alert if this becomes excessive noise
Maximum 500 labels and 500 lines are rendered. The divergence markers and confluence labels count toward these limits
The indicator does not track open positions or P&L and does not connect to any broker or account
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ Disclaimer
This indicator is a technical analysis and visualization tool intended for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. All signals are generated from historical and real-time price data using mathematical calculations — their accuracy or profitability is not guaranteed. Past performance of any signal type does not guarantee future results. Always conduct your own analysis, use proper risk management, and consult a licensed financial advisor before making any trading decisions. The author accepts no responsibility for any losses incurred from the use of this indicator.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Built for traders who believe that the best price estimate is not an average of the past — it is a statistically optimal reconstruction of the price process itself.
Chỉ báo






















