Relative Strength (RS) - Mansfield StyleRelative Strength (RS) measures how a symbol performs against a chosen
benchmark. Instead of plotting the raw price ratio — whose scale differs
from one symbol to another and makes comparison difficult — this script
normalizes the ratio (symbol close / benchmark close) against its own
simple moving average over a configurable lookback "Period". The result
is a zero-centered line that reads the same way on any symbol:
- RS above 0 and rising → the asset is outperforming the benchmark
- RS below 0 and falling → the asset is underperforming
- Zero-line crossings → shifts in relative leadership
Only the direction and the position relative to zero matter, not the
absolute value.
█ HOW IT WORKS
1. The script requests the benchmark's close on the selected timeframe.
2. It computes the raw ratio: symbol close / benchmark close.
3. The ratio is divided by its SMA over the "Period" lookback, minus 1 —
expressing how far the current relative strength stands above or
below its recent average.
4. An optional moving average of RS can be displayed as a signal line.
█ INPUTS
- Comparative Symbol: the benchmark (an index such as SPX, a sector
index, or any peer symbol — e.g. compare gold against silver).
- Period (default 50): normalization lookback. Shorter = more reactive,
longer = smoother and slower.
- Show Moving Average / Moving Average Period: optional smoothing line.
- Timeframe: leave empty to use the chart's timeframe, or select a
higher timeframe for multi-timeframe analysis.
█ HOW TO USE
Apply the indicator to any symbol. When RS holds above zero, the asset
is leading its benchmark — favor it for relative-strength strategies
(buy strength). When RS holds below zero, the asset is lagging — avoid
it or rotate out. Zero-line crossovers flag early changes in relative
leadership, and two built-in alerts fire on these crossings.
RS is a relative tool, not a timing tool: an asset can outperform a
falling benchmark while still declining in absolute terms. Combine it
with your own trend or entry criteria.
█ CREDITS
The normalization method follows the Mansfield Relative Strength
concept popularized by Stan Weinstein in "Secrets for Profiting in
Bull and Bear Markets".
█ NOTE ON HIGHER TIMEFRAMES
When a higher timeframe is selected in the Timeframe input, the value
of the current forming bar updates until that bar closes. Historical
values do not repaint. Indicator

Nadaraya-Watson Trend [QuantAlgo]🟢 Overview
The Nadaraya-Watson Trend indicator estimates a smooth, adaptive trend path by applying non-parametric kernel regression directly to price. For each bar it weights historical values inside a configurable lookback window with a chosen kernel function, normalizes those weights, and returns a single endpoint estimate that forms the plotted trend line. Bandwidth and kernel type control how aggressively recent bars dominate the estimate, optional residual bands express how far price is dispersed around that path, and slope based coloring with reversal markers make direction and turning points readable at a glance across any timeframe or instrument.
🟢 How It Works
The indicator is built around a one sided Nadaraya-Watson (NW) estimator: only the current bar and past bars enter the calculation, so the path behaves as a causal smoother rather than a centered, repainting fit. The pipeline has three stages: kernel weighting over the lookback window, normalized regression into a single trend value, and optional residual band construction from the same estimate.
First, effective bandwidth is formed from the configured bandwidth and multiplier. Each lag distance is then mapped to a kernel weight. Gaussian and Rational Quadratic keep infinite support with different decay shapes. Compact kernels (Epanechnikov, Triangular, Quartic, Cosine) only assign weight while the normalized lag stays inside the unit interval:
kernel_weight(float dist, float h, string ktype, float rq) =>
float w = 0.0
if h > 0.0
float u = dist / h
if ktype == 'Gaussian'
w := math.exp(-(dist * dist) / (2.0 * h * h))
else if ktype == 'Rational Quadratic'
w := math.pow(1.0 + (dist * dist) / (2.0 * rq * h * h), -rq)
else if math.abs(u) <= 1.0
if ktype == 'Epanechnikov'
w := 0.75 * (1.0 - u * u)
else if ktype == 'Triangular'
w := 1.0 - math.abs(u)
else if ktype == 'Quartic'
w := (15.0 / 16.0) * math.pow(1.0 - u * u, 2.0)
else if ktype == 'Cosine'
w := (math.pi / 4.0) * math.cos(math.pi * u / 2.0)
w
float h = bandwidth * h_mult
Next, the Nadaraya-Watson path is computed as the normalized weighted average of the selected source across the lookback window. Nearer bars dominate when bandwidth is low. Weight spreads more evenly when bandwidth is high, producing a smoother path:
float sum_w = 0.0
float sum_p = 0.0
for i = 0 to lookback
float w = kernel_weight(i, h, kernel_type, rel_weight)
sum_w += w
sum_p += src * w
float nw_trend = sum_w != 0.0 ? sum_p / sum_w : na
Finally, residual bands can be drawn from a kernel weighted mean absolute residual of the source versus the current NW estimate, scaled by the band multiplier. When price is tightly clustered around the path the envelope contracts. When price is dispersed the envelope expands, framing extension and compression relative to the same estimator that defines the trend:
float sum_abs = 0.0
float sum_res_w = 0.0
for i = 0 to lookback
float w = kernel_weight(i, h, kernel_type, rel_weight)
if w > 0.0 and not na(src ) and not na(nw_trend)
sum_abs += w * math.abs(src - nw_trend)
sum_res_w += w
float residual = sum_res_w != 0.0 ? sum_abs / sum_res_w : na
float upper = not na(nw_trend) and not na(residual) ? nw_trend + residual * band_mult : na
float lower = not na(nw_trend) and not na(residual) ? nw_trend - residual * band_mult : na
🟢 Signal Interpretation
▶ Bullish Path (Rising NW Line with Bullish Color): When the Nadaraya-Watson estimate is increasing bar to bar, the path and optional gradient fill plot in the bullish color, reading as an uptrend in the kernel smoothed series. Treat this as a long bias: strongest on the reversal marker with price holding above the path, or on pullbacks that respect the path while slope stays up. Bias weakens if price loses the path and the slope flattens or flips down.
▶ Bearish Path (Falling NW Line with Bearish Color): When the estimate is decreasing bar to bar, the path and fill plot in the bearish color, reading as a downtrend in the kernel smoothed series. Treat this as a short bias: strongest on the reversal marker with price holding below the path, or on bounces that fail at the path while slope stays down. Bias weakens if price reclaims the path and the slope flattens or flips up.
▶ Residual Bands (Optional Envelope Around the Path): With residual bands enabled, the upper and lower lines track a scaled kernel weighted residual around the NW path. Touches or closes beyond the outer band highlight price stretched away from the estimate. Returns toward the path after an extension often mark mean reversion relative to the kernel trend rather than a full regime change. Band width is derived from how widely the source has been scattered around the current NW estimate inside the lookback window
🟢 Features
▶ Preconfigured Presets: Three parameter sets tuned for different trading styles and timeframes. "Default" delivers balanced trend estimation for swing trading on 1H to daily charts, smoothing short lived noise while still responding to genuine directional turns. "Fast Response" is built for intraday work on 5 minute to 1H charts, keeping the path tighter to recent structure so turns register earlier at the cost of more frequent reversals in chop. "Smooth Trend" is aimed at position style reading on daily and weekly charts, forming a more stable baseline that flips only when the kernel path itself shifts with more conviction. Kernel type, residual bands, and visual options stay independently configurable under every preset.
▶ Kernel Library: Six kernel functions expand how the same endpoint Nadaraya-Watson framework assigns weight across the window. Gaussian is the classic smooth default with infinite support. Epanechnikov, Triangular, Quartic, and Cosine are compact kernels that fully exclude bars beyond the bandwidth scale. Rational Quadratic keeps infinite support with heavier tails, and its Relative Weighting input controls how much influence farther bars retain versus a Gaussian like decay. Switching kernels changes the shape of the single plotted path without adding a second model or external oscillator.
▶ Residual Bands: Optional envelope around the NW path built from kernel weighted mean absolute residuals of the source versus the estimate, scaled by Band Multiplier. Enable when you want extension and compression context around the same trend line. Disable when you want only the path, gradient, and markers.
▶ Built-in Alerts: Five alert conditions support hands off monitoring. "Bullish Kernel Reversal" fires on the bar the path slope flips from down to up. "Bearish Kernel Reversal" fires on the bar the path slope flips from up to down. "Any Kernel Reversal" fires on either directional flip. "Source Cross Above Upper Band" and "Source Cross Below Lower Band" fire when the selected source crosses the residual envelope extremes. Alert messages include exchange, ticker, and timeframe for immediate context.
▶ Visual Customisation: Six color presets (Classic, Aqua, Cosmic, Cyber, Neon, and Custom) apply coordinated bullish and bearish colors to the path, gradient fill, residual bands, markers, optional bar coloring, and optional background coloring. Custom unlocks independent bullish and bearish color pickers. Gradient fill, residual bands, reversal markers, bar coloring, and background coloring can each be toggled so the chart stays as clean or as expressive as the workflow requires.
Indicator

Indicator

Flow Pressure Zones [BOSWaves]Volume Flow Zones - Body-Ratio Volume Flow Scoring with Baseline Fuel Visualization and Counter-Trend Reversal Zone Detection
Overview
Volume Flow Zones is a volume-weighted flow intensity system that scores each bar by the combined strength of its body-to-range ratio and volume participation relative to its rolling average, where baseline fuel candle height, price candle gradient intensity, and reversal zone placement are all driven by this normalized flow score rather than fixed thresholds or arbitrary indicator crossovers.
Instead of relying on raw volume or price direction alone, the flow score combines how convincingly price moved within the bar's range with how significant the bar's volume was relative to recent history, producing a single normalized conviction reading that reflects both the directional commitment and the participation weight behind each bar. This score then drives every visual layer of the indicator simultaneously, from the height of the fuel candles on the baseline to the brightness of the price candle coloring to the conditions required for a reversal zone to be planted.
This creates a flow monitoring framework that communicates momentum quality continuously rather than at discrete signal events. The baseline fuel candles grow and shrink with the flow score on every bar, the glow around the WMA baseline intensifies during high-flow periods, price candles brighten toward full trend color during strong participation and dim toward neutral during weak flow, and yellow reversal candles fire when meaningful counter-trend flow appears against the prevailing trend direction, at which point a forward-projecting reversal zone is planted at the bar's extreme.
Price is therefore evaluated not just for direction relative to the baseline but for the quality and intensity of the flow supporting that direction on every bar.
Conceptual Framework
Volume Flow Zones is founded on the principle that directional price movement carries meaningfully different conviction depending on how decisively price closed within the bar's range and how significantly volume participated relative to recent norms, and that these two dimensions together produce a more reliable flow quality reading than either dimension alone.
Traditional momentum tools measure direction through crossovers or oscillator levels that treat all bars equally regardless of whether a move was driven by decisive high-volume conviction or by drifting low-volume noise. This framework replaces uniform direction measurement with a per-bar flow quality score that distinguishes between genuine momentum and low-conviction price movement, encoding that distinction across every visual element so that chart reading reflects real participation dynamics rather than mechanical indicator states.
Three core principles guide the design:
Flow quality should be measured by combining body dominance within the bar range with volume significance relative to the rolling average, producing a score that captures both directional decisiveness and participation weight simultaneously.
The flow score should drive all visual outputs proportionally and continuously, with fuel candle height, price candle brightness, and baseline glow all scaling in real time to the current flow reading rather than switching between fixed states.
Counter-trend flow events meeting minimum quality thresholds should generate forward-projecting reversal zones anchored to the bar extreme where the opposing flow appeared, marking structural reference levels for potential trend exhaustion and reversal.
This shifts trend analysis from binary directional state monitoring into continuous flow quality measurement where visual intensity across every chart layer communicates conviction strength in real time.
Theoretical Foundation
The indicator combines WMA-based trend direction, body-to-range ratio measurement, volume SMA normalization, flow score derivation with rolling normalization, reversal detection through close position and volume threshold testing, and an ATR-scaled fuel candle system that projects flow intensity visually from the baseline.
The WMA baseline provides a weighted directional reference that gives greater importance to recent price activity, establishing the trend context that determines fuel candle positioning and reversal direction qualification. The body ratio measures what fraction of the bar's total range the body occupies, with higher ratios indicating more decisive directional commitment. Volume normalization divides each bar's volume by its SMA baseline and caps the result at three, preventing extreme volume spikes from overwhelming the score. The raw flow score multiplies body ratio by normalized volume, and a rolling highest-lowest normalization converts the raw score to a 0-1 range that adapts to the instrument's typical flow distribution. Reversal detection tests close position within the range, bar direction, and volume normalization simultaneously, requiring all three conditions to be met before a reversal event qualifies.
Four internal systems operate in tandem:
Flow Score Engine : Calculates body ratio from open-close range divided by high-low range, normalizes volume against its SMA baseline, multiplies the two to produce raw flow, then normalizes the raw flow against its rolling highest and lowest values to produce the final 0-1 score that drives all downstream visual systems.
Baseline Fuel Candle System : Positions ATR-scaled candles above the baseline for bearish trends and below for bullish trends, scaling their height proportionally to the current flow score so that fuel candle length grows and shrinks with each bar's flow intensity and coloring intensifies with a power-transformed opacity gradient.
Price Candle Gradient System : Colors chart candles from a dimmed version of the trend color at low flow scores to full saturation at high flow scores using a power-transformed gradient, with yellow override on any bar where counter-trend reversal conditions are met regardless of trend state.
Flow Reversal Zone Engine : Monitors for qualifying counter-trend flow events meeting close position, direction, and volume thresholds above the minimum flow score, plants ATR-scaled zones with dashed midlines at the bar extreme on confirmed qualifying bars subject to cooldown enforcement, extends zones forward until price closes through them on two consecutive bars.
This design allows every chart element to reflect the current flow score simultaneously while the reversal zone system independently tracks and maps the structural locations where meaningful counter-trend flow appeared.
How It Works
Volume Flow Zones evaluates price through a sequence of flow-aware scoring and visualization processes:
WMA Baseline Calculation : The Weighted Moving Average is calculated over the configured length, with trend direction determined by whether close is above or below the baseline on each bar.
Body Ratio Measurement : The absolute difference between close and open is divided by the high-low range to produce a 0-1 body ratio, with higher values indicating bars where price moved decisively in one direction relative to its total range.
Volume Normalization : Raw volume is divided by the Volume SMA baseline and capped at 3.0, producing a score that reflects whether the bar's participation was below average, average, or significantly above average relative to recent history.
Raw Flow Calculation : Body ratio is multiplied by normalized volume to combine directional decisiveness with participation weight into a single raw flow reading.
Rolling Normalization : The raw flow is normalized against its highest and lowest values over the configured lookback window, producing a 0-1 score that adapts to the instrument's typical flow range and maintains consistent visual scaling across different volatility regimes.
Reversal Condition Testing : Counter-trend pressure is identified when close position within the bar range is below 0.35 on a down-close bar with volume above 1.2 times SMA for bearish pressure, or above 0.65 on an up-close bar with the same volume threshold for bullish pressure. These conditions combined with the flow score threshold and trend direction determine whether a reversal event qualifies.
Price Candle Coloring : The normalized flow score is power-transformed and mapped to a gradient between a dimmed and full-saturation version of the trend color. Reversal bars override this coloring with full yellow regardless of score or trend direction.
Fuel Candle Rendering : ATR-scaled open and close prices are calculated from the WMA with the configured offset, with candle height proportional to the flow score. Fuel candles render below the baseline during uptrends and above during downtrends, with opacity power-transformed from the flow score and yellow coloring applied on reversal bars.
Baseline Glow Rendering : A wide low-opacity version of the WMA line and a thinner core line are plotted with transparency inversely proportional to a smoothed flow average, producing a glow effect that intensifies during sustained high-flow periods.
Reversal Zone Planting : On confirmed reversal bars satisfying the cooldown requirement, an ATR-scaled zone is planted centered on the bar's low for bullish reversals and high for bearish reversals, with a dashed midline and forward extension. Overlapping same-direction zones are removed before the new zone is added.
Zone Lifecycle Management : All active zones extend rightward on each bar. When close has been below the zone bottom for two consecutive bars for bullish zones or above the zone top for two consecutive bars for bearish zones, the zone is deleted.
Together, these elements form a continuously updating flow monitoring system where baseline fuel candles, price candle gradients, and reversal zones all derive from the same underlying flow score, producing a visually unified conviction map across every chart element.
Interpretation
Volume Flow Zones should be interpreted as a flow quality visualization system with structural counter-trend zone mapping:
WMA Baseline : The Weighted Moving Average provides the primary trend reference with a glow that brightens during sustained high-flow periods, providing an immediate visual indicator of whether the current trend is being supported by strong or weak participation.
Bullish Trend State (Green) : Active when close is above the WMA, with fuel candles projecting below the baseline and price candles coloring green with intensity scaling from the flow score.
Bearish Trend State (Red) : Active when close is below the WMA, with fuel candles projecting above the baseline and price candles coloring red with intensity scaling from the flow score.
Fuel Candle Height : The primary flow intensity indicator, growing with each bar's flow score and shrinking during low-conviction periods. Tall fuel candles indicate strong directional participation. Short or barely visible fuel candles indicate weak flow with low conviction behind the current price movement.
Fuel Candle Opacity : The transparency of each fuel candle further encodes flow strength, with near-opaque candles representing peak-intensity flow events and highly transparent candles representing low-intensity bars.
Price Candle Gradient : Price candles brighten toward full trend color saturation at high flow scores and dim toward a muted version of the trend color at low flow scores, providing an immediate bar-level conviction reading directly on the candlestick.
Yellow Candles : Both the price candle and fuel candle flash yellow on bars where qualifying counter-trend flow is detected, immediately identifying potential exhaustion or reversal events within the current trend.
Flow Reversal Zones : Horizontal zones with dashed midlines planted at bar extremes where qualifying counter-trend flow appeared, projecting forward as structural reference levels for the price level where opposing flow was significant enough to register. Bullish reversal zones are colored green, bearish reversal zones red.
Fuel candle height dynamics, price candle brightness, yellow reversal identification, and zone proximity collectively provide more flow intelligence than any element in isolation.
Signal Logic & Visual Cues
Volume Flow Zones presents two primary reversal signal types alongside continuous flow intensity monitoring:
Bullish Reversal (Yellow) : Triggered when price closes in the upper portion of the bar's range on an up-close bar with above-average volume during a downtrend, with flow score exceeding the minimum threshold. Plants a bullish reversal zone below the bar and flashes both price and fuel candles yellow.
Bearish Reversal (Yellow) : Triggered when price closes in the lower portion of the bar's range on a down-close bar with above-average volume during an uptrend, with flow score exceeding the minimum threshold. Plants a bearish reversal zone above the bar and flashes both price and fuel candles yellow.
Zone cooldown enforcement prevents multiple zones from planting in rapid succession, spacing reversal references to only the most significant qualifying events within each cooldown window.
Alert generation covers bullish and bearish reversal flow events and WMA bullish and bearish flips for systematic trend monitoring workflows.
Strategy Integration
Volume Flow Zones fits within flow-informed trend-following and counter-trend monitoring approaches:
Fuel Candle Conviction Reading : Use fuel candle height as a continuous trend health gauge. Consistently tall fuel candles during a trend indicate sustained directional commitment. Progressively shrinking fuel candles within an established trend suggest flow is weakening before any price indicator or crossover confirms the deterioration.
Yellow Candle Context : Use yellow reversal candles as early warning signals within trends rather than as standalone entry triggers. A single yellow candle mid-trend may indicate temporary absorption. Multiple yellow candles within a short window suggest building counter-trend pressure warranting reduced confidence in continuation.
Reversal Zone Reference Trading : Use planted reversal zones as structural reference levels where meaningful opposing flow previously appeared. Price returning to these zones encounters the price level where prior counter-trend activity was significant enough to meet the reversal detection criteria.
WMA Flip Entries : Use WMA direction changes combined with high fuel candle readings immediately following the flip as trend initiation entries, favoring flips that coincide with strong flow scores over flips that occur during low-conviction flow conditions.
Flow Divergence Detection : Monitor for situations where price is making new highs or lows but fuel candle height is diminishing, indicating that price extension is occurring on weakening flow and increasing the probability of reversal or consolidation.
Multi-Timeframe Flow Alignment : Apply higher-timeframe WMA direction and fuel candle intensity as directional context filters, engaging with lower-timeframe reversal zones and yellow candle signals only when they align with the broader flow state established on the higher timeframe.
Technical Implementation Details
Baseline Engine : Weighted Moving Average with configurable length for trend direction and fuel candle anchoring
Flow Score : Body-to-range ratio multiplied by volume SMA normalization with rolling highest-lowest normalization over configurable lookback
Reversal Detection : Close position threshold, bar direction, and volume normalization minimum combined with flow score floor and trend direction gating
Fuel Candles : ATR-scaled height with configurable multiplier and baseline offset, power-transformed opacity gradient, yellow override on reversal bars
Price Candles : Power-transformed flow gradient from dimmed to saturated trend color with full yellow override on reversal bars
Baseline Glow : Dual-line wide and narrow WMA plots with transparency inversely proportional to smoothed flow average
Zone System : Array-managed ATR-scaled zone boxes with dashed midlines, cooldown enforcement, overlap removal, forward extension, and two-bar consecutive close breach invalidation
Performance Profile : Optimized for real-time execution with configurable zone count cap and array-based lifecycle management
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday flow monitoring for scalping with shorter WMA and normalization lengths for faster flow score adaptation to intraday momentum shifts
15 - 60 min : Session-level trend flow tracking with balanced WMA length and moderate zone cooldown for meaningful reversal zone spacing across typical session moves
4H - Daily : Swing-level flow quality monitoring with longer WMA and normalization lookback for sustained flow readings across multi-session directional moves
Suggested Baseline Configuration:
WMA Length : 80
Volume SMA : 20
Normalization Lookback : 80
Offset (ATR%) : 0.4
Candle Height : 2.0
Show Reversal Zones : Enabled
Zone Cooldown : 31
Max Zones : 3
Show Fuel Candles : Enabled
Show Baseline : Enabled
Show Baseline Glow : Enabled
Color Price Candles : Enabled (requires disabling original chart candles in chart settings)
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's volatility characteristics, volume behavior, and preferred signal density, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Fuel candles too tall or too short : Adjust Candle Height to scale the maximum fuel candle height relative to ATR. Lower values produce more subtle fuel visualization, higher values produce more prominent height differences between high and low flow bars.
Fuel candles too close or far from price : Adjust Offset (ATR%) to control the gap between the WMA baseline and the near edge of the fuel candles, adapting visual separation to the instrument's typical ATR range.
Flow score too reactive : Increase Normalization Lookback to smooth the normalization window, requiring more bars to recalibrate the flow range and reducing sensitivity to short-term volume spikes.
Flow score too slow to adapt : Decrease Normalization Lookback for faster recalibration of the flow score range, allowing the system to adapt more quickly to changing volatility and volume conditions.
Too many reversal zones forming : Increase Zone Cooldown to enforce greater bar separation between consecutive zone plants, or reduce Max Zones to limit the total number of active reference levels on the chart.
Reversal zones too narrow or wide : Adjust Zone Height (ATR×) to scale the vertical size of each reversal zone relative to ATR, calibrating zone thickness to the instrument's typical noise range at the target timeframe.
WMA too reactive to price : Increase WMA Length for a smoother baseline that filters minor oscillations and reduces frequency of trend direction changes, producing more stable fuel candle positioning and cleaner reversal zone direction assignments.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional momentum where fuel candle height builds during impulse phases and provides early warning of conviction decay before price reverses
Instruments with consistent volume participation where SMA normalization accurately identifies above-average bars and the flow score reliably differentiates high and low conviction moves
Flow divergence strategies where declining fuel candle height during price extension provides early deterioration signals before conventional indicators confirm reversal
Counter-trend monitoring approaches where reversal zones mark the precise price levels where meaningful opposing flow appeared for use as structural reference in subsequent analysis
Reduced Effectiveness:
Choppy, low-volume markets where body ratios are consistently low and volume normalization produces undifferentiated scores, reducing fuel candle height variation and generating frequent yellow candles without meaningful reversal context
Instruments with highly irregular volume distribution where the SMA normalization baseline is distorted by outlier sessions, producing unreliable flow score rankings across typical bars
Extremely fast-moving markets where large body ratios are consistently present on almost every bar, compressing the flow score range and reducing the visual differentiation between high and low conviction periods
Low-ATR instruments where the fuel candle geometry produces visually imperceptible height differences, requiring manual candle height and offset adjustment to produce meaningful visual scaling
Consolidation and sideways conditions where volume participation is mixed and body ratios are low, producing uniformly short fuel candles and frequent yellow candles without the trend context that makes reversal detection structurally meaningful
Integration Guidelines
Confluence : Combine with BOSWaves structural tools, order block analysis, or momentum oscillators to validate reversal zone interactions and yellow candle events with broader analytical context
Fuel Candle Trend Health : Monitor fuel candle height evolution throughout established trends as a continuous conviction health indicator. Progressively shrinking fuel candles during a sustained trend suggest flow deterioration that may precede reversal before price structure confirms the change.
Yellow Candle Clustering : Single isolated yellow candles within a trend carry less weight than clusters of two or more within a short window. Clusters suggest building counter-trend participation that is approaching the threshold required to challenge the prevailing flow direction.
Zone Freshness : Prioritize recently planted reversal zones over older ones. Fresh zones reflect current session flow dynamics while older zones may have formed under different volume and volatility conditions that are no longer representative.
State Discipline : Maintain directional bias aligned with the current WMA trend state until a confirmed WMA direction change occurs. Yellow candles and reversal zones within an established trend are monitoring signals rather than automatic exit triggers and should be interpreted as context rather than directional commands.
Disclaimer
Volume Flow Zones is a professional-grade flow quality analysis and counter-trend monitoring tool. It uses body-ratio volume flow scoring with rolling normalization and reversal zone detection but does not predict future price movements. Results depend on market conditions, instrument volume characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates price structure, order flow context, and comprehensive risk management. Indicator

Indicator

Helix Lucky MTF Bias and Breakout DashboardHelix Lucky MTF Trend and Breakout Dashboard
📊 Overview
Helix Lucky MTF Trend and Breakout Dashboard is an overlay indicator designed to organize trend, momentum, breakout context, key levels, and multi-timeframe alignment into one chart-based dashboard.
The purpose of the script is not to combine unrelated indicators into a single display. The script separates market analysis into distinct layers so each component has a specific role:
1. Trend structure
2. Momentum confirmation
3. Breakout context
4. Multi-timeframe alignment
5. Key level awareness
6. Setup scoring
7. Optional visual confirmation tools
The result is a confluence-based workflow that helps traders review whether multiple independent conditions are aligned before making a trading decision.
🧩 How the Main Components Work Together
The script uses moving averages, VWAP, MACD, ZLSMA, UT Bot logic, Supertrend, ADX, RSI, and Opening Range Breakout logic as separate inputs within the same framework.
The moving average group provides basic trend structure by comparing shorter-term and longer-term averages. The default structure uses a fast EMA, medium EMA, and long SMA, but users can configure the moving average types and lengths.
VWAP provides session or higher-period price-location context. It can be anchored to the session, day, week, month, quarter, or year and may be displayed with standard deviation or percentage-based bands.
MACD is used as a momentum confirmation layer. The script includes a minimum separation filter so very small MACD differences can be filtered out instead of being treated the same as stronger momentum shifts.
ZLSMA is optional and can be used as an additional trend-direction filter.
The UT Bot component is used as the primary chart label engine. It uses an ATR-based adaptive trailing stop. The script adjusts the trailing distance using volatility, momentum, and volume conditions, then produces Buy or Sell labels when price crosses the trailing stop and the configured filters allow the signal.
Supertrend provides a separate trend-regime layer. This gives the user a second way to compare the UT Bot label against a broader trend condition.
ADX is used to evaluate whether trend strength is above the user-selected threshold. RSI can be used either in a classic 30/70 bias mode or with custom pullback zones.
The Opening Range Breakout component tracks whether price is above, below, or inside the selected opening range window. This helps separate trend-following conditions from range-bound conditions.
🧠 Why This Is More Than a Simple Mashup
Each component is assigned a different purpose. The script is designed so the same tools are not all treated as equal standalone signals.
Trend tools identify direction.
Momentum tools evaluate confirmation.
Volume and relative volume help evaluate participation.
Opening Range Breakout logic identifies range expansion.
The Bias Table compares selected conditions across multiple timeframes.
The Price Point Dashboard displays important reference levels and live context.
The scoring layer organizes these conditions into a rule-based summary.
This structure allows the script to reduce chart clutter while still showing how the underlying conditions agree or disagree.
🕒 Multi-Timeframe Bias Table
The Multi-Timeframe Bias Table displays up to eight selectable timeframes, including 1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, and Daily.
Each row evaluates one condition, such as moving average structure, price relative to VWAP, MACD alignment, Supertrend direction, ZLSMA slope, RSI condition, ADX threshold, Opening Range Breakout status, and longer-period bias.
The table also includes an average agreement reading. This reading is not a prediction and does not represent a win rate. It simply shows how many selected conditions are aligned across the active timeframes.
By default, the script can hide timeframes below the current chart timeframe. This is intended to reduce lower-timeframe noise when viewing higher-timeframe charts.
📍 Price Point Dashboard
The Price Point Dashboard displays reference levels and market context in one location. These can include prior day high, prior day low, prior day close, pivot levels, moving averages, 52-week high, Fibonacci reference levels, VWAP information, Opening Range Breakout status, ATR, gap percentage, relative volume, and other selected dashboard fields.
The dashboard is intended to help users see where price is trading relative to important reference levels without manually adding each level to the chart.
📈 Trend Strength Score
The Trend Strength Score is a rule-based 0 to 100 score that measures how strongly the current bar aligns with selected bullish trend conditions.
The score uses five weighted components:
- EMA alignment
- VWAP location
- MACD alignment
- Supertrend direction
- ADX strength
The score is a summary of internal conditions only. It does not predict future price movement.
🎯 Trade Probability Score
The Trade Probability Score is a rule-based 0 to 100 setup-quality score. It is calculated from twelve weighted factors:
- Multi-timeframe alignment
- EMA stack
- VWAP location
- Price relative to the 200-period moving average
- MACD alignment
- Supertrend direction
- ADX strength
- Relative volume
- Opening Range Breakout status
- Relative strength versus a selected benchmark
- Volatility state
- Position relative to key levels
The score is intended to summarize confluence. A higher score means more of the script’s internal conditions are aligned. It does not mean that a trade will be profitable, and it should not be interpreted as a guaranteed probability of success.
💧 Liquidity Sweep Detection
The script can detect liquidity sweep conditions by checking whether price moves beyond a recent swing high or swing low and then closes back inside that level.
A Sweep High label indicates that price moved above a recent high and then closed back below that level.
A Sweep Low label indicates that price moved below a recent low and then closed back above that level.
These labels are intended to identify possible rejection behavior around recent swing points. They should be used as context, not as standalone trade signals.
⚖️ Relative Strength
The script includes relative strength comparison against configurable benchmark symbols. The default benchmarks are QQQ and SPY.
Relative strength is calculated by comparing the current symbol’s intraday return against the benchmark’s intraday return. A positive value means the current symbol is outperforming the benchmark over that comparison period. A negative value means it is underperforming.
🌡️ Volatility State
The Volatility State feature classifies the current volatility environment as Squeeze, Normal, or Expansion.
This is based on Bollinger Band width compared with Keltner Channel width and recent volatility behavior.
Squeeze indicates compressed volatility.
Normal indicates a standard volatility environment.
Expansion indicates that volatility has increased relative to recent conditions.
This feature is included to help users understand whether price is consolidating, behaving normally, or expanding in volatility.
🕯️ Candlestick Pattern Labels
The script includes optional candlestick pattern labels. These patterns are detected on the same timeframe as the chart. They are not calculated from a separate hidden timeframe.
Optional labels include:
- Bullish Engulfing
- Bearish Engulfing
- Hammer
- Shooting Star
- Morning Star
- Evening Star
- Inside Bar
- Tweezer Top
- Tweezer Bottom
- Doji
- Dragonfly Doji
- Gravestone Doji
- Sweep High
- Sweep Low
These labels are intended as additional context. They should not be treated as standalone entries without reviewing trend, momentum, volatility, and key-level context.
🛑 Suggested Stop Loss and Take Profit Reference Lines
The script can plot suggested stop loss and take profit reference lines after a UT Bot label appears.
The stop line is calculated from internal structure such as the UT Bot stop, Supertrend, VWAP, moving average, Donchian floor, and a minimum ATR-based risk floor depending on settings and context.
Take profit reference lines are based on R-multiple distances from the suggested stop. These are visual planning tools only. They do not place trades, manage positions, or execute orders.
🧭 How to Use the Script
A typical workflow is:
1. Select the chart timeframe and market being reviewed.
2. Review the Multi-Timeframe Bias Table to understand directional alignment.
3. Check whether the chart is trending, ranging, breaking out, or consolidating.
4. Review the Price Point Dashboard for key levels and market context.
5. Watch for a UT Bot Buy or Sell label if labels are enabled.
6. Compare the label direction with Supertrend, MACD, VWAP, ADX, and the Bias Table.
7. Review the Trend Strength Score and Trade Probability Score as confluence summaries.
8. Use the suggested stop and take profit reference lines only as visual planning tools.
9. Apply independent risk management and confirm the setup with your own analysis.
🌍 Timeframes and Markets
The script can be applied to different chart timeframes and PulseWire-supported markets. Lower timeframes may produce more signals and more noise. Higher timeframes may produce fewer signals but can provide broader context.
The Multi-Timeframe Bias Table is intended to help users avoid looking at a single timeframe in isolation.
⚠️ Important Limitations
This script is an indicator, not a strategy. It does not place trades, backtest trades, manage orders, or connect to a brokerage account.
The scoring systems are rule-based summaries of current chart conditions. They are not win-rate models, machine-learning predictions, or guarantees of future results.
Signals, labels, and dashboard values can vary by symbol, timeframe, liquidity, volatility, and user settings.
The Bias Table is a live context dashboard and may update while the current bar is forming. This is expected behavior because some values are based on developing bar data.
The “Draw visuals only on bar close” setting gates the UT Bot entry visuals and suggested stop/take-profit drawings to confirmed bars. It does not freeze every live dashboard value while a bar is developing.
Liquidity Sweep labels can be gated to bar close using the Bar Close Only setting.
The script is designed for standard chart analysis. Signals on non-standard chart types may behave differently because those chart types can use synthetic price construction.
No signal, score, table reading, or label should be used as a guarantee of future price movement. Users should apply their own analysis and risk management.
🧾 Credits and Inspiration
This script was inspired by the concept of combining a multi-timeframe bias table, trend labels, and a price-level dashboard into one overlay.
The current script is a ground-up Pine Script v6 implementation with additional architecture, including the rule-based Trade Probability Score, Trend Strength Score, liquidity sweep detection, relative strength comparison, volatility state classification, configurable dashboards, candlestick pattern labels, and suggested risk-reference lines.
The script also uses common technical analysis concepts such as moving averages, VWAP, MACD, RSI, ADX, ATR, Supertrend-style trend logic, and Opening Range Breakout logic. These common concepts are organized into a single decision-support framework rather than presented as separate standalone indicators. Indicator

Viprasol Liquidity Trail Matrix with Signal TargetOverview
The Viprasol Liquidity Trail Matrix with Signal Target is a trend-following signal engine that combines a volatility-adaptive trailing "liquidity" band structure with a Cardwell-style RSI regime filter, then turns confirmed pullback-and-continuation events into fully managed trade plans — entry, stop, three scaled targets, break-even logic, and an honest performance read-out. It is built for discretionary traders who want a single tool that answers three questions at once: what is the trend, is momentum backing it, and if a signal fires, exactly where are my entry, stop and targets.
This is an open-source, credited derivative. See the Credits & Originality section at the end — the trailing-matrix and Cardwell-RSI concepts are adapted from prior open-source work under CC BY-NC, with substantial original additions layered on top.
How It Works
Step 1 — Liquidity Trail Matrix (adapted)
A volatility trailing stop (ATR-scaled) defines the active trend and flips only when price closes decisively through it. Around that trailing line the script projects a ladder of "liquidity bands" spaced in ATR units, forming the retest zone price tends to revisit before continuation. In an uptrend the bands sit below price as stacked support; in a downtrend, above price as resistance. Because the spacing is ATR-based, the whole structure widens in volatile conditions and tightens in quiet ones.
Step 2 — Cardwell RSI Regime (adapted)
RSI is classified into a directional regime using Andrew Cardwell's range-rules principle: in a healthy uptrend RSI holds its 40-80 band, in a downtrend it works the 20-60 band. The regime flips bull when RSI thrusts through the upper trigger and bear when it breaks the lower trigger, holding state in between. Signals are only allowed in agreement with the regime, so the momentum context must confirm the trend before anything fires.
Step 3 — Confluence gating (adapted + new)
Before a signal is eligible it must pass a confluence gate: trend agreement, RSI regime agreement, an ADX minimum (chop filter), and an optional higher-timeframe bias pulled non-repainting (previous HTF bar, lookahead off). A minimum confluence score suppresses low-quality setups.
Step 4 — Retest entry + Signal Target (adapted)
When the confluence conditions hold and price pulls back into the band zone then closes back in the trend direction, a signal fires on the confirmed bar. The engine sets a structural stop, then projects TP1/TP2/TP3 as R-multiples of that risk and draws them on the chart with price and percent labels. Break-even logic moves the stop to entry after TP1.
Step 5 — Honest trade management + statistics (new)
Original additions in this release:
- One-trade-at-a-time engine: a trend flip no longer force-closes a trade. A position runs to its stop or final target, and a new entry only opens once the previous one is fully resolved. A reversal toggle restores the old flip-reversal behaviour if preferred.
- Max-bars-in-trade timeout so a lingering position cannot block the engine indefinitely.
- Hide-on-hit targets: each target line and label is removed the instant it is touched, keeping the chart clean.
- Staggered target labels so ENTRY/SL/TP1/TP2/TP3 never overlap.
- Session filter and post-stop cooldown (both optional, off by default).
- Honest performance panel: Avg R and Profit Factor computed on a transparent one-third-scale-out model, plus Max Drawdown in R and best/worst streak — so the win-rate (which counts a trade a win once TP1 is touched) is read alongside true expectancy.
- Suggested position size from an account-size and risk-percent input.
Non-repainting: trend, structure, signals and targets confirm at bar close; higher-timeframe data uses lookahead off on the previous bar.
Key Features
- Volatility-adaptive trailing liquidity-band matrix
- Cardwell RSI regime filter
- ADX chop filter + optional non-repainting HTF bias
- Range-distributed volume profile (POC / Value Area / low-volume nodes)
- Retest-continuation signals with confluence scoring
- Entry / SL / TP1-TP2-TP3 with R-multiple targets, break-even and hide-on-hit visuals
- One-trade-at-a-time management with optional reversal, timeout, session filter and post-stop cooldown
- Honest stats: win rate, Avg R, Profit Factor, Max Drawdown (R), streak, suggested size
- Multi-section dashboard, trend-tint candles, and a full alert suite with optional webhook JSON
How to Use
1. Add to any liquid symbol and timeframe. Confirm the dashboard reads a clear trend and RSI regime.
2. Wait for a LONG/SHORT marker — it only fires on a confirmed retest that passed the confluence gate. The number on the marker is the confluence score.
3. Trade the drawn plan: entry, stop, and TP1/TP2/TP3. The dashboard mirrors the live levels and, once trades close, shows Avg R / Profit Factor / Max DD so you can judge the edge honestly.
4. Tune selectivity with ADX Minimum and Min Score; tune trade behaviour with the reversal, timeout, session and cooldown settings.
Settings
- Trend Engine: ATR length, trail factor, band count and spacing
- Signals: min score, retest window, cooldown, integration mode, reversal toggle, session filter, post-SL cooldown
- RSI Regime: length, bull/bear triggers, confirm bars, integration mode
- Risk Management: SL mode, break-even, max bars in trade, account size, risk %
- Signal Targets: R-multiples for TP1/TP2/TP3
- Volume Profile / HTF / Dashboard / Colors: display and behaviour toggles, all with tooltips
Alerts
Dynamic alerts (ticker, timeframe, price, score, levels, RSI, regime) for: Long entry, Short entry, TP1/TP2/TP3 hit, break-even, stop-out, reversal, trend flips, and regime shift. Entry alerts can emit webhook-ready JSON.
Limitations & Disclaimer
This is an analysis and trade-planning tool, not a promise of profit. The built-in statistics are a session-level model (they reset on chart reload), assume idealised fills with no slippage or commission, and use a one-third-scale-out assumption for Avg R — real results differ. Signals confirm at bar close and do not repaint historically, but the still-forming bar is provisional until it closes. No indicator predicts the future; always combine with your own risk management. Nothing here is financial advice.
Credits & Originality (CC BY-NC 4.0)
This script adapts and builds upon prior open-source work and is published open-source, free, for non-commercial use, with attribution as required by the licence:
- "Liquidity Trail Matrix" by WillyAlgoTrader — the trailing liquidity-band structure concept.
- "Cardwell Range Analyze" by MarkitTick — the Cardwell RSI range-regime concept.
Changes made by Viprasol (this version): combined the two engines into one workflow and added the confluence gate, non-repainting HTF bias, range-distributed volume profile, R-multiple Signal Targets with break-even and hide-on-hit visuals, one-trade-at-a-time management with reversal toggle / max-bars timeout / session filter / post-stop cooldown, the honest statistics panel (Avg R, Profit Factor, Max Drawdown R, streak) and suggested position size, plus the multi-section dashboard and dynamic/webhook alerts.
Licence: Creative Commons Attribution-NonCommercial 4.0 (creativecommons.org). Educational, non-commercial use only. Not financial advice.
Indicator

Liquidity Trail Matrix [WillyAlgoTrader]📊 Liquidity Trail Matrix (LTM) is an overlay trend-following system that combines a four-band proportional ATR trailing stack, a 5-factor retest quality score (0–100), a non-repainting higher-timeframe bias filter, a range-distributed volume profile of the current trend segment (POC / Value Area / HVN / LVN), and a full trade engine with wick-anchored stops, three R-multiple targets, break-even automation and honest session statistics — all in one indicator.
The core insight: a single trailing stop line gives you a binary answer — "in trend" or "flipped". But price interacts with the liquidity zone around the trail in layers: shallow pullbacks, deep sweeps, and full reversals all look different. LTM replaces the single line with a graded four-band matrix, scores every pullback-and-reclaim by depth, candle quality, volume, higher-timeframe alignment and trend maturity, and overlays where volume actually accumulated during the current trend leg — so you can see whether a retest is landing on real acceptance (HVN / POC) or falling into a volume vacuum (LVN).
Works on all markets (crypto, forex, stocks, indices, commodities) and all timeframes. On zero-volume symbols the profile automatically switches to a range-weighted proxy.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A trailing stop alone tells you the trend direction but nothing about entry quality — every touch of the line looks the same. A volume profile alone shows you where volume traded but has no concept of trend regime or entry timing. A retest signal alone fires on any bounce, whether it happens in a mature trend with higher-timeframe support or in the dying bars of an exhausted move. Used separately, these tools leave you guessing.
LTM chains them into one pipeline:
ATR band stack → trend flip detection → pullback depth measurement → 5-factor quality scoring → HTF bias confirmation → trade engine (entry / SL / TP / BE) → segment volume profile context → session outcome tracking
The band stack defines the trend and, critically, grades how deep each pullback penetrates (Band 1 = shallow, Band 4 = extreme). That depth becomes the largest single component of the retest score. The score is then adjusted by the reclaim candle's close location, relative volume, trend age, and the higher-timeframe EMA-50 bias — five independent dimensions that a plain trailing stop cannot see. Every confirmed signal is handed to the trade engine, which places a structure-aware stop, three risk-multiple targets and manages break-even. Meanwhile the volume profile is rebuilt from the exact flip bar of the current trend, so POC, Value Area and LVN levels always describe this leg — telling you whether your entry sits on volume acceptance or in a vacuum. Finally, every closed trade feeds the on-chart statistics, so the dashboard shows how this exact configuration has behaved on this exact chart.
Remove any link and the chain breaks: without band depth there is no meaningful score; without the score every bounce is a signal; without the segment-anchored profile the volume context is stale; without the trade engine the signals have no defined risk; without stats you never learn whether the settings fit the instrument.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Proportional four-band trail geometry — spacing that scales with width.
Most multi-line trails use fixed offsets (base, base+1, base+2 ATR). LTM computes every band as a proportion of the base multiplier:
Band K distance = base × (1 + K_offset × step), giving four multipliers:
— m1 = base
— m2 = base × (1 + step)
— m3 = base × (1 + 2 × step)
— m4 = base × (1 + 3 × step)
With the default Balanced preset (base 4.0, step 0.25) that yields 4.0 / 5.0 / 6.0 / 7.0 ATR. Because spacing is proportional, the geometry of the stack stays visually and behaviorally consistent whether you run tight Scalping bands (2.5 × ATR, step 0.20) or wide Deep Trend bands (6.0 × ATR, step 0.30). Each band ratchets independently (max-lock in uptrends, min-lock in downtrends) and never loosens.
Why this matters: fixed +1/+2/+3 offsets make the stack proportionally "fat" at small base values and "thin" at large ones — proportional spacing keeps pullback depth grading meaningful at any width.
2️⃣ Selectable flip depth — you choose which band defines a reversal.
The trend flips only when price closes beyond a user-chosen band from the previous bar: Fast (Band 2), Balanced (Band 3, default) or Deep (Band 4). Comparing against the previous bar's band value prevents same-bar feedback between the flip and the band update. A warm-up guard (max(3 × ATR length, 60) bars) suppresses all signals until the ATR stack is statistically stable.
Why this matters: flip sensitivity becomes an explicit, single-purpose setting instead of an accidental side effect of band width.
3️⃣ 5-factor retest quality score (0–100) — every signal explains itself.
When price touches any band and then reclaims Band 1 with a directional candle inside the retest window (default 8 bars), LTM computes:
— 📐 Pullback depth (max 25) : Band 2 touch = 25, Band 3 = 18, Band 1 = 15, Band 4 = 10. The maximum touched depth during the pending window is used. Note the deliberate non-linearity: Band 2 scores highest — deep enough to reset liquidity, not deep enough to threaten the trend. Band 4 sweeps score lowest because they often precede full reversals.
— 🕯️ Reclaim candle (max 20) : close location value CLV = (close − low) / (high − low) for longs (mirrored for shorts). CLV > 0.7 → 20 points, > 0.5 → 12, else 5. A reclaim that closes near its extreme shows commitment.
— 📊 Volume (max 20) : current volume vs. the previous bar's 20-period SMA — the spike must not dampen itself by inflating its own average. Volume > 1.2 × baseline → 20, > 1.0 × → 12, else 5. Symbols without volume data receive a neutral 12.
— 🧭 HTF bias (max 20) : aligned with the higher-timeframe EMA-50 direction → 20, no HTF data → 10, against bias → 0.
— ⏳ Trend age (max 15) : 10–150 bars into the trend → 15 (mature, established), under 10 bars → 8 (unproven), over 150 → 5 (aging).
Signals print only when the total meets the Min Retest Score (default 80) and the shared anti-whipsaw cooldown (default 5 bars, deliberately shared across both directions) has elapsed. Every diamond label shows the score, and its tooltip breaks down all five components — no black-box signals.
4️⃣ Non-repainting higher-timeframe bias.
HTF bias compares the higher timeframe's previous closed bar close against its EMA-50, requested with confirmed-bar indexing so the value never changes retroactively. Bias is a soft score component (0/10/20 points), not a hard filter — counter-bias signals can still print if the other four factors are strong enough.
5️⃣ Segment volume profile — range-distributed, anchored to the live trend leg.
The profile is rebuilt on the last bar from the exact flip bar of the current trend (capped by Max Profile Bars, default 500) — no arbitrary lookback padding. Accumulation is range-distributed: each bar's volume is split across every price bin its high–low range overlaps, weighted by overlap fraction:
bin_volume += bar_volume × overlap(bin, bar_range) / (bar_high − bar_low)
This shows where volume actually traded, not where bars happened to close. From the histogram LTM derives:
— 🟡 POC — the highest-volume bin of the segment, drawn with price and volume label. The strongest magnet / defense level of this leg.
— 📦 Value Area (70%) — expanded symmetrically from POC by always adding the larger neighboring bin until 70% of segment volume is enclosed. VAH / VAL edges act as dynamic S/R.
— 📈 HVN — local volume peaks ≥ 0.55 × POC volume (configurable): acceptance shelves where price tends to stall.
— 🕳️ LVN — local troughs ≤ 0.30 × POC volume inside the Value Area (configurable): volume vacuums that price tends to travel through quickly. Each LVN is labeled and feeds a dedicated break alert.
On symbols with no volume feed (forex, some CFDs) the engine substitutes a true-range proxy per bar, so the profile stays structurally meaningful instead of failing.
6️⃣ Trade engine with strict signal-trade parity.
Every confirmed signal (scored retest or trend flip) acts, with unambiguous rules:
— flat → open a position in the signal direction
— opposite position → reverse (close and enter the new direction on the same bar)
— same-direction position → ignored (no pyramiding, no stop tampering)
There are exactly four closure paths: SL hit, break-even stop-out, TP3 touch, or reversal by an opposite signal. Hit detection uses three safety guards: an entry-bar guard (SL/TP are never evaluated on the entry bar itself), a pessimistic same-bar rule (if a bar touches both SL and a TP, the SL wins — statistics never get the benefit of the doubt), and a break-even latency rule (a stop moved to break-even mid-bar cannot trigger on that same bar — the engine checks against the bar-start stop value).
7️⃣ Wick-anchored stop-loss mode.
Two SL modes at entry:
— Wick-Anchored (default) : SL = signal bar's wick extreme ± 0.25 × ATR buffer, with a minimum distance of 0.5 × ATR enforced. The stop hides behind the structure that produced the signal instead of floating at an arbitrary distance.
— ATR : classic fixed SL Multiplier × ATR from entry.
TP1 / TP2 / TP3 are pure risk multiples of the actual SL distance (defaults 1R / 2R / 3R), so the reward structure automatically adapts to how much room the stop needed. Four risk presets (Conservative 2.5 × ATR SL, TP 1/2/4R; Balanced 1.5, TP 1/2/3R; Aggressive 1.0, TP 1.5/2.5/4R; Scalping 0.8, TP 0.8/1.5/2R) plus full Custom control. Optional break-even moves the stop to entry after TP1.
8️⃣ Honest session statistics with a fixed win definition.
A closed trade counts as a win only if TP1 was touched before closure — including break-even stop-outs after TP1 (you banked at least 1R or protected the position). Everything else is a loss, including reversals that never reached TP1. The dashboard shows closed trades, W/L, win rate with a ▰▱ gauge, and a "Form" strip of the last 10 outcomes. Stats are session-scoped and reset on chart reload — this is transparent live tracking of the current settings on the current chart, not a backtest report.
9️⃣ Trend P&L tracker and theme-aware visual system.
An optional floating label follows price in real time and shows the directional % move since the current trend flip (a falling bear trend shows positive %), anchored by a dotted baseline at the trend start price. The label turns red when the trend is under water. The entire visual layer — band transparencies, heatmap fills, dashboard, profile, SL/TP palette — has separate Dark and Light calibrations (Auto-detected from the chart background), because bright hues that look right on dark charts wash out on white ones. TP lines recolor to solid teal with a ✓ when touched; the SL line dims and the entry label annotates "→ SL (BE)" when break-even activates. SL/TP lines persist after the trade closes as a visual record until the next entry replaces them.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Band geometry: The preset (or Custom inputs) resolves the base multiplier and proportional step; four multipliers m1–m4 are derived and multiplied by ATR (default length 13).
Step 2 — Ratcheting trail: In an uptrend each band only rises (max-lock); in a downtrend only falls (min-lock). On a flip the whole stack re-seeds on the opposite side of price.
Step 3 — Flip detection: A close beyond the previous bar's value of the chosen flip band (2/3/4) reverses the trend state. Flip labels print on confirmed bars after the warm-up period.
Step 4 — Pullback tracking: Any touch of Band 1–4 against the trend arms a pending retest with its maximum depth, valid for the retest window; pendings decay each bar and are voided on a flip.
Step 5 — Reclaim and scoring: A directional close back beyond Band 1 triggers scoring: depth (25) + candle (20) + volume (20) + HTF bias (20) + trend age (15). Score ≥ threshold and cooldown elapsed → confirmed signal on bar close.
Step 6 — Trade engine: The signal opens or reverses a position; SL is placed (wick-anchored or ATR), TP1–TP3 are projected as risk multiples; break-even, TP recolors and the four closure paths are managed bar by bar with pessimistic resolution.
Step 7 — Segment profile: On the last bar the profile is rebuilt from the flip bar: range-distributed accumulation → POC → 70% Value Area expansion → HVN/LVN detection → drawing.
Step 8 — Reporting: The dashboard updates trend state, signal state, profile levels, live trade card and session statistics; alerts fire on bar close in within-bar chronological order (management → closures → reversal → entries → info).
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator to your chart and pick a Band Width Preset: Scalping for 1–15M, Balanced for most timeframes, Deep Trend for D–W position trading.
2. Set the Higher Timeframe Bias one or two steps above your chart (e.g. 1H while trading 15M).
3. Choose a Risk Preset that matches your style, or leave Balanced.
4. Watch the dashboard: Trend + HTF Bias aligned means you only consider signals in that direction with full conviction; the retest diamonds do the timing.
5. After 15–20 closed trades, read the Stats section and tune Min Retest Score up (fewer, cleaner signals) or down (more signals) for your instrument.
👁️ Reading the chart:
— 🟢 / 🔴 Band stack + heatmap = the liquidity trail zone; the deeper the fill, the closer price is to a trend flip.
— ◆ diamond with a number = confirmed scored retest entry (the number is the 0–100 quality score; hover the tooltip for the full component breakdown).
— ▲ / ▼ FLIP = confirmed trend reversal through the chosen flip band.
— Long ▲ / Short ▼ = trade entry taken by the engine on a flip (printed when there is no retest diamond on the same bar, so every entry is visibly marked).
— ENTRY / SL / TP1–TP3 lines = the live trade card; TP lines turn solid teal with ✓ when touched; a dimmed SL with "→ SL (BE)" on the entry label means the stop sits at break-even.
— 🟡 POC line = highest-volume price of the current trend leg; dashed VAH/VAL = Value Area edges; LVN labels = volume vacuums inside the Value Area.
— ▲ +X.XX% floating label (optional) = real-time directional P&L of the current trend since the flip.
📊 Dashboard fields:
— Trend / Age : direction of the band stack and bars since the last flip.
— HTF Bias : higher-timeframe EMA-50 direction (soft score component).
— Signal : current engine position — LONG, SHORT or Wait.
— Last signal : most recent event, its score, and bars elapsed.
— POC / VA High / VA Low : live segment profile levels.
— Entry / SL / TP1–TP3 / R:R / SL Dist % : the open trade card ("BE @" marks a break-even stop; ✓ marks touched targets); collapses to one row when flat.
— Trades / W-L / Win rate / Form : session statistics; ▰ = win, ▱ = loss, newest on the right.
🔧 Tuning guide:
— Too many weak signals: raise Min Retest Score toward 85–90, or increase Signal Cooldown.
— Too few signals: lower Min Retest Score toward 55–65, or widen the Retest Window to 10.
— Whipsaw flips on a choppy symbol: switch Flip Band to Deep (Band 4) or move to the Deep Trend preset.
— Flips lag too far behind on fast moves: Flip Band → Fast (Band 2) or the Scalping preset.
— Stops feel too tight / too wide: switch SL Mode between Wick-Anchored and ATR, or change the Risk Preset; on volatile symbols prefer Conservative.
— Profile looks coarse on long trends: raise Profile Rows to 50+ and Max Profile Bars toward 800.
— Counter-trend retests keep printing: set an explicit Higher Timeframe Bias — counter-bias signals lose 20 points and rarely clear a high threshold.
⚙️ KEY SETTINGS
⚙️ Trend Engine:
— Band Width Preset (default Balanced): Scalping 2.5 × ATR / step 0.20, Balanced 4.0 / 0.25, Deep Trend 6.0 / 0.30, or Custom.
— Base Multiplier (default 5.0) and Band Spacing (default 0.25): manual geometry, active in Custom preset only.
— ATR Length (default 13): lookback for band-width ATR.
— Source (default close): price series for trailing and flips.
— Flip Band (default Balanced / Band 3): which band a close must breach to flip the trend.
— Higher Timeframe Bias (default empty = chart TF): HTF for EMA-50 bias scoring.
🎯 Signals:
— Min Retest Score (default 80): 0–100 quality threshold for retest diamonds.
— Retest Window (default 8 bars): how long a band touch stays armed for a reclaim.
— Signal Cooldown (default 5 bars): minimum spacing between signals, shared across directions.
📦 Volume Profile:
— Show Segment Volume Profile (on), Profile Rows (30), Profile Width (34 bars), Max Profile Bars (500).
— Show POC (on), Show Value Area 70% (on), Show HVN / LVN Levels (on), Profile Label Size (Small).
🛡️ Risk Management:
— Risk Preset (default Balanced): Conservative / Balanced / Aggressive / Scalping / Custom.
— SL Mode (default Wick-Anchored): structure-aware wick stop vs. fixed ATR distance.
— ATR Length (Risk) (14), SL Multiplier (1.5), TP1 / TP2 / TP3 Multipliers (1.0 / 2.0 / 3.0 × risk) — Custom preset.
— Break-Even After TP1 (on): stop moves to entry once TP1 is touched.
— Show SL/TP Lines / Labels / % Distance and per-line style controls (Entry dotted, SL solid, TP dashed by default).
🎨 Visual:
— Theme (Auto / Dark / Light), Show Trail Bands , Show Band Heatmap Fill , Show Retest Signals , Show Flip Labels , Show Trend P&L Tracker (off by default), label size controls, watermark toggle, Bull / Bear color pickers.
📊 Dashboard:
— Show Dashboard (on), position (5 anchors), font size, and independent toggles for the Market, Profile, Trade and Stats sections.
🔧 Advanced:
— HVN Threshold (default 0.55 × POC volume): minimum relative volume for an acceptance node.
— LVN Threshold (default 0.30 × POC volume): maximum relative volume for a vacuum node.
🔔 ALERTS
— 🟢 LONG ENTRY / 🔴 SHORT ENTRY — ticker, timeframe, price, signal score, SL, TP1–TP3, R:R. Plain text or JSON webhook format ({"action":"buy"...}) for bot integrations.
— 🎯 TP1 / TP2 / TP3 HIT — target touches with prices (optional).
— 🛡️ BREAK-EVEN — stop moved to entry after TP1 (optional).
— 🛑 SL HIT / BE STOP-OUT — stop-loss trigger with direction, entry and stop prices; a distinct BE variant when the stop was at break-even.
— 🔄 REVERSAL — position reversed by an opposite signal, with the closed trade's outcome (after / before TP1).
— ▲ / ▼ TREND FLIP — informational flips that did not open or reverse a trade.
— ⚡ LVN BREAK — a close crossing a Low Volume Node of the live segment profile (price entering a volume vacuum often accelerates).
All alerts fire once per bar close. Alerts are ordered by within-bar chronology: trade management → closures → reversal → new entries → informational.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals, entries and alerts are confirmed on bar close (barstate.isconfirmed). The trend flip compares against the previous bar's band value. The HTF bias uses the higher timeframe's previous closed bar, so its value never changes retroactively. A warm-up guard suppresses signals for the first max(3 × ATR length, 60) bars.
— 📐 The segment volume profile is a live construct. It is redrawn on the last bar for the current trend leg and evolves as the leg grows — this is by design (it describes the present segment), and historical profile states are not preserved.
— 📊 Session statistics reset on chart reload. They are transparent live tracking of the current settings on the current symbol and timeframe — not a backtest, and past performance does not guarantee future results.
— ⚖️ Same-bar ambiguity is resolved pessimistically. If one bar touches both a stop and a target, the stop wins in the statistics. Intrabar sequence cannot be known from OHLC data, so the engine never gives itself the benefit of the doubt.
— 🕳️ Zero-volume symbols use a range-weighted proxy for the profile, and the volume score component defaults to a neutral value — profile shapes on such symbols reflect price dwell time, not traded volume.
— 🛠️ This is an analysis and trade-planning tool, not an automated trading bot. It detects trend state, scores retests, projects stops and targets, and tracks outcomes — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Indicator

Median Gaussian Trend | NAL1. Overview
Median Gaussian Trend | NAL is an adaptive trend-band indicator built from a median price baseline, Gaussian smoothing, and Gaussian-weighted volatility bands.
The indicator is designed to filter raw price movement into a smoother directional structure. Instead of using a simple moving average or standard deviation channel, it first compresses price through a median calculation, then applies Gaussian smoothing to create a cleaner baseline. Around that baseline, it builds adaptive upper and lower bands using Gaussian-weighted deviation.
The result is a robust, smooth trend regime tool that identifies when price breaks outside its filtered volatility structure.
2. Calculation
The indicator starts by calculating a median of the selected source. This helps reduce noise by focusing on the central value of recent price action instead of reacting directly to every candle.
That median value is then passed through a Gaussian filter. The Gaussian filter gives more structured weighting to the lookback window, producing a smoother baseline while still preserving directional movement.
The indicator then calculates a Gaussian-weighted deviation around the smoothed median baseline. This creates a custom volatility measurement that is more aligned with the filtered baseline rather than raw price alone.
The upper and lower bands are then built around the Gaussian-smoothed median. The script allows separate upper and lower multipliers, which lets the band structure be asymmetric if needed.
upper = median_base + sd_range * sd_mul
lower = median_base - sd_range * sd_mulb
A bullish state triggers when price closes above the upper band. A bearish state triggers when price closes below the lower band. When price remains inside the bands, the previous regime is held.
3. Key Features
Median-based price filtering.
Gaussian-smoothed baseline.
Gaussian-weighted volatility deviation.
Adaptive upper and lower trend bands.
Separate upper and lower band multipliers.
State-based candle coloring, band coloring, glow effect, and directional fills.
4. Use
Median Gaussian Trend is designed to identify when price escapes its smoothed median-volatility structure. A close above the upper band reflects bullish expansion, while a close below the lower band reflects bearish expansion.
The median component helps reduce noisy price behavior, while the Gaussian smoothing and deviation engine create a more refined trend envelope. This makes the indicator useful for reading directional structure without relying on a raw moving average channel.
This indicator is best used as a specialized module within a complete strategy framework. Its role is to isolate a filtered volatility-trend layer of price behavior, where the real value comes from how the signal is integrated into a broader process for regime, timing, and execution.
Indicator

Trend Bias Guide MATrend Bias Guide MA
OVERVIEW
Trend Bias Guide MA is a smoothed reference line that shows which side (bullish or bearish) has been dominating recent price action, and helps spot early signs of trend exhaustion through divergence between price and candle-body pressure.
Unlike a standard moving average, this line is not derived from price itself. It is derived from the net directional pressure of individual candles over a lookback window, then projected onto the chart at a visual offset from price using ATR, so it never overlaps the candles.
WHAT IT IS BUILT FROM
For every candle in the lookback window (default: 50 candles), the script measures (close − open). This value is positive for a bullish candle and negative for a bearish candle, and its magnitude reflects the size of that candle's body.
These values are summed across the whole lookback window into a single number, referred to here as the net bias:
net bias = Σ (close − open) over the last N candles
This sum captures two distinct effects at once:
1. Count imbalance: whether there were more bullish or more bearish candles in the window.
2. Size imbalance: whether the bullish or bearish candles had larger bodies on average.
Both effects move price in the same underlying way, and summing (close − open) candle by candle combines them automatically, without needing to calculate them separately. If the net bias is positive, bullish pressure has dominated the window; if negative, bearish pressure has dominated.
HOW THE LINE IS DRAWN
- If the net bias is negative (bearish), the line is plotted above price, at a distance of (ATR × multiplier) above the current high.
- If the net bias is positive (bullish), the line is plotted below price, at a distance of (ATR × multiplier) below the current low.
- ATR length and multiplier are both adjustable inputs (defaults: ATR length 14, multiplier 1.0), and control how far the line sits from price.
- The raw level is then smoothed with a simple moving average (default length: 10) to reduce short-term noise and produce a cleaner, more continuous line instead of a jagged one.
- The line changes color to match its current bias: green when below price (bullish), red when above price (bearish).
INPUTS
- Lookback Length (default 50): number of candles used to calculate the net bias.
- ATR Length (default 14): period used for the ATR calculation that sets the offset distance.
- ATR Multiplier (default 1.0): scales the offset distance from price.
- Smoothing Length (default 10): period of the moving average applied to the final line.
HOW TO INTERPRET IT
- Green line below price: bullish pressure has dominated over the lookback window.
- Red line above price: bearish pressure has dominated over the lookback window.
- This is a trailing, lookback-based measure. Like any indicator built on a moving window, it reacts with a delay relative to the current candle — it will not flip instantly at the exact start of a new trend, and generally needs enough new candles in the new direction to outweigh the older ones still inside the window.
HOW TO USE IT
This indicator is designed as a contextual reference, not as a standalone entry or exit signal. Two practical uses:
1. Trend context: at a glance, see whether recent price action has been dominated by bullish or bearish candles, without needing to eyeball candle sizes manually.
2. Divergence / exhaustion warning: watch for cases where price is trading above a rising average (e.g., an EMA, not included in this script) while this line is still red (or below a falling average while the line is still green). This mismatch between price direction and underlying candle pressure can flag weakening trend conviction. In backtesting on XAUUSD (17 years of hourly data), this type of divergence was associated with a meaningfully higher chance of the trend reversing within the following 24–72 hours compared to the general baseline, with the effect strongest in the 24-hour window and gradually fading over longer horizons.
LIMITATIONS
- This is a descriptive/contextual tool, not a predictive trading signal on its own. It shows what has already happened over the lookback window, and any forward-looking use (such as the divergence behavior described above) carries no guarantee of repeating in the same way in the future or on other symbols/timeframes.
- Being lookback-based, the line inherently lags price, in the same way any moving average or rolling calculation does.
- It does not include stop-loss, take-profit, or position-sizing logic of any kind. It is a visual reference only.
- Backtested divergence statistics referenced above were derived from historical XAUUSD data and should not be assumed to hold with the same magnitude across all instruments, timeframes, or market regimes. Users should validate behavior on their own instrument and timeframe before relying on it. Indicator

Indicator

EMA Pro+ Suite# EMA Pro+ Suite
**A multi-layer EMA confluence framework for reading market state at a glance.**
---
## What It Is
EMA Pro+ Suite is an overlay indicator built around three exponential moving averages — a Fast (10), Mid (20), and Slow (50) EMA — organized into a structured three-layer state engine that tells you the current market regime, momentum direction, and whether price is in or out of alignment with that regime. Rather than treating each EMA in isolation, the suite reads them together as a system and surfaces a single, coherent market state at all times.
A corner dashboard table updates in real time, giving you an instant read on bias, momentum, alignment, EMA slopes, and price extension — without having to scan the chart manually.
---
## How It Works
The indicator evaluates three distinct layers on every bar:
**Layer 1 — Bias (Trend Regime)**
Defined by price relative to the 50 EMA. Price above = bullish bias. Price below = bearish bias. This is the macro filter — it determines which direction setups should be taken in.
**Layer 2 — Momentum**
Defined by the 10 EMA relative to the 20 EMA. When the fast EMA is above the mid EMA, momentum is bullish. When below, momentum is bearish. Momentum alignment with bias is the confirmation layer.
**Layer 3 — Price vs Fast EMA**
When bias and momentum are aligned but price is on the wrong side of the 10 EMA, the indicator flags a potential pullback or exhaustion condition. In a full bull regime, price dipping below the 10 EMA may represent a high-quality entry opportunity — or an early warning of trend exhaustion. Context determines which.
**Slope Engine**
Each EMA is evaluated for slope using a configurable lookback. RISING / FLAT / FALLING is displayed per EMA in the dashboard. A momentum flip on flat EMAs carries significantly less weight than one on rising or falling EMAs — this is critical for filtering out noise in ranging conditions.
**Price Distance from 50 EMA**
Tracks how extended price is from the slow EMA as a percentage. Large positive or negative readings flag mean reversion risk.
**Bar & Background Coloring**
- Green background + green bars = full bull alignment
- Red background + red bars = full bear alignment
- Yellow bars = conflicting bias and momentum (mixed / transitional state)
- Aqua bars = bull regime, price pulling back below 10 EMA
- Fuchsia bars = bear regime, price popping above 10 EMA
**Cross Signals**
- `M↑` (green) — 10 EMA crossed above 20 EMA in bull zone. Aligned, higher conviction.
- `M↓` (red) — 10 EMA crossed below 20 EMA in bear zone. Aligned, higher conviction.
- `M↑ 🐻` (orange) — Bullish momentum flip firing in bear zone. Counter-trend, lower conviction.
- `M↓ 🐂` (orange) — Bearish momentum flip firing in bull zone. Counter-trend, lower conviction.
**Multi-Timeframe Support**
All three EMAs can be calculated on a higher timeframe and plotted on the current chart. Use this to anchor your bias to the HTF structure while reading entries on a lower timeframe.
---
## Possible Ways to Use It
**Trend Following**
Wait for full alignment — green background, green bars, all three slopes RISING. Only look for long entries. Use the 10 EMA pullback (aqua bars) as a potential entry trigger. Reverse logic for shorts.
**Momentum Flip Entries**
Use aligned `M↑` / `M↓` signals (green/red) as entry triggers when bias and slope confirm. Discard or fade counter-trend orange signals unless you have a specific reason to trade against the regime.
**Regime Filter for Other Systems**
Use the bias layer (price vs 50 EMA) as a filter for another strategy. Only take long signals from your primary system when EMA Pro+ shows bull bias, and vice versa.
**HTF Confluence**
Set the EMA Timeframe to a higher timeframe (e.g. 4H or Daily) while trading on a 15m or 1H chart. The dashboard will show the HTF regime, giving you a structural anchor for your intraday reads.
**Avoiding Chop**
When all three slopes read FLAT and bars are yellow (mixed alignment), the market is in a transitional or ranging state. Consider standing aside or reducing position size until a clear regime re-establishes.
**Mean Reversion Awareness**
When Dist 50 shows a large positive or negative reading, price is extended from the slow EMA. In trending markets this can persist — but it raises the bar for adding to positions and flags potential snapback risk.
---
## Settings
| Setting | Description |
|---|---|
| EMA Timeframe | Blank = current chart timeframe. Enter any TF (e.g. 60, 240, D) for MTF mode. |
| Fast / Mid / Slow EMA Length | Default 10 / 20 / 50. Fully adjustable. |
| Slope Lookback | Number of bars used to calculate EMA slope. Increase on lower timeframes to reduce flat readings. |
| Show EMA Lines | Toggle the three EMA plots. |
| Show Bias Background | Toggle the green/red background tint. |
| Color Bars by State | Toggle bar coloring. |
| Show Cross Signals | Toggle M↑ / M↓ labels on chart. |
| Show Dashboard Table | Toggle the corner HUD. |
| Table Position | Top Right / Top Left / Bottom Right / Bottom Left. |
| Bar Close Reminder Alert | Fires a reminder alert on every bar close to check the setup. |
---
## Alerts
- Momentum Flip Bullish — Bull Zone (aligned)
- Momentum Flip Bullish — Bear Zone (counter-trend)
- Momentum Flip Bearish — Bear Zone (aligned)
- Momentum Flip Bearish — Bull Zone (counter-trend)
- Price Reclaimed 50 EMA (bias flipped bullish)
- Price Lost 50 EMA (bias flipped bearish)
- Bull Pullback Signal (bull regime, price below 10 EMA)
- Bear Pullback Signal (bear regime, price above 10 EMA)
- Bar Close Reminder
---
## Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any asset. All trading involves substantial risk of loss. Past performance of any signal, strategy, or system is not indicative of future results.
EMA Pro+ Suite is a tool to assist with technical analysis — it does not predict price, guarantee accuracy, or remove the inherent uncertainty of financial markets. No indicator eliminates risk. You are solely responsible for your own trading decisions.
Always conduct your own research, apply proper risk management, and consider consulting a licensed financial professional before making any trading decisions. Only trade with capital you can afford to lose. Indicator

Indicator

Auction Regime Router Entropy Gate & Hurst MemoryAuction Regime Router — Entropy Gate & Hurst Memory
What it is
Every structure playbook fails in the wrong regime. Fading the value-area edge works when price is anti-persistent (stretches snap back); riding a breakout works when price is persistent (moves feed on themselves); and nothing structural works when the tape is noise. This tool measures two things — how much structure exists, and what kind it is — and routes to a plain-language answer: FADES VIABLE / BREAKOUTS VIABLE / STAND ASIDE. It decides which of your tools to trust, never buy or sell.
The two measurements (and how they work together)
Permutation entropy (Bandt–Pompe 2002) — the gate. It measures how disordered the recent price sequence is from the frequencies of ordinal patterns (which of the 6 orderings each price triplet takes). High entropy = all patterns equally likely = noise = no structural edge. The gate is self-calibrated: entropy is ranked against its own recent history, so "noisy" means noisy for this symbol and timeframe.
Hurst exponent (Hurst 1951; Mandelbrot) — the router. Memory via diffusion scaling: how the dispersion of K-bar returns grows with K. H > 0.5 = persistent → continuation regime; H < 0.5 = anti-persistent → reversion regime. Research supports the routing: mean reversion is empirically more probable and faster during anti-persistent periods.
The mashup logic is a hierarchy, not a mixture: the entropy gate overrides the Hurst read. If the tape is noise, the router says STAND ASIDE regardless of what H says — because a memory estimate on noise is meaningless.
The honesty steps
A dead zone around H = 0.5 (default 0.45–0.55): near a random walk the memory read is unreliable, so the router says MIXED rather than pretending. Practitioners commonly require a margin before activating a playbook; both thresholds are inputs.
A minimum-dwell filter (the standard anti-chattering design from switched-systems control): a new regime is announced only after it survives a set number of confirmed bars, so the read doesn't flip-flop bar to bar. The cost is that many bars of lag — stated, and adjustable.
Estimates are proxies from bar data with overlapping windows — descriptive of the recent past, not a prediction. The dashboard shows the state, how long it has persisted (regime age), how dominant it has been recently (stability %), and any pending regime with a countdown — nothing more.
How to use it
Add to any liquid symbol/timeframe; defaults suit intraday index futures. The script requests no external data of any kind, so it runs on every plan and every symbol.
Glance at the regime lane — the thin colored strip at the bottom of the pane: blue = continuation, violet = reversion, amber = noise, gray = mixed. The palette is deliberately direction-neutral — no green or red anywhere in regime coding, so nothing can be misread as a buy or sell.
The HTF STACK row shows the raw regime on three higher timeframes derived as multiples of the chart (defaults 3×, 5×, 15× — so a 5m chart reads 15m/25m/75m automatically, adapting to any chart). A ✓ in green = every timeframe agrees on the same actionable regime (strongest context). A ⚠ in amber = a higher timeframe reads NOISE or the opposite regime while the chart claims a playbook (weakest — reduce or wait).
Read the dashboard for detail: REVERSION → your value-area fade / band-reversion tools are in their element; CONTINUATION → your breakout / drive tools are; NOISE → the gate is closed, stand aside; MIXED → no clear routing, reduce. STABILITY shows how settled the read is; PENDING shows a forming regime with a countdown.
Regime-change tags print only on announced (dwell-confirmed) changes; alerts fire on entering each state.
Best used as the selector above your structure toolkit rather than as a standalone display.
What makes it original
Hurst and entropy oscillators exist. What this adds: (1) the hierarchy — a self-calibrated entropy gate that can veto the memory read, instead of two numbers side by side; (2) routing to auction playbooks in plain language (fade vs breakout viability), not a raw statistic; (3) honest dead zones, a minimum-dwell announcement filter, and stability/pending context instead of a binary flip at H = 0.500. It is a decision-hygiene tool for structure traders.
Concept credits
Ordinal-pattern (permutation) entropy — C. Bandt & B. Pompe (2002). Long-memory / rescaled-range analysis — H. E. Hurst (1951); fractal market framing — B. Mandelbrot. Regime-gated strategy selection — standard quantitative practice. Implementation and charting design are the author's own.
Important disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. Regime labels are descriptive statistics of recent bars; regimes change without warning and estimates are proxies. Validate independently and manage your own risk. Indicator

Smart Ichimoku | GainzAlgoOverview
Most Ichimoku indicators give you the same signal everyone else gets, a raw cloud cross with no filter, no context, and no target. This indicator rethinks the system from the ground up by combining a smoothed Ichimoku cloud with an inline logistic regression classifier that scores every cloud break in real time, then projects statistically-derived price targets the moment a confirmed signal fires.
The result is a cleaner, higher conviction version of one of the most respected trend frameworks in technical analysis.
The Foundation: Why Smooth the Ichimoku?
Traditional Ichimoku uses simple high-low midpoints (Donchian midlines) for its Tenkan, Kijun, and Senkou components. This makes the cloud visually choppy and prone to false crosses on noisy, volatile instruments like crypto or high-beta equities.
This indicator replaces all three components with Hull Moving Averages (HMA), which are designed to be simultaneously smooth and responsive, reducing lag without the whipsaw of standard smoothing. The cloud body itself becomes cleaner, the baseline is less noisy, and the cross events that trigger signals are more structurally meaningful.
All default periods match classic Ichimoku settings (9 / 26 / 52 / 26 displacement) so the logic stays true to the original system, it's just rendered with better math underneath.
The Signal: Logistic Regression Cloud Break Classifier
Here's where this indicator separates itself. A cloud cross alone is not a signal, it's a candidate. What actually matters is whether the market conditions at the moment of the cross are consistent with a real, sustained breakout or breakdown.
The classifier answers that question with a probability score.
How it works
At the exact bar where price exits the cloud body, four normalized features are computed and fed into a logistic regression model:
1. RSI (centered at 50, scaled by 25)
Measures momentum. On a bearish break, is RSI already extended to the downside? On a bullish break, is it pointing up? RSI near 50 adds little conviction; RSI at 30 on a bear break adds a lot.
2. Stochastic Oscillator (centered at 50, scaled by 25)
Short-term overbought/oversold confirmation. Works similarly to RSI but captures faster-cycle momentum, giving the model a second read on the same question.
3. Z-Score (price vs 20-bar mean, normalized by standard deviation)
Measures how statistically extended price is relative to recent history. A cloud break accompanied by a Z-Score of -2 is much more meaningful than one at Z = -0.2. This feature effectively asks: "Is this break happening from an already-stretched position?"
4. Cloud Break Depth (normalized by ATR)
How far did price close through the cloud boundary, relative to recent volatility? A close that barely clips the edge is very different from one that punches through by a full ATR. This is the most direct measure of breakout conviction.
The Math
Each feature is multiplied by a weight and summed into a single score (z). That score is passed through the sigmoid function:
P = 1 / (1 + e^(-z))
This compresses the output to a probability between 0 and 1. If the probability clears the threshold (default 0.60), the break is confirmed and a signal fires. Below threshold, the cross is rejected — instead of being ignored, it's labeled with a risk tier so you can see exactly how close (or far) it came to confirming.
The probability score is displayed as a small percentage label directly on the signal bar so you always know how strong the classifier rated that particular break.
Self-Calibrating Weights — No Manual Tuning
Unlike a typical multi-feature model, none of the four weights are set by hand. Each one is derived automatically from that feature's own rolling correlation with next-bar returns, recalculated continuously over a user-set lookback window (the "Self-Calibration Window," default 100 bars).
In practice this means: if RSI has been a genuinely useful predictor of direction on this instrument and timeframe recently, its weight rises on its own. If Z-Score has been mostly noise in the current regime, its weight shrinks toward zero — automatically, without anyone touching a slider.
This was a deliberate design choice. Letting people hand-tune regression weights invites a lot of well-intentioned guesswork that usually overfits to a handful of recent candles. By having the model score its own features based on demonstrated, rolling predictive power, the classifier adapts to changing market conditions instead of running on opinions baked in at setup time.
Rejected Crosses: Risk-Tiered Labels
Not every cloud cross clears the threshold, and that's the point. Rather than silently discarding rejected crosses, this indicator labels every one of them with a risk tier so you know exactly what the model saw and how close it came to confirming:
Low Risk: Probability fell just short of the threshold (within 10 points below). A near-miss — the break had real conviction behind it, it simply didn't clear the bar.
Moderate Risk: Probability landed meaningfully below threshold (10–25 points). A weaker break with mixed signals underneath it.
High Risk: Probability came in far below threshold (25+ points). A break with little to no underlying conviction — most consistent with chop or noise.
Each label shows its tier and the actual probability (e.g. "Low Risk ▼ 54%"), so nothing is a black box. A cluster of Low/Moderate Risk labels in one zone often signals a contested area that's likely to resolve into a real breakout once it's worked through — useful context even though no trade signal fired. These labels can be toggled off entirely in settings if you'd rather only see confirmed signals.
The Targets: Mean, Median, Mode
Once a confirmed break fires, three dashed horizontal target lines project from the signal bar. These are not arbitrary multiples, they are derived from the actual statistical distribution of bar-to-bar price moves over the lookback window.
Mean (Yellow): The average absolute bar move over the lookback period, scaled by the target multiplier. This is the "expected" target under normal conditions.
Median (Cyan): The 50th percentile of historical moves. Because move distributions are right-skewed (a few large moves pull the mean up), the median is typically more conservative than the mean and often a more realistic first target.
Mode (Hot Pink): The most frequently occurring move size, derived by bucketing historical moves into ATR-width bins and finding the most populated bin. This represents what the market most commonly does — not what it averages, not the middle value, but the single most likely outcome based on observed frequency.
Together, the three targets give you a realistic range rather than a single arbitrary level — grounded in what this instrument has actually done over the recent past. Bull and bear target sets are tracked independently, so a new bearish break won't erase an active bullish target set still in play, and vice versa.
The Target Multiplier (default 3×) scales all three targets proportionally. Lower it for tighter, shorter-term targets; raise it for swing trades or higher-volatility instruments.
Reading the Chart
Green triangle (▲) below bar: Confirmed bullish cloud break. Price has exited the top of the cloud with sufficient classifier probability. Three upward target lines appear.
Pink triangle (▼) above bar: Confirmed bearish cloud break. Price has exited the bottom of the cloud with sufficient classifier probability. Three downward target lines appear.
Percentage label: The LR probability score for that break (e.g. "73%"). Higher is stronger.
Risk-tiered label (amber/orange/red): A cloud cross that was rejected, with its tier and probability shown.
Yellow dashed line: Mean target
Cyan dashed line: Median target
Hot pink dashed line: Mode target (thicker, as it represents the highest-frequency outcome)
Settings Guide
Smooth Ichimoku
Tenkan / Kijun / Senkou Period: Standard Ichimoku periods. Default 9/26/52 follows the classic system. Shorter periods = more sensitive, more signals. Longer = slower, fewer but stronger signals.
Displacement: How far forward the cloud is projected. Default 26.
Break Classifier
Self-Calibration Window: How many past bars the model uses to learn each feature's weight from its recent correlation with price moves. Shorter windows adapt faster to regime changes but can be noisier; longer windows are more stable but slower to react. Default 100.
Break Probability Threshold: The minimum probability required to confirm a signal. Default 0.60. Raise toward 0.75+ for fewer, higher-conviction signals. Lower toward 0.50 to see more cloud breaks confirmed (effectively turns the filter off at 0.50).
Targets
Lookback (bars): How many bars of historical move data to use for the distribution calculation. Default 60. Longer lookback = more stable targets based on longer-term behavior. Shorter = more reactive to recent volatility.
Target Multiplier: Scales all three target lines proportionally from the signal close. Default 3×. Adjust based on your timeframe and typical holding period.
Risk Labels
Show Risk Labels on Rejected Crosses: Toggles the Low/Moderate/High Risk labels on rejected cloud crosses. Off by default for a cleaner chart; turn on to see every cross the model evaluated, not just the confirmed ones.
How to Use It
As a trend confirmation tool: Use the cloud direction (cyan dominant = bullish structure, pink dominant = bearish) as your bias filter, and only trade signals that align with the cloud color. Bull signals below a cyan cloud, bear signals above a pink cloud.
As a breakout entry trigger: Wait for price to consolidate inside or near the cloud, then take the confirmed break as an entry signal. The probability label tells you how much conviction the model has at that moment.
Using rejected crosses as context: A string of Low Risk labels in a zone suggests the cloud is being tested seriously without quite breaking — often a precursor to a real move once the level finally gives.
For target setting: Use the median as a conservative first target, the mean as a mid-range objective, and the mode as a guide to where the most "normal" move tends to land. The hot pink mode line is often the most useful for setting realistic profit expectations.
For alerts — Four alert conditions are built in: "Confirmed Bull Break," "Confirmed Bear Break," "Rejected Bull Cross," and "Rejected Bear Cross." Set them on your preferred timeframe and let the classifier notify you rather than watching the chart.
Timeframe Notes
This indicator works across all timeframes but behaves differently depending on context:
1H–4H: Good balance of signal frequency and reliability. Recommended starting point.
Daily: Fewer signals, higher structural significance. Best for swing traders.
15m and below: More signals, more noise. Consider raising the threshold to 0.65–0.70 and reducing the lookback to 30. Watch the risk-tiered labels here in particular — they're most useful for filtering chop on fast timeframes.
Example on the Daily with SPY ETF:
Example on the 4 Hour with BTCUSD;
Example on the 15 Minute with QQQ:
A Note on the Model
The logistic regression here is not trained on historical data in the machine learning sense, and it no longer relies on manually-set weights either. Each feature's weight is derived from its own rolling correlation with subsequent price action, recalculated continuously. Think of it less as a black-box ML model and more as a structured, self-adjusting way to combine four momentum and positioning indicators into a single probability score, similar to our Directional Logistic Oscillator.
The advantage over a traditional multi-condition filter (RSI < 40 AND stoch < 30 AND...) is that the sigmoid function produces a continuous probability rather than a binary pass/fail, which means the model degrades gracefully, a break with three strong features and one neutral one still scores well, rather than getting blocked by an arbitrary threshold on the weak feature. And because every rejected cross is shown with its tier and score rather than discarded silently, nothing the model does is hidden from you.
We hope you enjoy! Indicator

Adaptive Predictability Engine Entropy Gate, Regime RouterAdaptive Predictability Engine — Entropy Gate, Regime Router & Expert Committee
What it is
The Adaptive Predictability Engine is a governed decision framework, not another confluence average. It refuses to treat all market conditions as tradable. It applies a strict hierarchy: first it asks whether price is forecastable at all right now; if it is, it decides whether trend-style or reversion-style logic is appropriate; and only then does a small committee of transparent experts vote — with the committee continuously re-weighting itself toward whichever experts have been correct recently. When the market is unpredictable, the whole engine stands aside and shows nothing to trade.
It plots directly on price: long/short signals, the live entry/target/stop of the active trade, a plain-language dashboard, and an optional self-calibration panel that scores past signals in R-multiple expectancy (not just win rate).
Why these components are combined (mashup justification)
This is a deliberate, dependent stack — each layer conditions the next, so removing any one changes the layer below it. That is the difference between a governed engine and a bag of averaged indicators.
Predictability gate (permutation entropy + structure). Permutation entropy (Bandt–Pompe) measures the ordinal randomness of recent price across three time scales; this is blended with |Hurst − 0.5|, the distance of the market from a random walk, which is high for strong trends and strong mean-reversion. The blended predictability is percentile-ranked so the gate self-tunes per symbol and timeframe. If the tape is unpredictable, nothing downstream may fire. This is the master switch, and it is why the engine spends much of its time deliberately doing nothing.
Regime router (Hurst exponent). When structure exists, the Hurst exponent (generalized, via a structure-function slope) decides whether it is persistent (trend) or anti-persistent (mean-revert), and routes weight toward the appropriate family of experts rather than averaging trend and reversion logic together.
Expert committee (Hedge / multiplicative weights). Six deliberately diverse experts — price trend, volume-weighted price, order-flow delta, momentum exhaustion, volatility extreme, and range extreme — each cast a directional vote. Their weights update every bar by exponential regret (right experts gain influence, wrong ones lose it), with fixed-share regularization so no single expert can dominate and make the vote fragile.
Distribution-shift guard. If the recent return distribution moves materially versus a reference window, the engine freezes learning and cuts conviction until conditions settle, so stale weights don't drive trades through a regime change.
The output is a single decision = the regret-weighted vote of only the currently-appropriate experts, gated to zero whenever the tape is unpredictable.
How to use it
Add it to any liquid symbol and timeframe. Defaults are tuned for index futures (e.g. NIFTY) but every input is adjustable, and the Data source group lets you repoint price and volume for any market.
Watch the dashboard headline: LONG / SHORT / WAIT / STAND ASIDE. When a signal fires, the engine draws the entry, ATR target, and ATR stop so the action is concrete.
Treat the shaded background as a hard "do not trade" — the engine has judged the tape unpredictable.
Open the Edge calibration (advanced) panel to see, per market memory, the past R-expectancy of the engine's own signals versus a direction-matched baseline. Positive expectancy means the sample was profitable before costs; this is descriptive of the past, not a forward guarantee.
Use the Ablation (research) toggles to switch each layer off and see, on your own data, whether it earns its place.
What makes it original
Most published tools average indicators and hope. This one inverts the approach by asking whether to act at all before what to do, using information-theoretic predictability (permutation entropy) as a master gate, a memory estimate (Hurst) as a router, and online regret-minimization (Hedge) to arbitrate a diverse expert set — with built-in R-expectancy self-calibration so users can judge it honestly rather than on a cherry-picked screenshot. The order-flow expert reads finest-available lower-timeframe signed volume with automatic fallback. The coupling and governance order are the contribution; the individual estimators are classical and credited below.
Concept credits
Permutation entropy — Bandt & Pompe. Hurst exponent / long-range dependence — H. E. Hurst; Mandelbrot. Hedge / multiplicative-weights online learning — Freund & Schapire; Littlestone & Warmuth; Vovk. Efficiency/structure framing — Kaufman. Triple-barrier labelling and R-multiple expectancy — M. López de Prado. Wilson score interval — E. B. Wilson. Synthesis, governance design, and implementation are the author's own.
Important disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. No indicator has an inherent edge. The calibration panel is a descriptive summary of past behaviour on the current chart — not a backtest and not a forward prediction. Always validate independently, apply realistic costs and slippage, and manage risk. You are solely responsible for your trading decisions. Indicator

Monotonic Trend Consensus [QuantAlgo]🟢 Overview
Monotonic Trend Consensus is a trend-following oscillator built on rank correlation between price and time rather than moving averages or crossovers. It scores how consistently price is ordered across multiple lookback windows and combines them into a single bounded reading on a -1 to +1 scale, holding the same meaning on any symbol or timeframe so traders can separate a broadly aligned trend from directionless noise and read when a move has stretched to saturation.
🟢 How It Works
The foundation is Spearman rank correlation between price and time, computed over each active window. Closes inside the window are ranked against one another, time forms its own rising sequence of ranks, and the difference between the two collapses to a single coefficient (rho):
float price_rank = less + (eq + 1.0) / 2.0
float time_rank = float(len - i)
float rho = 1.0 - 6.0 * sumd2 / denom
The coefficient reads +1 when each bar closes above the last in unbroken order, 0 when there is no consistent order, and -1 when each bar steps lower. Because it scores ordering rather than smoothing price into a line, it reflects the current window directly rather than trailing behind it, though it still needs a full window of bars to form. Ranking also limits the pull of any single outlier bar, and the bounded output is what lets one threshold hold across markets without rescaling.
A single window describes direction; the tool runs several and averages them into a consensus spanning fast, medium, and slow horizons:
consensus := array.avg(rhos)
Agreement is then measured as the share of windows leaning the same way as the consensus, and this conviction figure must clear a floor before a direction prints, working alongside the strength threshold:
conviction := 100.0 * agree / active
raw_bull = consensus > threshold and conviction >= min_conviction
raw_bear = consensus < -threshold and conviction >= min_conviction
A reading registers only when both clear at once: consensus past the threshold and windows aligned enough to meet the conviction floor. Fail either and the line stays flat. With Show Neutral on, those flat stretches reset to neutral; with it off, the line holds its last direction until the next qualifying move.
🟢 Signal Interpretation
▶ Bullish Consensus (Green): Consensus sits above the upper threshold with enough windows aligned, meaning recent bars are ordered upward across horizons. Trend traders read the turn into green as a possible long or continuation as the score presses toward +1. Mean-reversion traders treat a reading pinned near +1 as a stretched, broadly-agreed advance rather than a buy, and look to fade only once the line rolls back off the extreme, since the score can hold high through a sustained trend.
▶ Bearish Consensus (Red): Consensus sits below the lower threshold with conviction met, with bars ordered downward across horizons. Trend traders read the turn into red as a possible short or continuation as the score presses toward -1. Mean-reversion traders treat a reading pinned near -1 as a saturated decline where a bounce becomes more plausible, and look to fade on the turn back up rather than at the low itself.
▶ Neutral (Gray): With Show Neutral on, the line goes gray whenever no direction qualifies, either because consensus sits inside the threshold or conviction falls short. The zero line acts as the balance point and behaves like support or resistance for the reading itself: a score rejected at zero from above points to bullish order reasserting, a score capped at zero from below points to bearish order holding, and a clean break through leans toward a regime change. Reading this midline behavior against price is where market structure tools pair well, separating a base building above a structural level from a coil forming under overhead supply. Trend traders stand aside until the line commits; mean-reversion traders find less to work with here than at the edges.
▶ Reading the Extremes: The axis caps at +1 and -1, marking maximum agreement across every active window. Trend traders take an extreme as a sign a move is still in force; mean-reversion traders take it as a stretched zone and watch for the score to turn back toward zero as agreement breaks. An extreme that aligns with a known structural level gives a fade a cleaner reference than one in open space, and neither read holds on the extreme alone, since a strong trend can stay saturated before it cools.
🟢 Features
▶ Preconfigured Presets: Three setups map to different holding styles. "Default" suits swing work on 4-hour and daily charts, pairing a mid-range window spread of 8, 13, 21, and 34 with a 0.35 threshold and a 60% conviction floor, so a direction needs both strength and agreement before it flags. "Fast Response" pulls the windows in to 5, 8, 13, and 21 and eases the threshold and conviction floor so the reading keeps pace with quicker intraday swings. "Smooth Trend" stretches the windows out to 21, 34, 55, and 89 and raises both gates for daily and weekly position trading, where a premature flip costs more than a late one. Choosing a preset takes over the manual window, threshold, and conviction fields.
▶ Built-in Alerts: Four conditions track every change in state. "Bullish Trend Signal" triggers when the consensus confirms to the upside. "Bearish Trend Signal" triggers when it confirms to the downside. "Trend Lost / Neutral" triggers when an active direction fades back to flat, which is also the event a mean-reversion trader watches for after an extreme. "Any Trend Change" rolls the two directional events into a single notification for anyone who wants one alert covering both ways.
▶ Visual Customization: Six color schemes (Classic, Aqua, Cosmic, Cyber, Neon, and Custom) carry a matched pair of bullish and bearish colors through the consensus line, its tiered gradient fill down to the zero baseline, and the optional bar and background tints. Marker lines sit at the positive and negative trigger levels to show the zone the consensus has to cross, and each window's own score can be switched on as a faint backing line so you can see which horizons are driving or dragging the combined figure. Bar coloring paints the price candles in the active trend color at an adjustable transparency, while background coloring spreads that tint across the pane.
Indicator

Adaptive Consensus Trail Structure, Regime & SelfAdaptive Consensus Trail — Structure, Regime & Self-Test
A trailing stop that sits on the agreement of several structural references, adapts to the market regime, and forward-tests its own signals so the numbers it shows are measured, not asserted.
What it is
Most trailing stops follow one idea — an ATR band, a SuperTrend, a moving average. This one places the stop where a small committee of independent structural references agree, reads how confident that agreement is, widens or tightens itself according to the market regime, and then continuously audits its own flips and reports the edge it actually produced on your data.
The committee has five members, each locating support/resistance from a different lens:
Anchored VWAP band — fair value for the session/week/month
Session / naked volume Point-of-Control — the price the most volume traded at, carried forward until revisited
Fair-Value-Gap midpoint — unfilled imbalance
Swing pivot — structural memory
Order-flow absorption — where aggressive buying/selling was absorbed (via Bulk Volume Classification)
Why these parts belong in one script (mashup justification)
Each reference alone whipsaws on an index, and each is right in different conditions. They are combined because they correct one another, and the entire value of the script is in that interaction — not in any single line:
A reliability layer scores every reference's historical respect rate with a Wilson lower bound, so a reference that keeps getting ignored loses its vote instead of dragging the stop around.
A consensus layer keeps only the densest agreeing cluster of references, so the stop sits on genuine agreement rather than on an average nobody respects, and far-apart references never force a permanent "no signal."
A regime layer (efficiency ratio + ADX + band-width + a volatility-cluster read + a Hurst persistence estimate) widens the band and tightens the flip confirmation in chop — this is what removes the whipsaw.
A self-test layer forward-scores every flip and recalibrates the confidence number so it means what it says.
Split apart, these are five overlays that each mislead in a range. Wired together, they are one self-correcting, self-auditing trail. That is the reason for combining them.
How it works (six layers)
References are computed on the bar close.
Reliability — rolling-capped respect counts per reference give a Wilson lower-bound "trust." POC is a magnet, so it is judged by forward reaction (did price reject away before breaking through?), not a same-bar close, which keeps its trust honest.
Consensus — the densest agreeing cluster within an ATR band becomes the trail's target; the envelope and confidence are measured on that cluster only.
Adaptive backbone — an efficiency-ratio / regime-adaptive band (Adaptive, Chandelier, or Blend) that widens in chop.
The trail — high confidence pulls the stop toward structure (floored a minimum ATR off price); low confidence rides the wide band, so it flips less in noise.
Self-test — every flip is forward-resolved by triple-barrier first-touch against an unconditional base rate, split by strength tier and by regime, with a walk-forward in-sample→out-of-sample check, a runs test of independence, a Brier score, and a confidence recalibration.
How to use it
Read the top banner for the one-line bias — BULLISH / BEARISH / WAIT — and the READ legend for what to do. The coloured line is your stop: support in an uptrend, resistance in a downtrend. BUY / SELL labels print only on confirmed, sufficiently-confident, higher-timeframe-aligned flips.
The dashboard gives detail top-down: each reference's level and trust, the consensus, raw → calibrated confidence, regime (with Hurst and ADX), the higher-timeframe invalidation stop, and a FULL / HALF / STAND-ASIDE suggestion.
Before sizing, open the Self-Test panel and read the Edge column (hit% − base%), not the raw hit-rate. A ★ means the edge's confidence interval clears the base rate. Prefer signals where the walk-forward change isn't badly negative and the runs test isn't "streaky." Being honest about it: on many indices this tool shows real edge in range and volatile regimes on higher timeframes and little-to-none on very low timeframes or once a trend is already confirmed — the panel makes that transparent so you can pick your spots.
Works on any market
Set the Price source, and for symbols with no native volume set a Borrow-volume proxy (e.g. a futures contract). The panel theme adapts to your chart background automatically. Backbone: Adaptive / Chandelier / Blend. Absorption: order-flow (BVC) or simple. An optional intrabar resolution builds a finer volume profile where available.
Originality
The committee-of-references design, the cluster-not-average consensus, the reliability weighting that lets references lose their vote, the forward-reaction POC respect test, and the confidence self-calibration are the author's own work. The underlying techniques are standard and fully credited below.
Non-repaint
References, regime, consensus and the trail all evaluate on the close of the bar; the live bar is provisional and settles on close. Self-test events are logged and resolved only on confirmed bars and resolve on bars after their trigger at fixed barriers, so hit / base / edge use no look-ahead. The higher-timeframe stop uses a lookahead-off request.
Concept credits
Wilson score interval (E. B. Wilson); efficiency ratio (P. Kaufman); ADX / DMI / ATR / volatility-stop lineage (J. W. Wilder); anchored VWAP (industry standard); volume profile / value area / point-of-control — Market Profile (J. P. Steidlmayer, developed by J. F. Dalton); triple-barrier first-touch labelling (M. López de Prado); runs test of randomness (A. Wald & J. Wolfowitz); rescaled-range / Hurst exponent (H. E. Hurst); Brier score (G. W. Brier); Bulk Volume Classification / VPIN (D. Easley, M. López de Prado & M. O'Hara); reliability-bin (isotonic-style) calibration is standard forecasting practice.
Limitations & disclaimer
"Absorption" is a volume proxy — base data has no true tick order flow, so the buy/sell split is estimated from bar moves, not measured. Confidence is context, not a promise of profit. The self-test is descriptive of past behaviour on the loaded symbol (fixed barriers, no costs or slippage) — a study aid, not a backtest and not a guarantee. A measured edge is what flips did historically here, not a forecast.
This script is for research and education only. It is not financial advice, not a recommendation to buy or sell, and not a guarantee of any outcome. Trading carries risk of loss; your decisions are your own. Test on your own data and use independent risk management before relying on it. Indicator

Indicator

Directional Strength OscillatorDirectional Strength Oscillator
A signed trend-strength oscillator that reads the tug-of-war between upward and downward movement and prints one line — positive in uptrends, negative in downtrends, crossing zero at trend changes. Unlike a plain directional reading, it dims itself when price is only chopping, flags weakening trends through divergence, and scores its own signals forward on your chart in plain language.
Why these parts are combined (not a mashup for show). Each part answers what the previous one leaves open. Up-movement vs down-movement relative to true range gives a clean, bounded read of who's winning and by how much — but it can read "strong" inside noisy, non-trending chop. A trend-efficiency filter (net travel over total path) measures whether price is actually going somewhere; folding it into the line removes the false-strong chop. A divergence check (price makes a new extreme while strength does not) flags weakening trends the raw line would miss. Together they form one directional-strength tool.
How it works. Up-movement = |high − prior low|, down-movement = |low − prior high|; each is summed over the length and divided by summed true range to get the up and down lines. Their difference is the raw strength; it's standardized, soft-bounded to ±100, then scaled by a 0–1 trend-efficiency factor. Signals are zero-crosses gated by a minimum quality, plus divergence against price (measured on the undimmed strength). Each signal is then labelled by a triple barrier — a profit target and equal stop in ATR units plus a time limit — so a "win" means the target hit before the stop. Results split into in-sample and recent out-of-sample, with a confidence interval and a multiple-testing check.
How to use. Read the Verdict row (Long/Short signal, Watch, or Wait) and the Conviction row, which reads "High" only when that signal type shows a positive edge that survives the test on this symbol. Green line above zero = uptrend in control, red below = downtrend; shaded bands = strong trend; the trend-quality % tells you how clean the move is. Best used with your own entry and risk plan, not alone.
What's original. The trend-quality gate that removes false-strong chop, integrated divergence on the undimmed line, the forward triple-barrier calibration with an out-of-sample split, and a conviction read that openly admits when there's no proven edge.
Inputs. High/Low sources (change them for any market), reading mode (Simple/Pro), engine, quality-gate, divergence and full calibration settings, and an auto-adapting dashboard legible on dark or light charts. Defaults are tuned for NSE:NIFTY1! intraday.
Honesty & limitations. Edge figures are computed on this chart's own history with overlapping windows and no costs — context, not a guaranteed backtest; past behaviour doesn't predict the future.
Disclaimer: for research and education only. Not financial advice. Trading carries risk of loss; manage your own positions. Indicator

Indicator

[ 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. Indicator

Master Filter - Trend and Smart Money ZonesOverview
Master Filter combines a proprietary trend engine with the smart-money tools traders actually act on - EMA structure, Fair Value Gaps, Order Blocks and market-structure labels - in a single, clean overlay. Instead of stacking five separate indicators, you get one consistent read of where the trend is and where price is likely to react .
Everything is computed on the current chart timeframe and updates live as new bars form.
What's inside
1. The Master Filter © - trend & signals
A triple-smoothed price baseline (TEMA) is tracked against an adaptive average that follows the highs in an uptrend and the lows in a downtrend. An ATR-based channel (length 365 x multiplier, smoothed) acts as a confirmation filter that aims to suppress false flips during chop. When direction confirms, the script prints a LONG / SHORT marker on the bar. You can optionally plot the high / middle / low channel lines.
2. EMA suite + smoothed mirrors
EMA 100 / 200 / 300 / 365 for trend context, with a shaded zone between the 300 and 365 EMAs. Two optional "mirror" EMAs (a smoothed reflection of the 200 and 365) project the opposite side of price to frame mean-reversion zones.
3. Fair Value Gaps (current timeframe)
Three-bar imbalances are drawn as boxes with a dashed mid-line and tagged with the chart timeframe. Live gaps extend to the current bar and are removed automatically once price trades back through them (mitigation). A "max visible" cap keeps only the most recent gaps.
4. Order Blocks (current timeframe)
SMC-style order blocks are detected on structure breaks (price closing through the last swing high/low). The OB candle is selected within a bounded search window, with a volatility filter so an oversized, high-range bar isn't mistaken for the block. Each OB is drawn as a box plus dashed mid-line, kept per direction up to a configurable limit, and dropped on a strict break. A "max pivot age" setting skips stale blocks far from current price during strong trends.
5. Market structure - HH / HL / LH / LL
Swing pivots are labelled as Higher High / Higher Low / Lower High / Lower Low (teal for higher, orange for lower) so structure shifts are visible at a glance.
How to use
Read the trend from the LONG/SHORT markers and EMA stack; trade with it.
Use FVG and Order Block zones as areas to look for entries, partial exits or invalidation - not as automatic buy/sell signals.
Confirm with HH/HL/LH/LL: continuation favours trend-aligned zones; a structure break warns of a possible shift.
Settings
Grouped by section - Main trend (length, multiplier, channel filter, plot channel), Moving Average (EMA lengths, mirrors, smoothing), Fair Value Gaps (show, max visible, colours), Order Blocks (show, max per side, search/structure length, max pivot age, colours), and HH/HL/LH/LL (show, swing length, lookback).
Alerts
Change of the trend - fires when the Master Filter direction flips.
Notes
This indicator is a decision-support tool, not a signal-for-hire system. It does not place orders and past behaviour does not guarantee future results. Always combine it with your own risk management.
Indicator
