Structural SVM Ranker [LuxAlgo]The Structural SVM Ranker indicator is a market structure tool that utilizes a linear Support Vector Machine (SVM) algorithm to classify and rank structural breaks based on volume, momentum, and price magnitude. By assigning a score from 0 to 100 to every Break of Structure (BOS) and Change of Character (CHoCH), it aims to help traders differentiate between high-conviction structural shifts and low-probability price action.
🔶 USAGE
The indicator identifies key pivot highs and lows to map out the market structure. When price closes beyond these levels, a structural break is identified and assigned a score based on the quality of the move.
BOS (Break of Structure): Represented by solid lines, these indicate a continuation of the current local trend.
CHoCH (Change of Character): Represented by dashed lines, these indicate a potential reversal in the trend direction.
SVM Score: Displayed on labels and the dashboard. A higher score suggests the break occurred with significant relative volume, strong RSI momentum, and a meaningful price distance beyond the pivot level.
Traders can use the SVM score to filter trade quality. For example, a "CHoCH" with a score above 70 indicates a high-conviction reversal backed by volume and momentum, whereas a score below 30 might suggest a "fakeout" or a weak structural shift.
🔶 DETAILS
The core of the script is a linear classification logic inspired by Support Vector Machines. It takes three primary features into account to determine the "strength" of a break:
Relative Volume: Compares current volume to its 20-period average to ensure the break is supported by market participation.
RSI Momentum: Measures the distance of the RSI from its midpoint (50) to confirm trend strength.
Break Distance: Measures how far the price closed beyond the structural level, normalized by the Average True Range (ATR).
These features are multiplied by user-defined weights and then passed through a Sigmoid function to produce a normalized score between 0 and 100.
🔶 SETTINGS
🔹 Market Structure
Pivot Lookback: Determines the number of bars required to confirm a pivot high or low.
Show BOS/CHoCH: Toggles the visibility of structural break lines and labels.
🔹 SVM Ranking Parameters
Relative Volume Weight: Adjusts the influence of volume on the final score.
RSI Momentum Weight: Adjusts the influence of RSI deviation from 50 on the final score.
Break Distance Weight: Adjusts the influence of the price distance beyond the pivot (relative to ATR).
ATR Length: The period used for the ATR normalization of the break distance.
🔹 Dashboard
Dashboard: Toggles the visibility of the real-time ranking table.
Position: Moves the dashboard to different corners of the chart (Top Right, Bottom Right, Bottom Left).
Size: Adjusts the scale of the dashboard text.
Indicator

Quant Reversal Index [AlgoPoint]Overview
The AlgoPoint Quant Reversal Index is a normalized (0-100) oscillator designed to measure mean-reverting tendencies in financial time series. By combining the Hurst Exponent, an Autoregressive AR(1) Half-Life model, and Ornstein-Uhlenbeck (OU) boundaries, this indicator evaluates whether an asset is in a trending or ranging regime and calculates its proportional deviation from a dynamic historical mean.
Mathematical Core & Components
This indicator relies on three primary quantitative concepts:
1. Hurst Exponent ( H ) : Approximated using the log variance ratio of price differences over distinct time lags. It determines the current market regime:
- H < 0.5: Indicates a Mean Reverting (ranging) regime.
- H > 0.5: Indicates a Trending (momentum) regime.
2. AR(1) Half-Life : Calculates the estimated time (in bars) it takes for the price to revert to its mean. This is derived from the linear regression slope (covariance/variance) of price changes against previous prices. This dynamic half-life dictates the lookback length for the oscillator's mean and standard deviation.
3. Ornstein-Uhlenbeck (OU) Conversion : Calculates the mean ($\mu$) and standard deviation ($\sigma$) over the dynamic half-life period to establish upper and lower OU boundaries. The current price is then normalized into a 0 to 100 index based on its position relative to these boundaries.
Visual Elements & Interpretation
- The 0-100 Scale : * A value of 50 represents the dynamic mean ($\mu$).
- A value of 0 represents the Lower OU boundary (Standard Deviation limit).
- A value of 100 represents the Upper OU boundary.
- Values extending beyond 0 or 100 highlight statistical extremes.
- Dynamic Regime Background : When the Hurst Exponent is strictly below the user-defined threshold (default 0.5), the oscillator's background is highlighted. This visually confirms that the asset exhibits stationary, mean-reverting properties. If the background is not highlighted, the asset is considered to be trending, and mean-reversion logic is disabled.
- Signal Generation : The indicator plots "Buy" and "Sell" labels strictly when the market is in a confirmed mean-reverting regime ($H < 0.5$) AND the oscillator crosses back into the 0-100 range from an extreme (e.g., crossing above 0 or crossing below 100). All signals use barstate.isconfirmed to prevent repainting.
- Quant Dashboard : Displays real-time data for the current market regime, exact Hurst Exponent value, and the estimated Half-Life in bars.
How to Use
- Wait for the background to highlight, confirming a mean-reverting regime.
- Monitor the index as it reaches extreme values (< 0 or > 100).
- A statistical reversion is indicated when the index crosses back inside the core 0-100 range.
- Signals should be combined with broader macro analysis and strict risk management protocols.
Alerts
The indicator includes standard alert conditions and dynamic JSON webhook strings for automated trading systems, providing variables such as asset name, price, hurst value, and half-life duration on signal generation. Indicator

Support & Resistance Pro Toolkit [LuxAlgo]The Support & Resistance Pro Toolkit indicator is the ultimate professional structural analysis engine for PulseWire, meticulously engineered to provide the definitive solution for modern structural analysis by integrating four sophisticated detection algorithms—Pivots, Donchian Alternating, CSID, and ZigZag—marked by directional triangle signals to identify high-conviction swing points.
This powerhouse tool allows traders to seamlessly toggle between precise level plotting and dynamic ATR-based zones, both featuring a revolutionary security breakout buffer and 25-bar future projections, alongside advanced filtering based on traded volume, liquidity sweeps (marked by prominent dot signals), re-test frequency, and survival duration.
🔶 USAGE
The toolkit identifies significant price structures using one of four sophisticated detection methods. Once a level is identified, it can be displayed as a precise line or a dynamic zone with depth determined by the Average True Range (ATR).
Traders can use this toolkit to filter out market noise by setting minimum requirements for volume, re-tests, or liquidity sweeps. This ensures that only the most significant institutional structures are displayed on the chart.
🔹 Advanced Detection Engines
The foundation of any structural analysis is detection. This toolkit offers four unique methodologies to suit any trading style:
Pivots : The industry-standard approach using left/right strength lookbacks to find peak highs and valley lows.
Donchian (Alternating) : A high-performance state-machine detector. It identifies alternating swings without fixed lag, confirming a previous extreme precisely when price shifts to a new directional state (e.g., a new Higher High confirms the previous Lower Low).
CSID : A momentum-based detector that identifies structural extremes based on a consecutive sequence of N bullish or bearish candles, highlighting areas of strong trend initiation.
ZigZag : A volatility-adjusted method that identifies swings based on a percentage deviation from price, filtering out minor fluctuations and focusing on significant market moves.
🔹 Zone Sizing & The Security Buffer
Structural areas are rarely single prices. This toolkit treats S&R as dynamic regions of interest:
Zone Depth (ATR Mult) : Zones are calculated using the Average True Range (ATR) to ensure they adapt to current market volatility. This sets the thickness from the swing point inwards towards price.
Breakout Buffer (ATR Mult) : A revolutionary "Security Buffer" that extends the zone outwards on the breakout side. This requires price to clear an additional layer of volatility before a breakout is confirmed, significantly reducing "fakeouts" and noise-triggered mitigations.
🔹 Overlap & Structural Hygiene
Keep your charts actionable and clean with institutional-grade overlap management:
Merge Overlapping : When two zones interact, the older zone expands its boundaries to encompass the newer one, creating a "Super Zone" that respects the combined historical context.
Hide Oldest First : Prioritizes the most recent market context by hiding older levels that are overlapped by newer ones.
Hide Youngest First : Respects established, historical structures by ignoring newer, smaller levels that form within the range of existing unmitigated zones.
🔹 Institutional Filtering
Eliminate minor "noise" levels by showing only structures that meet high-conviction criteria:
Price Entries (E) : Shows zones only after they have been re-tested a specific number of times.
Strength (S) : Tracks the number of additional swing points that occur within the zone range during its lifetime.
Sweeps (SW) : Filters for zones that have successfully trapped liquidity through wick-only violations.
Traded Volume (V) : Sums every tick of volume that occurs while price is within the zone, identifying areas of massive institutional participation.
Duration (D) : Requires a level to survive for a minimum number of bars before it is considered a valid structure.
🔶 DETAILS
🔹 Symbols & Analytic Feedback
▲/▼ Triangles : Pinpoint markers at the exact bar of every detected swing high and low.
● Large Dots : Marked at the exact location of "Sweeps"—where price wicks past a boundary but closes back inside, signaling a potential reversal or liquidity grab.
Future Projections : Active, unmitigated levels extend 25 bars beyond the current price action for immediate visual guidance.
Dynamic Shorthand Labels : Positioned at the end of the extension and centered on the zone average, providing a real-time data readout:
E:Entries | S:Strength | SW:Sweeps | V:Volume | D:Duration
🔹 The Performance Dashboard
A 4-column command center providing a side-by-side comparison of structural performance across Support, Resistance, and Totals:
Active / Total : Real-time count of currently valid versus historically detected structures.
Mitigation % : The structural "break rate" of your current settings.
Avg Duration : The average number of bars a level survives before being violated—critical for timing trades.
Avg Volume : The typical "weight" of institutional activity accumulated within zones before they break.
Total Sweeps : A macro-view of liquidity hunting activity on both sides of the market.
🔶 SETTINGS
🔹 Detection Settings
Detection Method : Choose between Pivots, Donchian, CSID, or ZigZag logic.
Swing Sensitivity : Adjusts the lookback or deviation required to confirm a new swing point.
🔹 Zone & Level Sizing
Display Style : Toggles between horizontal levels and ATR-based zones.
ATR Period : Period used for the volatility calculations.
Zone Depth (ATR Mult) : Sets the vertical thickness of the S&R zones.
Breakout Buffer (ATR Mult) : Adds a buffer to the breakout side to filter out false breaks.
🔹 Filtering & Visibility
Overlap Handling : Manages how overlapping zones are displayed (Merge, Hide Oldest, or Hide Youngest).
Max Active (Unmitigated) : Limits the number of unmitigated levels shown on the chart.
Show Broken S&R : Toggles the visibility of levels that have already been mitigated.
Extend Active S&R : Extends active levels into the future for better visibility.
🔹 Minimum Requirements
Min Price Entries : Minimum re-tests required for a level to be visible.
Min Overall Strength : Minimum strength score required based on internal swing points.
Min Sweeps : Minimum liquidity sweeps required.
Min Traded Volume : Minimum accumulated volume required within the zone.
Min Duration (Bars) : Minimum age of the level in bars before display.
Indicator

Indicator

Indicator

CUSUM Trend [AlgoPoint]The CUSUM Trend by AlgoPoint brings hedge-fund-level quantitative analysis directly to your charts. While standard moving averages suffer from lag and fakeouts, this script utilizes an advanced Cumulative Sum (CUSUM) algorithm, deeply re-engineered with adaptive volatility and volume-weighted metrics to identify true market regimes.
It is designed to protect traders from choppy markets and explicitly capture high-probability, volume-backed trend breakouts before they become obvious to the retail crowd.
🧠 Under the Hood: The Quant Mechanics
Instead of a basic price deviation model, the CUSUM Trend operates on four advanced pillars:
- Zero-Lag Kernel (Ehlers SuperSmoother): We replaced traditional MAs with John Ehlers' SuperSmoother filter to establish a mathematically zero-lag baseline.
- Volume-Weighted Residuals: Price deviations (residuals) only build up the CUSUM pressure pools if they are backed by institutional volume. Low-volume spikes are treated as noise and explicitly filtered out.
- Fractal Dimension (Adaptive Thresholds): By using a proxy for the Hurst Exponent, the engine "reads" the market state. In choppy conditions, the bands expand defensively to prevent fakeouts. In trending conditions, they tighten aggressively.
- Asymmetric Volatility: The algorithm calculates upside and downside variance independently, recognizing that market drops are often much sharper than rallies.
📊 How to Read the Chart
- The Dynamic Trend Cloud: The asymmetric bands represent the institutional pressure thresholds. When price breaks and confirms outside this zone, a regime change (Bull/Bear trend) is triggered.
- Gradient Candles: Candle colors dynamically shift based on the built-up CUSUM pressure. Bright green/red indicates extreme breakout momentum, while faded colors represent a stable trend or a ranging market.
- Trailing Stop: Once a trend is established, the opposite side of the threshold acts as a dynamic trailing stop line, allowing you to ride the trend to its mathematical exhaustion.
- Hybrid Dashboard: Monitor the internal breakout pressure, fractal regime, and exact trailing stop value in real-time without cluttering your main view.
⚙️ How to Use It
- Sensitivity Profiles: Choose between Fast (Day Trade), Balanced (Swing), or Slow (Trend) in the settings. The engine automatically recalculates all internal variance and fractal thresholds based on your choice.
- Automation Ready: Fully compatible with webhook automation (3Commas, PineConnector, etc.) via dynamic JSON alerts triggering on confirmed regime breakouts.
Disclaimer: This indicator is for educational and analytical purposes only. Past performance is not indicative of future results. Indicator

Money Flow Divergence Zones [AlgoAlpha]🟠 OVERVIEW
This script identifies key price levels where volume and momentum show significant disagreement, visualizing these areas as Money Flow Liquidity Zones. By tracking the Money Flow Index (MFI) and its relationship to price action, the tool detects regular divergences that often precede market reversals. When a divergence is confirmed, the script projects a horizontal zone onto the chart based on the recent price extreme. These zones act as "liquidity pockets" that remain active until price successfully mitigates them through a wick or body cross, providing a clear map of potential support and resistance derived from volume-weighted momentum.
🟠 CONCEPTS
The core logic relies on the interaction between a smoothed MFI and pivot-based price extremes. While price might make a lower low, the MFI—calculated from $hlc3$ and volume—might make a higher low, signaling that selling pressure is exhausting despite the price drop. This script uses these divergences to set the initial context for a zone. The zones are then refined using a "Body vs Wick" logic, where the zone's depth is defined by the distance between the absolute high/low and the candle body. The MFI smoothing via a Hull Moving Average (HMA) ensures that the momentum signals are responsive yet filtered for high-frequency noise.
🟠 FEATURES
Dynamic Liquidity Zones : Automatically draws and extends support/resistance zones based on MFI divergence.
Divergence Engine : Detects regular bullish and bearish divergences with adjustable pivot lookbacks.
Visual Momentum Oscillator : Features a color-coded, smoothed MFI with a gradient midline to show volume strength.
Touch Signals : Small triangles appear when price interacts with an active zone while momentum aligns.
🟠 USAGE
Setup : Add the script to your chart. It is effective on most timeframes, but for intraday trading, the default 14-period MFI works well on 5m to 15m charts. Adjust the "Pivot Lookback" to fine-tune how sensitive the divergence detection is to local peaks.
Read the chart : Green zones represent bullish liquidity (potential support), while red zones represent bearish liquidity (potential resistance). Look for "▲" or "▼" symbols on the bars; these indicate price is currently touching a zone and might be ready for a reversal. The oscillator at the bottom confirms the trend: green for rising money flow and red for falling.
Settings that matter : The Sweep Type is critical—switching to "wick" will make zones disappear more easily (conservative), while "body" keeps zones active until a candle closes through them (aggressive). The Max Zone Age prevents old, irrelevant levels from cluttering your chart by removing them after a set number of bars.
Indicator

Hidden Markov Reversal Finder [UAlgo]Hidden Markov Reversal Finder is a regime aware reversal detection indicator that uses a compact 3 state Hidden Markov style filter with online adaptation to classify market conditions and highlight potential top and bottom rotations. The script models price behavior as transitions between three regimes:
- Bull Expansion
- Balance
- Bear Stress
Instead of running a heavy Baum Welch retraining loop, this version is designed as a lightweight real time filter. It updates regime probabilities using a transition matrix plus a two dimensional Gaussian emission model built from two normalized observations:
Return observation as a smoothed log return z score
Volatility observation as a realized volatility z score
The indicator runs in its own pane ( overlay=false ) but can optionally paint chart bars and place reversal labels on price using force overlay. It also includes a clean dashboard panel showing the current state, confidence, observation values, score, posterior probabilities, stretch, and the current setup classification.
The reversal engine is built around a top rotation and bottom rotation concept. It looks for a probability peak in a regime, then a fade from that peak, combined with momentum flip conditions and a stretch filter measured in ATR units relative to a baseline EMA. Signals are gated by a confidence threshold and a cooldown period to reduce repetitive prints.
This makes the indicator useful as a regime driven reversal framework that integrates:
State probabilities and confidence
Regime score and momentum flip
ATR based stretch extremes
Peak fade rotation logic
Clean visual markers and dashboard transparency
🔹 Features
🔸 1) Three Regime Model
The script uses three explicit regimes with distinct roles:
Bull Expansion, intended to represent positive drift conditions
Balance, intended to represent neutral or mixed drift
Bear Stress, intended to represent negative drift and higher stress conditions
Each regime has its own mean and variance assumptions for return and volatility, which are then adapted online.
🔸 2) Two Dimensional Observation System (Return and Volatility)
The model does not rely on only returns. It uses both:
A normalized return feature
A normalized volatility feature
This helps distinguish clean bullish trends from choppy balance periods, and balance periods from bearish stress regimes.
🔸 3) Transition Matrix with Persistence Controls
Users can control how sticky each regime is through persistence settings:
Bull persistence
Balance persistence
Bear persistence
The transition matrix is constructed so that most probability remains in the same regime, while the remainder flows into other regimes using asymmetric weights that reflect realistic behavior.
🔸 4) Real Time Bayesian Filter Update
Each bar, the model performs:
Prediction step using the transition matrix
Update step using Gaussian emissions
Posterior normalization
Active state selection by arg max
This produces a smooth probability based regime tracker suitable for live use.
🔸 5) Adaptation
After filtering, the model adapts its internal means and variances using a learning rate scaled by posterior responsibility. This allows the state distributions to slowly adjust to changing market conditions without full retraining.
This keeps the indicator responsive while still stable.
🔸 6) Regime Score Output
The main score line is:
Bull posterior minus Bear posterior
This produces a continuous signal that ranges between negative and positive values and functions as a regime tilt meter. A confidence ribbon is also plotted as an area band derived from the dominant posterior.
🔸 7) Confidence Gating and Visual Strength
Confidence is defined as the largest posterior probability among the three regimes. The script uses confidence to:
Gate reversal signals
Determine bar tint transparency when bar coloring is enabled
Decide whether state shift tags should be printed
This reduces noise during low clarity periods.
🔸 8) Rotation Style Reversal Engine
The reversal finder is built on rotation logic:
A top rotation occurs after a Bull probability peak fades while Bear probability begins to rise
A bottom rotation occurs after a Bear probability peak fades while Bull probability begins to rise
This is a probabilistic rotation concept rather than a simple oscillator crossover.
🔸 9) Momentum Flip Confirmation
Signals require momentum confirmation through:
Regime score change direction
Return observation crossing a flip threshold
This is designed to reduce premature top and bottom calls when the regime probabilities shift but price momentum has not actually flipped.
🔸 10) ATR Based Stretch Filter
The script computes stretch as distance from an EMA baseline measured in ATR units. Signals require:
Top signals only when stretch is above a positive threshold
Bottom signals only when stretch is below a negative threshold
This ensures reversal signals occur when price is extended, not when it is near equilibrium.
🔸 11) Cooldown Control
A cooldown setting prevents consecutive buy or sell reversal signals from printing too frequently. This is especially useful when the market chops around an extreme and repeatedly triggers partial rotation conditions.
🔸 12) Dashboard Panel
A table dashboard displays key information on the last bar:
Active state name
Confidence
Return z score and volatility z score
Regime score
Posterior probabilities
Stretch in ATR units
Current setup text such as BUY REVERSAL, SELL REVERSAL, TOP WATCH, BOTTOM WATCH, WAIT
This makes the indicator transparent and easy to interpret.
🔸 13) State Tags and Reversal Labels on Chart
When enabled, the script prints:
State tags such as BULL, BASE, BEAR with arrows
Reversal markers with a vertical guide line and bold letter B or S
Tooltips include confidence, peak probability, stretch, and current posterior probabilities.
🔸 14) Optional Probability Curves and Bar Coloring
Users can toggle:
State probability plots
Signal markers and dots
Dashboard visibility
State tag visibility
Bar coloring by regime with confidence adjusted transparency
This makes the indicator adaptable for minimalist or fully informational workflows.
🔹 Calculations
1) Return Observation Construction
The script uses log returns:
float logReturn = math.log(close / nz(close , close))
It smooths return with an EMA:
float smoothedReturn = ta.ema(logReturn, returnSmoothLength)
Then normalizes by the return standard deviation:
float returnStdev = math.max(nz(ta.stdev(logReturn, returnZLength), EPS), EPS)
float returnObs = clampFloat(smoothedReturn / returnStdev, -obsClamp, obsClamp)
Interpretation:
Return observation is a clamped z score like feature, where positive values represent bullish return pressure and negative values represent bearish return pressure.
2) Volatility Observation Construction
Realized volatility is measured as the standard deviation of log returns:
float realizedVol = nz(ta.stdev(logReturn, volLength), EPS)
Then it is normalized relative to a baseline EMA and baseline standard deviation:
float volMean = nz(ta.ema(realizedVol, volBaselineLength), realizedVol)
float volStdev = math.max(nz(ta.stdev(realizedVol, volBaselineLength), EPS), EPS)
float volObs = clampFloat((realizedVol - volMean) / volStdev, -obsClamp, obsClamp)
Interpretation:
Volatility observation is a clamped z score like feature, where higher values indicate volatility expansion relative to baseline.
3) Warmup Logic
The model waits for enough history to compute stable normalized observations:
int warmupBars = math.max(returnZLength, volBaselineLength) + volLength
bool ready = bar_index > warmupBars and not na(returnObs) and not na(volObs)
Before ready, the script avoids producing live signals and uses the initial posterior distribution.
4) Transition Matrix Configuration
The transition matrix uses persistence values and asymmetric drift splits:
From Bull, most drift flows to Balance and a smaller portion to Bear
From Bear, most drift flows to Balance and a smaller portion to Bull
From Balance, drift splits evenly between Bull and Bear
Core setup:
this.setTransition(STATE_BULL, STATE_BALANCE, bullDrift * 0.78)
this.setTransition(STATE_BULL, STATE_BEAR, bullDrift * 0.22)
...
this.setTransition(STATE_BEAR, STATE_BALANCE, bearDrift * 0.78)
this.setTransition(STATE_BEAR, STATE_BULL, bearDrift * 0.22)
This design makes Balance act like a bridge regime and reduces unrealistic direct flip frequency.
5) Emission Model: 2D Gaussian Density
Each state computes an emission probability from return and volatility observations using a 2D Gaussian likelihood:
float exponent = -0.5 * ((retDeviation * retDeviation) / retVariance + (volDeviation * volDeviation) / volVariance)
float normalizer = 1.0 / (2.0 * math.pi * math.sqrt(retVariance * volVariance))
math.max(normalizer * math.exp(math.max(exponent, -24.0)), EPS)
Variances are floored at 0.12 to prevent collapse.
6) Prediction Step
The model predicts next probabilities using the transition matrix:
predictedProbability += posterior * transition(fromState, toState)
Then normalizes the predicted vector so it sums to 1.
7) Filter Update Step
The posterior is updated by multiplying predicted probabilities by emission likelihoods:
nextPosterior = predicted * emission(state, retObs, volObs)
Then normalized. The active state is the arg max of the posterior.
8) Online Adaptation
The model updates state means and variances using posterior responsibility times learning rate:
float responsibility = posterior * learningRate
Means update by moving toward the current observation:
nextMuRet = oldMuRet + responsibility * retError
nextMuVol = oldMuVol + responsibility * volError
Variances update toward squared error:
nextVarRet = oldVarRet + responsibility * (retError * retError - oldVarRet)
nextVarVol = oldVarVol + responsibility * (volError * volError - oldVarVol)
All parameters are clamped to stability ranges so the model does not explode.
9) Regime Score and Confidence
Score is defined as:
posterior - posterior
Confidence is the maximum posterior:
posterior
These values drive visuals and signal gating.
10) Stretch Calculation in ATR Units
Stretch uses an EMA basis of price and measures distance in ATR units:
float basis = ta.ema(close, stretchLength)
float atrValue = math.max(ta.atr(14), syminfo.mintick)
float stretch = (close - basis) / atrValue
Top stretch requires:
stretch >= stretchThreshold
Bottom stretch requires:
stretch <= -stretchThreshold
This ensures reversals occur when price is statistically extended relative to recent volatility.
11) Probability Peak and Fade Logic
The script measures recent peaks for bull and bear probabilities:
float bullPeak = ta.highest(bullProb , peakLookback)
float bearPeak = ta.highest(bearProb , peakLookback)
Fade is peak minus current:
bullFade = bullPeak - bullProb
bearFade = bearPeak - bearProb
Top rotation condition requires:
Bull peak above threshold
Bull fade above minimum
Bear probability rising
Bottom rotation requires the mirrored conditions.
This captures the idea of regime dominance peaking, then fading as the opposite side begins to regain influence.
12) Momentum Flip Confirmation
Momentum down requires:
Regime score decreasing
Return observation strongly negative below a flip threshold
Momentum up requires:
Regime score increasing
Return observation strongly positive above the flip threshold
This prevents signals when probabilities fade but momentum remains neutral.
13) Signal Gating and Cooldown
Signals require confidence above the threshold and a cooldown to avoid repeated triggers:
confidenceValue >= confidenceThreshold
bar_index - lastSignalBar > cooldownBars
14) Buy and Sell Reversal Signals
Buy reversal:
Bottom rotation
Momentum up
Bottom stretch
Confidence filter
Cooldown filter
Sell reversal:
Top rotation
Momentum down
Top stretch
Confidence filter
Cooldown filter
A Balance signal is also triggered when the state changes to Balance with sufficient confidence.
15) Visual Outputs
The indicator plots:
Regime score line with area fill around zero
Confidence ribbon as an area band
Optional posterior curves for Bull, Balance, Bear
Normalized stretch line scaled by the stretch threshold
Optional dots on the chart for reversal events
Optional bar coloring on the main chart
It also prints:
Reversal labels B and S with stretch, confidence, and peak probability tooltips
State tags on regime shifts
A dashboard panel summarizing live state and setup context Indicator

Volatility-Adjusted Rate of Change [QuantAlgo]🟢 Overview
The Volatility-Adjusted Rate of Change (VA-ROC) is a momentum oscillator that normalizes price changes against current market volatility, helping traders identify meaningful momentum shifts, spot overbought/oversold extremes, and filter out noise caused by changing volatility regimes. By measuring how large a price move is relative to what's normal for the instrument, this indicator reveals genuine directional pressure that raw momentum readings often obscure.
🟢 How It Works
The indicator begins by calculating the single-bar price change and dividing it by the Average True Range over a configurable lookback period. This normalization step ensures that the same oscillator reading carries equal significance whether applied to a low-volatility blue chip or a highly volatile cryptocurrency, a concept absent from traditional rate of change indicators.
price_momentum = ta.change(close) / ta.atr(atr_length)
When price rises by an amount that is large relative to recent volatility, the normalized momentum produces a strong positive reading. Conversely, a decline that is modest in absolute terms but significant relative to the current ATR environment will register appropriately. This volatility-adjustment prevents the oscillator from generating inflated signals during high-volatility regimes or muted signals during quiet markets.
A sensitivity multiplier then scales the normalized value, allowing traders to compress or amplify the oscillator's range to suit their instrument and timeframe:
va_roc = calc_ma(price_momentum * sensitivity, ma_length, ma_type)
The scaled momentum is then smoothed using a configurable moving average (supporting SMA, EMA, WMA, RMA, HMA, VWMA, DEMA, and TEMA), which filters bar-to-bar noise while preserving the shape of genuine momentum waves. The smoothed output is the final VA-ROC value, plotted against a system of four threshold levels that define bullish, bearish, neutral, and extreme zones.
Momentum state is determined by the oscillator's position relative to these thresholds:
is_bullish = va_roc > upper_threshold
is_bearish = va_roc < lower_threshold
Crossings into bullish or bearish territory, zero-line crosses, and entries into extreme zones each generate distinct signals and corresponding alerts.
🟢 Key Features
The indicator is built around a threshold-based momentum framework with gradient-colored visualization, preset configurations, and a full alert system, all designed to give traders immediate clarity on momentum conditions without manual tuning.
1. Volatility Normalization: Unlike traditional ROC or momentum oscillators that produce raw price differences, VA-ROC divides every price change by the ATR, creating a dimensionless reading that remains consistent across instruments, timeframes, and volatility regimes. A reading of +1.0 always means "price moved one ATR's worth in a single bar", whether you're trading forex, equities, or crypto. This eliminates the need to recalibrate threshold levels when switching between assets.
2. Adaptive Threshold Zones: Four configurable levels (Upper Extreme, Upper Threshold, Lower Threshold, and Lower Extreme) divide the oscillator into five distinct momentum zones. The neutral zone between the upper and lower thresholds represents normal market fluctuation. Crossings above the upper threshold confirm bullish momentum, while crossings below the lower threshold confirm bearish momentum. The extreme levels mark climactic conditions where momentum is unusually powerful, often coinciding with exhaustion points or the early stages of a strong trend continuation.
3. Preset Configurations: Three built-in presets automatically optimize the sensitivity, ATR lookback, MA type, and smoothing length for different trading styles. Default provides balanced readings suited for swing trading on 4H and daily charts. Fast Response amplifies small moves with minimal smoothing for intraday scalping. Smooth Trend compresses the oscillator and applies heavier smoothing to highlight only significant directional moves for position trading.
4. Built-in Alert System: Comprehensive alerts covering all key momentum events, including bullish and bearish momentum confirmation, zero-line crossovers in both directions, and entries into upper and lower extreme zones. A combined momentum direction change alert is also included. All alerts carry exchange, ticker, and interval placeholders for seamless integration with notification workflows.
5. Visual Customization: Choose from 5 color presets (Classic, Aqua, Cosmic, Cyber, Neon) or create a fully custom color scheme using individual bullish, bearish, and neutral color pickers. Optional price bar coloring overlays the oscillator's momentum colors directly onto your main chart candles, tinting bars bullish or bearish based on the current threshold state while leaving neutral bars uncolored, providing instant trend confirmation without switching panels.
Indicator

Adaptive Momentum Classifier [WillyAlgoTrader]📡 Adaptive Momentum Classifier is an overlay indicator that evaluates four independent market dimensions — momentum, trend, volatility position, and money flow — ranks each one against its own historical distribution using percentile scoring, and combines them into a single composite score (0–100%) that drives signal generation. Signals fire only when the composite score crosses a threshold with minimum feature agreement across axes, passes through five independent filters, and is confirmed on bar close.
The core idea: instead of using one indicator to generate signals, this tool treats four market dimensions as independent measurement axes, normalizes each to a uniform 0–1 scale via percentile ranking, weights and combines them into a consensus score, and then requires both the score threshold AND a minimum number of agreeing axes before allowing a signal. This multi-axis + agreement gate architecture filters out situations where a single strong reading (e.g., RSI spike) would trigger a false signal while the other dimensions disagree.
🧩 WHY THESE COMPONENTS WORK TOGETHER
Traditional signal generators face a fundamental problem: a single indicator measures one market dimension. RSI measures momentum speed but is blind to trend direction. MACD measures trend but ignores where price sits within its volatility envelope. Volume-based indicators measure flow but know nothing about price momentum. Using any one of these alone produces signals that ignore critical market context.
Simply combining indicators with AND/OR logic (e.g., "buy when RSI > 50 AND MACD > 0") doesn't solve the deeper problem: the indicators are on different scales, have different distributions, and their raw values aren't comparable. RSI = 55 and MACD histogram = 0.002 both "lean bullish" but you can't meaningfully average them.
This indicator solves both problems:
Step 1 — Orthogonal axis design: Each axis measures a genuinely different market dimension. Momentum (how fast), Trend (which direction), Volatility Position (where within the range), Flow (where is money going). They are deliberately chosen to be as independent as possible.
Step 2 — Percentile normalization: Each axis's raw value is ranked against its own recent history. "Is this RSI-ROC blend reading higher than 75% of the last 89 readings?" This converts every axis to a uniform 0–1 scale where 0.5 = median. Now all four axes are directly comparable and combinable.
Step 3 — Weighted consensus: The four normalized scores are combined with weights (Trend 1.2×, Momentum 1.0×, Flow 1.0×, Volatility 0.8×) into a single composite score. The weighting reflects that trend conviction is slightly more predictive than raw momentum.
Step 4 — Agreement gate: Even with a high composite score, the signal is blocked unless at least half the axes independently agree (each reading > 0.6 for bullish or < 0.4 for bearish). This prevents one extreme axis from dominating the composite and producing a false consensus.
Step 5 — Filter stack: Five independent filters (trend alignment, volatility regime, volume, score acceleration, HTF bias) provide additional context gates. The signal only fires when all enabled filters pass simultaneously.
No single component is useful alone. Percentile ranking without multiple axes just normalizes one indicator. Multiple axes without percentile ranking can't be meaningfully combined. A combined score without the agreement gate can be dominated by one outlier. And all of this without filters would still fire in unsuitable market conditions. The full pipeline is required.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Four-axis percentile scoring engine.
Each axis is built from two sub-components blended together, then converted to a 0–1 percentile rank against the scoring lookback window (default 89 bars). The percentile function counts what fraction of historical values are below the current value — producing a uniform distribution with no dead zones (unlike z-score normalization which compresses values near the mean).
Axis 1 — Momentum (weight 1.0):
Sub-components: RSI(13) centered at 50, and ROC(9). Each is percentile-ranked independently, then blended 60% RSI + 40% ROC. RSI provides stable momentum reading, ROC provides faster reaction to price acceleration. The blend captures both speed (ROC) and sustained momentum (RSI) in a single axis.
Axis 2 — Trend (weight 1.2):
Sub-components: MACD histogram (12/26/9), and EMA slope normalized by ATR. EMA slope = (EMA − EMA ) / (ATR × 5), making it scale-independent across instruments. Each percentile-ranked, blended 60% MACD + 40% slope. MACD histogram captures momentum of the trend itself (acceleration), while EMA slope captures sustained directional movement. This axis receives the highest weight (1.2) because directional conviction is the strongest single predictor of continuation.
Axis 3 — Volatility Position (weight 0.8):
Sub-components: Bollinger %B (21-period, showing where price sits within the band envelope, 0 = lower band, 1 = upper band), and ATR expansion ratio (current ATR / SMA of ATR over lookback). Combined as: (BB%B − 0.5) × min(ATR_ratio, 2.5), then percentile-ranked. This creates a directional volatility signal: price at upper band during volatility expansion scores high (strong bullish breakout), price at upper band during contraction scores lower (potential mean-reversion). The ATR ratio is capped at 2.5 to prevent extreme volatility spikes from distorting the axis. Lower weight (0.8) reflects that volatility position is a confirming factor, not a primary driver.
Axis 4 — Flow (weight 1.0, auto-disabled without volume):
Sub-components: MFI(13) centered at 50, and OBV slope (smoothed OBV EMA(21), slope = (OBV_EMA − OBV_EMA ) / |OBV_EMA|). Each percentile-ranked, blended 50/50. MFI combines price and volume into a single money flow reading, OBV slope shows whether accumulation is accelerating or decelerating. On instruments without volume data (forex), this axis returns 0.5 (neutral) and its weight drops to 0, so the composite score is calculated from three axes only.
2️⃣ Composite score with symmetric thresholds.
The four axes are combined: composite = (1.0 × momentum + 1.2 × trend + 0.8 × volatility_position + 1.0 × flow) / total_weight. Result is 0–1 where 0 = maximum bearish consensus, 0.5 = neutral, 1 = maximum bullish consensus. A buy signal fires when the composite crosses above the threshold (default 0.618). A sell signal fires when it crosses below (1 − threshold = 0.382). This creates symmetric entry conditions: the same strength of consensus is required for both directions.
3️⃣ Feature agreement gate.
Independent of the composite score, each axis is evaluated for directional agreement: > 0.6 = bullish vote, < 0.4 = bearish vote, 0.4–0.6 = abstain. The agreement ratio = max(bull_votes, bear_votes) / active_axes. Signals require agreement ≥ 0.5 (at least half the axes independently confirming the same direction). This prevents false signals from composite score averaging: if momentum = 0.95 but trend = 0.3 and volatility = 0.4, the composite might cross the threshold but only 1/4 axes agree — signal is blocked.
4️⃣ Score acceleration filter.
The rate of change of the composite score: acceleration = score − score . Signals require |acceleration| ≥ Min Score Acceleration (default 0.02). This filters out slow-drift crossovers where the score gradually creeps past the threshold without any decisive move — these typically represent noise, not genuine momentum shifts. Only fast, decisive threshold crosses produce signals.
5️⃣ Five-filter stack.
Each filter is independently toggleable:
— Trend Alignment (default On): price must be above EMA(50) for longs, below for shorts — prevents counter-trend entries
— Volatility Regime (default On): ATR ratio must be between 0.4 and 3.0 — suppresses signals during dead markets (ATR < 40% of average) and crash conditions (ATR > 300% of average)
— Volume Confirmation (default On): volume must exceed 80% of its 20-period SMA — confirms market participation. Auto-disabled on instruments without volume data
— Score Acceleration (default 0.02): described above. Set to 0 to disable
— Higher TF Bias (default disabled): when a timeframe is selected, price must be above/below EMA(21) on the higher timeframe for longs/shorts. Uses + lookahead_on for non-repainting HTF data
6️⃣ Direction lock — no consecutive same-direction signals.
After a buy signal fires, the next signal can only be a sell (and vice versa). This prevents signal clustering where multiple buy signals fire in sequence during a strong trend — you get one entry per direction until the trend reverses.
7️⃣ Four sensitivity presets.
Each preset overrides two parameters simultaneously:
— Conservative : threshold 0.80, lookback 150 — requires very strong consensus over a long history, fewer but higher-conviction signals
— Default : uses your manual settings (threshold 0.618, lookback 89)
— Aggressive : threshold 0.60, lookback 60 — lower bar for signals, shorter history, faster adaptation
— Scalping : threshold 0.55, lookback 40 — minimum consensus required, very short history, designed for 1–5M charts
The lookback affects all four axes simultaneously (percentile ranking window), so the entire scoring engine adapts as a unit.
8️⃣ Dynamic trend band.
A visual EMA ± 0.5× ATR band colored by the composite score: green (score > 55%), red (< 45%), yellow (neutral). This provides an at-a-glance trend context without needing to read the dashboard. The band width adapts to volatility automatically.
9️⃣ Signal strength classification.
Each signal is classified based on the composite score at the moment of firing: Strong (score ≥ 85%), Medium (≥ 75%), Weak (< 75%). Displayed in the dashboard and available in alert messages. This helps you size positions or filter setups based on conviction level.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Raw feature calculation: RSI(13), ROC(9), MACD(12/26/9) histogram, EMA slope (normalized by ATR), BB%B(21), ATR ratio, MFI(13), OBV slope — eight raw values computed from price and volume.
Step 2 — Percentile ranking: Each raw value is ranked against its own history over the scoring lookback (default 89 bars). The pctRank function iterates through the lookback window and counts what fraction of past values are below the current value. Result: 0.0 (lower than all history) to 1.0 (higher than all history). This normalization is performed for each of the eight sub-components independently.
Step 3 — Axis blending: Each pair of sub-components is blended into one axis score: momentum = 0.6 × pctRSI + 0.4 × pctROC, trend = 0.6 × pctMACD + 0.4 × pctSlope, volatility = pctVolPosition (single combined raw), flow = 0.5 × pctMFI + 0.5 × pctOBV.
Step 4 — Weighted composite: composite = (1.0 × momentum + 1.2 × trend + 0.8 × volatility + 1.0 × flow) / total_weight. On instruments without volume: flow weight = 0, total_weight = 3.0 instead of 4.0.
Step 5 — Threshold crossing: Buy triggers when composite crosses above the threshold (default 0.618) from below. Sell triggers when composite crosses below (1 − 0.618 = 0.382) from above. Both require barstate.isconfirmed.
Step 6 — Agreement check: Each axis is independently classified as bullish (> 0.6), bearish (< 0.4), or neutral. At least 50% of active axes must agree with the signal direction.
Step 7 — Filter stack: All five enabled filters must pass. Any failure blocks the signal.
Step 8 — Direction lock: Signal must be opposite to the last confirmed signal.
Step 9 — Emission: Buy (▲) or Sell (▼) label placed on the confirmed bar.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator to your chart
2. Select a sensitivity preset matching your style (or use Default)
3. The trend band immediately shows the current momentum bias (green/red/yellow)
4. Wait for a ▲ (buy) or ▼ (sell) label — check the dashboard for score and strength
5. Use the agreement ratio (e.g., 3/4) to confirm multi-axis consensus
👁️ Reading the chart:
— 🟢 Green trend band = bullish momentum (score > 55%)
— 🟡 Yellow trend band = neutral / transition zone
— 🔴 Red trend band = bearish momentum (score < 45%)
— 🟢 ▲ label below bar = confirmed buy signal
— 🔴 ▼ label above bar = confirmed sell signal
— Band width = current volatility (wider = more volatile)
📊 Dashboard fields:
— Trend: current composite direction (Bullish / Bearish / Neutral)
— Last Signal: most recent signal with bars elapsed
— Strength: signal quality (Strong / Medium / Weak)
— Score: current composite as percentage
— Agreement: how many axes confirm (e.g., 3/4)
— Volatility: ATR regime (High / Normal / Low)
— TF and version
🔧 Tuning guide:
— Too many signals: increase threshold (0.70–0.85), enable more filters, use Conservative preset
— Too few signals: decrease threshold (0.55–0.60), reduce lookback (50–70), use Aggressive preset
— Signals too late: shorten RSI/ROC/MACD lengths, reduce lookback
— Too many false signals in ranging markets: enable ADX-aware Volatility Regime filter, increase Min Score Acceleration to 0.03–0.05
— Scalping 1–5M: use Scalping preset (threshold 0.55, lookback 40), lower filter aggressiveness
— Swing 4H–1D: use Conservative preset (threshold 0.80, lookback 150), enable HTF bias filter
⚙️ KEY SETTINGS REFERENCE
⚙️ Main:
— Sensitivity Preset (default Default): Conservative / Default / Aggressive / Scalping
— Scoring Lookback (default 89): percentile ranking window — higher = more stable, lower = faster adaptation
— Signal Threshold (default 0.618): minimum composite score for buy signals (sell = 1 − threshold)
📊 Feature Engine:
— RSI Length (default 13) / ROC Length (default 9): momentum axis sub-components
— MACD Fast/Slow/Signal (default 12/26/9): trend axis MACD
— Bollinger Length (default 21): volatility position axis
— MFI Length (default 13) / OBV Smooth (default 21): flow axis
🔍 Filters:
— Trend Alignment (default On): EMA(34) trend direction gate
— Volatility Regime (default On): ATR ratio 0.4–3.0 range gate
— Volume Confirmation (default On): volume > 80% of 20-SMA
— Min Score Acceleration (default 0.02): minimum speed of score change
— Higher TF Bias (default Off): optional HTF EMA(21) alignment
🎨 Visual:
— Trend band (EMA ± 0.5× ATR, scored coloring)
— Background tint / Dynamic bar coloring (optional)
— Auto / Dark / Light theme
🔔 Alerts
— 🟢 BUY — ticker, price, timeframe, composite score
— 🔴 SELL — same fields
Both support plain text and JSON webhook format. Bar-close confirmed, direction-locked (no consecutive same-direction alerts).
⚠️ IMPORTANT NOTES
— 🚫 No repainting. All signals require barstate.isconfirmed. HTF bias uses + lookahead_on. A warmup period (max of lookback, MACD slow period, and trend EMA length, minimum 50 bars) prevents signals during insufficient data.
— 📐 The composite score is not a probability . A score of 80% means four market dimensions, percentile-ranked against recent history, strongly agree on bullish conditions. It measures consensus quality, not prediction accuracy.
— ⚖️ Percentile ranking is relative to the lookback window . A score of 0.9 means "higher than 90% of the last N bars" — it does not mean the same thing on different instruments or timeframes. Each chart creates its own distribution.
— 📊 The Flow axis (MFI + OBV) auto-disables on instruments without volume data (many forex pairs). The composite then runs on three axes with adjusted total weight. Signal quality is slightly lower without flow data but the other three axes remain fully functional.
— 🔒 Direction lock means you get one signal per trend leg . After a buy, only a sell can fire next. This prevents clustering but means you won't get "add to position" signals — the tool provides one entry per direction.
— 🔄 The agreement gate requires ≥ 50% of axes to independently confirm. On 4-axis instruments, this means ≥ 2. On 3-axis (no volume), ≥ 2. This is a deliberately moderate threshold — raising it to 75%+ would make signals extremely rare.
— 🛠️ This is a signal and analysis tool , not an automated trading bot. It classifies momentum consensus and generates signals — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Volume-dependent features auto-adapt to available data. Indicator

Ornstein-Uhlenbeck Mean Reversion Probability Bands [UAlgo]Ornstein-Uhlenbeck Mean Reversion Probability Bands is a statistical mean reversion indicator that models price as a mean reverting process and projects dynamic probability style zones around an estimated equilibrium mean. The script uses a rolling lookback of closing prices, fits an Ornstein-Uhlenbeck inspired parameter set from recent behavior, and then converts that estimate into inner and outer deviation bands around the current mean.
The indicator runs directly on price ( overlay=true ) and is built to help traders identify when price is stretched away from its estimated equilibrium. Instead of using a fixed moving average and static standard deviation, the script attempts to infer a mean reverting structure from the data itself. It estimates the long term mean, the speed of reversion, and an equilibrium style dispersion measure, then plots two upside and two downside mean reversion zones.
When price pushes into the upper or lower band regions, the script calculates a standardized distance from the estimated mean and displays a probability style label with both the percentage score and the current z score. This gives the user a quick visual read of how statistically extended price is relative to the model.
A key strength of this script is that it combines:
A rolling Ornstein-Uhlenbeck style parameter estimation
Adaptive mean reversion zones
Probability style stretch labels at band events
A clean overlay presentation with visible upper and lower probability regions
Important note: The percentage label in this script is a normal distribution coverage style score derived from the current z score. It is best understood as a probabilistic stretch measure, not a literal exact OU first passage probability.
🔹 Features
🔸 1) Ornstein-Uhlenbeck Inspired Mean Reversion Model
The script estimates a mean reverting process from recent closing prices instead of relying only on a moving average. It uses a rolling regression style approach on consecutive price observations, then converts those estimates into Ornstein-Uhlenbeck style parameters.
This makes the indicator more model driven than a standard band tool.
🔸 2) Rolling Adaptive Mean Line
The central mean line is not a fixed average only. It is the estimated equilibrium level ( mu ) of the fitted process. As the rolling price sample changes, the model updates and the mean shifts with changing market structure.
The mean line also changes color depending on whether current price is above or below that estimated equilibrium.
🔸 3) Dual Mean Reversion Zones (Inner and Outer)
The script builds two sets of reversion bands around the mean:
Inner bands using the inner multiplier
Outer bands using the outer multiplier
This creates a layered framework where the inner zone marks an early stretch area and the outer zone marks a more extreme statistical extension.
🔸 4) Probability Style Stretch Labels
When price crosses into the upper or lower band regions, the script calculates a z score based on current distance from the estimated mean and converts it into a percentage style probability score.
The label shows:
A directional marker
The probability style percentage
The current z score
This gives the user both a visual event trigger and a numeric measure of extension.
🔸 5) Visual Zone Based Design
The indicator uses filled upper and lower zones rather than emphasizing the band lines themselves. This creates a cleaner chart display where the mean line stays visible and the stretch regions are highlighted as colored areas above and below it.
This makes the indicator easy to read during fast chart scanning.
🔸 6) Configurable Lookback, Time Step, and Band Width
Users can customize:
The rolling lookback period used for model estimation
The time step parameter ( dt ) used in OU conversion
The inner band multiplier
The outer band multiplier
This makes the script adaptable to different timeframes, instruments, and preferred sensitivity levels.
🔸 7) Built In Estimation Safeguards
The parameter estimation logic includes fallback protections. If the inferred model parameters are unstable or unrealistic, the script falls back to simpler sample statistics. This helps prevent unusable outputs during difficult market regimes or low quality fits.
🔸 8) Directional Touch Event Logic
The script tracks both upper side and lower side band interaction:
Upper side events can signal statistically stretched bullish price movement
Lower side events can signal statistically stretched bearish price movement
Labels are only created on crossing events, which helps reduce repeated prints while price remains outside the band.
🔹 Calculations
1) Rolling Price Queue Management
The script stores recent closing prices in an array with a fixed maximum length:
price_array.update_queue(close, length_input)
The queue update method behaves differently depending on bar state:
On a new bar, it pushes the latest value
On an updating live bar, it overwrites the last stored value
This keeps the rolling sample aligned with the current chart state without duplicating the active bar.
2) Fallback Mean and Dispersion Estimates
Before attempting the OU style fit, the script calculates simple fallback values:
float fallback_mu = src_array.avg()
float fallback_sigma = src_array.stdev()
These act as safety defaults if the regression based OU estimate is not reliable.
Important note:
In this script, fallback_sigma is a simple sample standard deviation of price levels, not return volatility.
3) AR(1) Style Regression on Consecutive Prices
The model estimation is built from consecutive price pairs:
x = price
y = price
The script computes:
Mean of x
Mean of y
Covariance between x and y
Variance of x
Then it estimates:
float b = sum_cov / sum_var_x
This creates an AR(1) style coefficient that is later translated into OU style parameters.
4) Conversion from AR(1) Form to OU Style Parameters
If the estimated b is within a valid range:
if b > 0.05 and b < 0.95
the script computes:
float a = mean_y - b * mean_x
float mu_exact = a / (1.0 - b)
float theta_exact = -math.log(b) / dt
Interpretation:
mu_exact is the estimated long run mean.
theta_exact is the implied mean reversion speed.
The conversion assumes the AR(1) relation is a discrete time representation of a mean reverting process.
5) Residual Variance and Equilibrium Dispersion
The script next measures residual error from the AR(1) fit:
float err = y_i - (a + b * x_i)
float var_err = sum_err_sq / (n - 1)
Then it converts that residual variance into an equilibrium variance estimate:
float var_eq = var_err / (1.0 - b * b)
Finally:
float calc_sigma = math.sqrt(var_eq)
Important implementation note:
The variable named sigma in this script is used as an equilibrium style standard deviation around the mean, not as the continuous time OU diffusion coefficient from the SDE form.
6) Stability Filter for the Estimated Sigma
Even if the AR(1) fit is mathematically valid, the script only accepts the calculated sigma when it is reasonably close to the fallback sample standard deviation:
if calc_sigma < fallback_sigma * 1.5 and calc_sigma > fallback_sigma * 0.5
If this test fails, the script keeps the fallback values instead.
This helps avoid unstable band widths caused by bad short term fits.
7) Final Parameter Output
The estimation method returns:
OU_Params.new(theta, mu, sigma_eq)
Where:
theta is the estimated reversion speed
mu is the estimated equilibrium mean
sigma_eq is the accepted equilibrium dispersion measure
These parameters are then used to build the bands.
8) Band Construction
The script computes four band levels around the estimated mean:
float up_out = mean_val + (dev_val * mult_outer)
float up_in = mean_val + (dev_val * mult_inner)
float dn_in = mean_val - (dev_val * mult_inner)
float dn_out = mean_val - (dev_val * mult_outer)
Interpretation:
Inner bands represent a milder deviation from the mean.
Outer bands represent a more extreme deviation from the mean.
9) Mean and Zone Visualization
The mean line is explicitly plotted:
p_mean = plot(ou_bands.mean, color=color_mean, linewidth=2, title="Mean")
The inner and outer band plots are also created, but their colors are fully transparent:
color color_inner_up = color.new(#ffb74d, 100)
color color_outer_up = color.new(#ef5350, 100)
...
This means the visible structure mainly comes from the zone fills:
fill(p_ui, p_uo, ...)
fill(p_li, p_lo, ...)
So the user sees clean upper and lower probability zones rather than several bright boundary lines.
10) Touch and Crossing Logic
The script first checks whether price is currently inside a stretch area:
bool touch_upper = close >= ou_bands.upper_inner
bool touch_lower = close <= ou_bands.lower_inner
Then it checks for fresh crossings:
bool cross_up_in = ta.crossover(close, ou_bands.upper_inner)
bool cross_up_out = ta.crossover(close, ou_bands.upper_outer)
bool cross_dn_in = ta.crossunder(close, ou_bands.lower_inner)
bool cross_dn_out = ta.crossunder(close, ou_bands.lower_outer)
Labels are only created when price is touching the region and a fresh crossing occurs. This avoids creating labels on every bar that remains outside the band.
11) Z Score Calculation
When an event occurs, the script calculates the standardized distance from the mean:
float current_z_score = dev_val != 0 ? math.abs(close - mean_val) / dev_val : 0.0
Interpretation:
A z score of 1 means price is one equilibrium standard deviation away from the estimated mean.
Higher values indicate a more statistically stretched condition.
12) Probability Style Score Calculation
The script converts the z score into a percentage style score using an approximation of the error function:
float x = math.abs(z_score) / math.sqrt(2.0)
...
float prob = erf_approx * 100.0
Because erf(|z| / sqrt(2)) corresponds to the probability mass within plus or minus that z distance under a normal distribution, the output behaves like a confidence or coverage score.
Important note:
This is not a direct OU mean reversion probability in the strict stochastic process sense. It is a normal distribution style stretch score based on the current z distance.
13) Upper Event Label Logic
When price crosses into the upper band region:
if (touch_upper and cross_up_in) or (touch_upper and cross_up_out)
the script prints a bearish styled label above the bar:
"▼ %" + str.tostring(probability, "#.##") + " (Z:" + str.tostring(current_z_score, "#.##") + ")"
This reflects the idea that price is statistically extended above the mean and may be vulnerable to reversion.
14) Lower Event Label Logic
When price crosses into the lower band region:
if (touch_lower and cross_dn_in) or (touch_lower and cross_dn_out)
the script prints a bullish styled label below the bar:
"▲ %" + str.tostring(probability, "#.##") + " (Z:" + str.tostring(current_z_score, "#.##") + ")"
This reflects the idea that price is statistically extended below the mean and may be vulnerable to reversion.
15) Role of the Time Step Input
The dt_input parameter affects the conversion from the AR(1) coefficient into the OU reversion speed:
float theta_exact = -math.log(b) / dt
A larger dt lowers the inferred theta for the same b .
A smaller dt raises the inferred theta for the same b . Indicator

Indicator

Strong Breakouts MTF | ProjectSyndicateStrong Breakouts MTF automatically identifies and power-ranks high-probability breakout opportunities by analyzing historical pivot structures. It filters for quality, calculates a 0-10 strength score for every breakout based on zone tightness, candle momentum, and proximity to the breakout level, and presents all data on the chart and in a comprehensive multi-timeframe dashboard to eliminate noise and focus on breakouts that matter.
• 🎯 Power-Ranking System (0-10) — every breakout is given a strength score based on a weighted algorithm that assesses zone structure, breakout candle characteristics, and ATR-based volatility, providing an instant quality assessment.
• 🎨 Strength-Based Color Scheme — breakout zones are colored by their power rank; stronger breakouts get darker, more prominent colors for immediate visual hierarchy.
• 🧠 Smart Pivot Structure Detection — automatically identifies the underlying pivot high/low structure that creates the breakout zone, ensuring the detected levels are based on significant market turning points.
• 📊 On-Chart Statistics — each breakout zone displays its direction (Bullish/Bearish) and its calculated strength score directly on the chart.
NQ
• 🧭 Full MTF Dashboard Display — provides a complete market overview across 7 timeframes (M1, M5, M15, M30, H1, H4, D1), showing the latest breakout signal, its strength, entry/SL/TP levels, and how many bars ago it occurred on that timeframe. The dashboard is stable and consistent regardless of the chart you are viewing.
• 🔔 Comprehensive Alerts — get notified the moment a new breakout occurs, with the alert message containing the full details: strength, entry, SL, and TP levels.
• ✅ Quality Control Filters — a user-configurable minimum strength score allows you to filter out weak, low-probability breakouts and focus only on high-quality signals.
• 🔧 Fully Customizable — control everything from the breakout lookback period and ATR multipliers for SL/TP to the visibility of the dashboard and on-chart visuals.
BTCUSD
• 🎯 Why this algo is unique: Standard breakout indicators often generate excessive false signals or repaint. This algorithm uses a multi-factor scoring system to quantify the quality of a breakout in real-time. It doesn’t just show you a breakout; it tells you how strong it is. The MTF dashboard provides a complete, stable cross-timeframe perspective that is impossible to achieve with standard indicators.
• 🚀 Apply to Gold (XAUUSD), Forex, Crypto, and Indices on any timeframe. The breakout lookback and minimum score settings allow it to adapt to anything from scalping to swing trading.
USDJPY
• 🎯 How to use this? Focus on trading opportunities from high-strength breakouts rated 7/10 or higher, as these have the highest probability of a significant follow-through. Use the dashboard to quickly identify which timeframes have active signals and use the on-chart visuals to analyze the breakout structure in detail.
• ⚠️ IMPORTANT NOTICE: This indicator is designed to identify high-probability breakout opportunities. It should NOT be used as a standalone signal for entering trades. Always use it in conjunction with your own trading strategy, price action analysis, and other technical indicators to confirm trade setups and manage risk.
Alerts Setup
To receive the detailed breakout alerts, follow these steps:
This single alert will trigger for any new Bullish or Bearish breakout detected by the script.
1.Click the "Alert" button in the top toolbar of PulseWire.
2.In the "Condition" dropdown, select "Strong Breakouts MTF".
3.In the second dropdown, choose "Any alert() function call".
4.Set "Expiration" to your desired time.
5.Click "Create".
Alerts Format
BULLISH BREAKOUT
Symbol : XAUUSD
Timeframe: 5
Strength : 7.4 / 10
Entry : 3185.50
SL : 3181.20
TP1 : 3189.80
TP2 : 3194.10
Bearish Breakout:
BEARISH BREAKOUT
Symbol : XAUUSD
Timeframe: 5
Strength : 6.1 / 10
Entry : 3178.30
SL : 3182.60
TP1 : 3174.00
TP2 : 3169.70 Indicator

Indicator

Volatility-Gated Trend Oscillator [QuantAlgo]🟢 Overview
The Volatility-Gated Trend Oscillator identifies statistically significant trend conditions by measuring price deviation from a dynamic baseline and filtering out normal market noise through an adaptive volatility floor. It calculates a moving average of the chosen type as a baseline, then measures how far price has deviated from it relative to average absolute deviation to define a noise threshold. Only when price breaks decisively beyond this threshold is a trend state confirmed, helping traders distinguish genuine momentum from random noise across different timeframes and markets.
🟢 How It Works
The indicator's core methodology lies in its dual-layer approach combining deviation measurement with volatility-gated filtering, where trend confirmation requires price movement to exceed statistically meaningful thresholds.
First, a configurable moving average is calculated to establish a dynamic baseline reflecting the underlying trend at the chosen sensitivity level:
baseline = get_ma(src, sensitivity, ma_type)
raw_diff = src - baseline
Then, the average absolute deviation from the baseline is measured over the same period and scaled by a user-defined multiplier to construct an adaptive noise floor, which is the minimum price deviation required to confirm a trend signal:
noise_floor = ta.sma(math.abs(raw_diff), sensitivity) * noise_mult
The trend state is then determined by comparing raw deviation against this noise floor, with a decay mechanism applied when price re-enters the neutral zone to avoid abrupt reversals:
if raw_diff > noise_floor
trend_state := 1
locked_val := raw_diff
else if raw_diff < -noise_floor
trend_state := -1
locked_val := raw_diff
else
locked_val := locked_val * 0.9
The locked deviation value is then normalized by ATR to make the oscillator comparable across instruments and volatility regimes, and smoothed with a short WMA to reduce micro-fluctuations in the final output:
normalized_val = locked_val / ta.atr(sensitivity)
final_osc = ta.wma(normalized_val, 5)
This creates a robust momentum oscillator that only registers trend conditions when price makes structurally significant moves beyond typical noise, while the ATR normalization ensures readings remain meaningful and consistent regardless of the underlying instrument's price scale or volatility level.
🟢 Signal Interpretation
▶ Bullish Trend (Oscillator Rising Above Zero with Bullish Color): When price deviation breaks above the positive noise floor, the oscillator enters bullish mode with green/bullish coloring across all visual elements = Confirmed upward momentum signal for trend-following long positions. The trend remains bullish until price deviation falls below the negative noise floor, allowing traders to stay positioned through normal consolidations without premature exits on minor pullbacks that remain within the noise boundary.
▶ Bearish Trend (Oscillator Falling Below Zero with Bearish Color): When price deviation breaks below the negative noise floor, the oscillator enters bearish mode with red/bearish coloring across all visual elements = Confirmed downward momentum signal for short positions or long exit signals. The trend remains bearish until deviation exceeds the positive noise floor, enabling traders to maintain directional bias through corrective bounces that stay within the threshold boundaries.
🟢 Features
▶ Preconfigured Presets: Three optimized parameter sets tailored for different trading styles and timeframes. "Default" delivers balanced trend detection for swing trading on 4-hour and daily charts, filtering minor noise while remaining responsive to meaningful momentum shifts. "Fast Response" uses a reactive EMA baseline with a tighter noise floor for intraday and scalping timeframes, generating earlier signals suited to active traders on 5-minute to 1-hour charts. "Smooth Trend" applies a smooth, lag-reduced HMA baseline with a demanding noise threshold for position trading on daily and weekly charts, confirming only major directional shifts with minimal false positives.
▶ Built-in Alerts: Three alert conditions enable automated monitoring of trend transitions without constant chart observation. "Bullish Trend Signal" triggers when the oscillator first enters a confirmed bullish state, alerting for potential long entries. "Bearish Trend Signal" activates when the oscillator first enters a confirmed bearish state, signaling potential short entries or long exits. "Trend Direction Changed" provides a combined alert for any trend transition regardless of direction, allowing traders to monitor both bullish and bearish opportunities through a single alert setup.
▶ Visual Customization: Six color presets (Classic, Aqua, Cosmic, Cyber, Neon, plus Custom) accommodate different chart themes and aesthetic preferences, with coordinated bullish and bearish color schemes applied consistently across all indicator elements. A layered luminance fill system creates graduated visual depth around the main oscillator line using four fill zones at progressively increasing transparency, making trend strength and direction immediately readable at a glance. Optional bar coloring tints price bars with the active trend color during confirmed bullish and bearish periods, providing instant overhead visual confirmation of trend state without requiring direct reference to the oscillator panel below.
Indicator

Supreme BUY/SELL Signal Indicator By Chaitu50cSupreme Buy/Sell Signals Indicator By Chaitu50c
Overview
The Supreme Buy/Sell Signals Indicator is a structured price-action based breakout system designed to detect strong consecutive momentum moves within the same trading session. The indicator focuses on clean candle structure and breakout confirmation rather than oscillators or lagging calculations. It is built to identify continuation strength after two consecutive candles in the same direction, followed by a confirmed breakout beyond the previous candle’s extreme. The logic is simple, rule-based, and non-repainting because signals are confirmed only after candle close.
This tool is ideal for intraday traders who prefer structure-based entries and want clear, controlled signal behavior without noise.
Core Signal Logic
The indicator detects bullish signals when two consecutive bullish candles form and the current candle closes above the previous candle’s high. This confirms bullish continuation strength and prints a Buy signal.
Similarly, a bearish signal is generated when two consecutive bearish candles form and the current candle closes below the previous candle’s low, confirming downside continuation strength.
Signals are only generated after the candle closes, ensuring no repainting during live bars. Additionally, signals are restricted within the same trading day. At the start of a new session, the internal state resets to prevent carryover signals from the previous day.
Single Signal Mode
The “Single Signal Until Opposite Forms” option controls whether the indicator allows consecutive signals in the same direction. When enabled, once a Buy signal is generated, no additional Buy signals will appear until a valid Sell signal forms. This prevents repetitive entries in strong trends and keeps the chart clean.
When disabled, the indicator will generate every valid breakout signal, even if multiple signals occur in the same direction.
This setting is particularly useful for traders who prefer one clean setup per move rather than multiple re-entries.
Body Breakout Unlock Mode
The “Require Body Breakout to Unlock” option introduces a structured reset mechanism. After a signal is generated, the direction becomes temporarily locked. A new signal of the same direction cannot form unless price proves invalidation by closing its body beyond the extreme of the previous signal candle.
For example, after a Buy signal, if a bearish candle closes below the low of the signal candle, the system unlocks. Only then can another Buy signal form later. This ensures that repeated signals only occur after meaningful structural invalidation.
If disabled, signals can occur again without requiring this structural reset.
This mode is designed to improve discipline and reduce signal clustering.
Stop Loss Line Logic
When enabled, the indicator automatically draws a dynamic Stop Loss line at the extreme of the signal candle. For Buy signals, the stop loss is placed at the signal candle’s low. For Sell signals, it is placed at the signal candle’s high.
The Stop Loss line extends forward bar by bar until a candle closes beyond it. Once price closes past the stop level, the line stops extending, indicating that the stop has been hit.
Users can customize the stop loss line’s color, style (solid, dashed, dotted), and width. This feature helps traders visually track trade risk and understand when a setup becomes invalid.
Display Options
The “Show Buy/Sell Signals” toggle controls whether Buy and Sell labels appear on the chart. These labels can be customized in color for both bullish and bearish signals, as well as text color for better chart visibility.
The “Show Bar Colors” option highlights the signal candle itself using user-defined bullish or bearish paint colors. This visually emphasizes the exact breakout candle responsible for the signal.
Both display options are fully optional and allow traders to keep the chart either minimal or visually descriptive.
Session Behavior
The indicator resets automatically at the beginning of each new trading day. This ensures that signals, locks, and stop loss tracking do not carry over into the next session. The logic is designed specifically for intraday use where daily session separation is important.
Alerts
Built-in alert conditions are included for both Buy and Sell signals. Traders can create PulseWire alerts directly from the indicator to receive notifications whenever a valid consecutive breakout occurs.
Practical Use Cases
This indicator is particularly effective in trending intraday environments where momentum continuation setups perform well. It can be used for breakout trading, pullback continuation entries, and structured momentum strategies.
Traders may combine it with higher timeframe bias, support and resistance levels, or volume confirmation to filter trades further. It works especially well when aligned with broader market structure.
Testing & Optimization
This indicator has been personally tested on the NIFTY chart using the 5-minute timeframe. The logic performed effectively in capturing structured intraday continuation moves within active market sessions. However, traders are encouraged to test and optimize it according to their own strategy and risk management rules before live deployment. Indicator

Trend Freeway MTF | ProjectSyndicateTrend Freeway MTF provides a complete multi-timeframe market overview in a single, clean panel. It visualizes trend and momentum confluence across 5 user-defined timeframes by simultaneously tracking Supertrend, RSI, and MACD status. This eliminates the need to switch between charts, providing an instant, high-conviction view of whether the market is aligned for a strong move or is consolidating with conflicting signals.
• 🚦 15-Lane Confluence Panel — each of the 5 timeframe groups is split into 3 sub-lanes SUPER, RSI, MACD, giving you a 15-point real-time market audit.
• 🧠 Triple-Indicator Logic — cross-validates a trend-following indicator Supertrend, a momentum oscillator RSI, and a trend/momentum hybrid MACD for robust signal filtering.
• 🔭 Full Multi-Timeframe Support — instantly see the bigger picture by monitoring 5 timeframes at once defaults: M5, M15, M30, H1, H4, all fully configurable to any TF.
• 📊 Master Trend Signal Header — a dynamic header at the top of the panel scores all 15 lanes and displays the master signal BUY, STRONG BUY, SUPER STRONG BUY with a color-coded background for an immediate, top-down market bias reading.
• 🎨 Clear Visual Hierarchy — uses a distinct, high-contrast color scheme dark teal for bull, dark crimson for bear, near-black for neutral so you can assess market alignment in a fraction of a second.
• 🔔 Comprehensive Alerts — get notified when a specific signal strength is reached e.g., STRONG BUY or when all 15 lanes achieve full bullish or bearish confluence, ensuring you never miss a major market shift.
• ✅ RSI Neutral Zone Filter — the RSI lane turns a neutral color when momentum is weak between 40-60 by default, effectively filtering out choppy, low-probability conditions.
• 🔧 Fully Customizable — control everything from the 5 timeframes and all indicator settings ATR, RSI, MACD to the colors, lane widths, and table position.
• 🎯 Why this algo is unique: Standard indicators only give you one piece of the puzzle on a single timeframe. This algorithm forces three independent concepts—trend, momentum, and relative strength—to agree across five separate timeframes. It doesn't just show you a signal; it shows you the quality of the signal. When all 15 lanes light up with the same color, you are looking at institutional-grade trend alignment. When colors are mixed, it instantly warns you to stay out.
• 🚀 Apply to Gold (XAUUSD), Forex (EURUSD, GBPJPY), Crypto (BTCUSD, ETHUSD), and Indices (NASDAQ/NQ, S&P500/ES) on any timeframe. The fully configurable indicator settings allow it to adapt to anything from scalping to swing trading.
• 🎯 How to use this? Focus on trading opportunities when you see full alignment all 3 sub-lanes are the same color on your primary trading timeframe. For the highest-probability setups, wait for the Master Trend Signal to show STRONG or SUPER STRONG status, indicating that the majority of all 15 lanes are in agreement. Use moments of conflicting colors as a clear signal to stay out of the market and avoid chop.
• ⚠️ IMPORTANT NOTICE: This indicator is a powerful decision-support tool designed to provide a high-level overview of market confluence. It should NOT be used as a standalone signal for entering or exiting trades. Always use it in conjunction with your own trading strategy, price action analysis, and proper risk management to confirm trade setups. Indicator

Adaptive Entropy Trend [QuantAlgo]🟢 Overview
Adaptive Entropy Trend is a trend-following indicator built on Shannon information theory rather than conventional price averaging. It quantifies the statistical disorder of recent log returns to determine whether the market is in a directional regime or a random one, then feeds this entropy reading into every layer of the system simultaneously, helping traders identify directional shifts that are validated by both low-entropy momentum conditions and genuine volatility expansion across different timeframes and markets.
🟢 How It Works
The foundation of the indicator is a per-bar entropy calculation built from the distribution of log returns over the lookback window. Log returns are computed and their range is divided into equal-width histogram bins:
logReturn = math.log(close / close )
minReturn = ta.lowest(logReturn, lookbackLen)
maxReturn = ta.highest(logReturn, lookbackLen)
returnRange = maxReturn - minReturn
Each historical return within the lookback is assigned to a bin, building a frequency distribution. Shannon entropy is then calculated from the probability of each bin, measuring how uniformly returns are spread across the range:
probability = array.get(binCounts, i) / lookbackLen
if probability > 0
entropy := entropy - probability * math.log(probability) / math.log(2)
A uniform distribution produces maximum entropy, reflecting a chaotic, non-directional market. A concentrated distribution produces low entropy, reflecting a market where returns are clustering in a consistent direction. The raw entropy is normalized against the theoretical maximum for the bin count to produce a stable 0-1 score:
normalizedEntropy = maxEntropy > 0 ? entropy / maxEntropy : 0.5
This score is then wired directly into the EMA smoothing factor. Higher entropy lengthens the effective period of the EMA, insulating it from noise. Lower entropy shortens it, allowing the EMA to track price closely during genuine trends:
adaptiveAlpha = 2.0 / (lookbackLen * (0.3 + normalizedEntropy * 1.4) + 1.0)
adaptiveEma := na(adaptiveEma) ? close : adaptiveEma + adaptiveAlpha * (close - adaptiveEma)
The same entropy reading drives band width through an inverted trend strength factor. Unlike volatility-based bands that widen during noise, these bands widen specifically during trending conditions and tighten during choppy ones:
trendStrength = 1.0 - normalizedEntropy
fastBandWidth = atr * fastMultiplier * (0.5 + trendStrength)
slowBandWidth = atr * slowMultiplier * (0.5 + trendStrength)
Finally, trend state is determined when price breaks beyond the inner bands, and transitions are tracked for alert conditions:
if close > innerUpper
trendDirection := 1
else if close < innerLower
trendDirection := -1
trendTurnedBullish = trendDirection == 1 and trendDirection != 1
trendTurnedBearish = trendDirection == -1 and trendDirection != -1
This creates a self-regulating trend system where the EMA baseline, the trigger threshold, and the visual envelope all adapt together from the same entropy source, rather than using a fixed center with adaptive edges or vice versa.
🟢 Signal Interpretation
▶ Bullish Trend (Price Above Inner Upper Band, Green): When price closes above the inner upper band, the indicator switches to bullish mode with bullish coloring across all visual elements = Confirmed uptrend signal for trend-following long positions. Because the inner band expands in low-entropy trending conditions, a bullish confirmation in a genuinely directional market requires a more meaningful breakout than in a noisy one. The trend remains bullish until price breaks below the inner lower band, allowing traders to stay positioned through normal pullbacks that remain within the band range.
▶ Bearish Trend (Price Below Inner Lower Band, Red): When price closes below the inner lower band, the indicator switches to bearish mode with bearish coloring throughout all visual elements = Confirmed downtrend signal for short positions or long exit signals. The adaptive band floor ensures the trigger threshold in choppy, high-entropy markets is tighter, reducing the risk of false breakdowns on thin directional moves. The trend remains bearish until price breaks above the inner upper band.
▶ Neutral Zone (Price Between Inner Bands): When price trades between the inner upper and lower bands, the indicator holds its previous trend direction = Continuation of existing trend during consolidation or normal volatility retracements. This prevents whipsaws during sideways action by requiring price to make a statistically meaningful move beyond the entropy-scaled band boundaries rather than reacting to minor crosses of the adaptive EMA centerline.
🟢 Features
▶ Preconfigured Presets: Three optimized parameter sets for different trading approaches and timeframes. "Default" provides balanced trend detection for swing trading on 4-hour and daily charts, "Fast Response" delivers quicker trend signals for intraday trading on 1-minute to 1-hour charts, and "Smooth Trend" focuses on major trend changes for position trading on daily to weekly timeframes.
▶ Built-in Alerts: Three alert conditions enable automated monitoring of trend changes without constant chart watching. "Bullish Trend Signal" triggers when the indicator switches to bullish mode after price breaks above the inner upper band, alerting for potential long entries. "Bearish Trend Signal" activates when the indicator switches to bearish mode after price breaks below the inner lower band, signaling potential short entries or long exits. "Trend Direction Changed" provides a combined alert for any trend transition regardless of direction, allowing traders to monitor both bullish and bearish opportunities with a single alert setup.
▶ Visual Customization: Six color presets (Classic, Aqua, Cosmic, Cyber, Neon, plus Custom) accommodate different chart backgrounds and aesthetic preferences, with coordinated bullish, bearish, and neutral color schemes applied across all indicator elements. Inner and outer band fills create a two-layer gradient envelope around the adaptive EMA, with the inner zone between the two bands rendered slightly more transparent than the outer zone to preserve natural depth, both controlled by a single fill transparency input (0-100%) so the visual weight of the envelope can be adjusted without disrupting the gradient relationship. Optional bar coloring tints price bars with trend-appropriate colors during bullish and bearish periods, enabling instant visual confirmation of trend state across multiple timeframes without switching between chart and indicator panels.
Indicator

VTS Strategy [Quision]Overview
This strategy is built on top of BackQuant's Volatility Trend Score indicator , an open-source tool that quantifies trend persistence through a volatility-adjusted trailing structure and a rolling comparison score.
The original indicator answers a critical question: "Is the market trending with conviction, or is it chopping?" - by scoring how consistently an ATR-based trailing level advances over a configurable lookback window. This strategy wraps that core logic into a fully tradeable system with proper risk management, flexible exit modes, and session filtering.
All credit for the core indicator logic goes to BackQuant. This publication adds only the strategy execution layer.
What This Strategy Adds
1. ATR-Based Stop Loss
A dedicated ATR stop loss (independent of the indicator's core ATR) protects every trade with a volatility-scaled risk level. The SL ATR period and multiplier are fully configurable, allowing you to tune risk independently from the signal generation.
2. Risk:Reward Take Profit
The take profit is calculated as a multiple of the stop loss distance.
3. Three Exit Modes
The strategy offers three distinct exit modes to match different trading styles:
- Signal Flip Only, Exits only when the VTS score flips to the opposite regime. No SL/TP. Pure trend-following.
- SL/TP Only, Exits only when the stop loss or take profit is hit. Ignores signal flips. Pure risk management.
- Signal Flip + SL/TP, Both mechanisms are active. Maximum flexibility.
4. Optional Trailing Stop
When enabled, the trailing stop progressively tightens the stop loss as the trade moves in your favor. It only activates after the position is in profit.
5. Session Filter
Restrict trading to specific hours. Configurable timezone support (Exchange, UTC, Europe/Rome, America/New_York, Europe/London, Asia/Tokyo).
Recommended Usage
This strategy works best on instruments with clear trending behavior and sufficient volatility. The VTS core logic excels at filtering out choppy conditions, making it particularly effective on:
Crypto pairs (BTC, ETH)
Gold (XAUUSD)
Major forex pairs
Index futures
Suggested starting settings:
ATR Period: 35, Factor: 1.2
Loop: 1–45 (default)
Long Threshold: 40, Short Threshold: -10 (default)
SL ATR Period: 14, SL Multiplier: 3.0
TP R:R: 6.0
Session: adjust to your instrument's active hours
Important Notes
The core indicator logic is entirely BackQuant's work. Please refer to the original publication for detailed documentation on the scoring mechanism, tuning guidelines, and theoretical foundations.
Strategy

POC Sweep Reclaim [LuxAlgo]The POC Sweep Reclaim (PSR) model identifies a two-step "rejection then acceptance" price action pattern centered around the Point of Control (POC) of previous candles. By approximating volume-at-price data using lower timeframe (LTF) granularity, the tool highlights specific liquidity traps where price first fails to sustain a move beyond a high-volume level and subsequently reclaims it.
The PSR framework is built on the logic that a "Sweep" represents a failed probe of value, while the "Reclaim" represents a successful breach, signaling a potential shift in market dominance as price moves away from trapped participants.
🔶 USAGE
The indicator visualizes market microstructure dynamics through a sequence of two distinct events:
🔹 The Sweep (The Rejection)
A sweep occurs when a candle's wick trades through the previous bar's POC, but the candle body fails to close beyond it. This identifies a "Liquidity Grab" where price interacts with a high-volume node but fails to find acceptance, often trapping breakout traders.
Buyside Sweep: Price wicks above the previous POC but closes below it (Bearish Rejection). Sellside Sweep: Price wicks below the previous POC but closes above it (Bullish Rejection).
🔹 The Reclaim (The Acceptance)
A reclaim occurs when the candle immediately following a sweep successfully closes beyond the same POC level that was just rejected.
BSR (Buyside Reclaim): A bullish signal where price closes above a previously swept upper POC, suggesting the trap is resolved to the upside. SSR (Sellside Reclaim): A bearish signal where price closes below a previously swept lower POC, suggesting follow-through to the downside.
🔶 DETAILS
The script aims to bridge the gap between standard OHLCV analysis and order-flow dynamics. While a true footprint engine (available on higher PulseWire tiers) is more accurate, this script uses a proxy by aggregating volume from a lower timeframe (e.g., 1-minute) to estimate the POC of higher-timeframe bars.
🔹 Academic Intuition
Order-Flow Imbalance (OFI): Short-term price changes are strongly linked to the inability of one side to provide enough depth. A "reclaim" reflects a shift where the dominant side successfully absorbs the liquidity that caused the initial rejection. Salient Prices: High-volume nodes like the POC act as psychological and mechanical barriers. Research indicates that liquidity clusters around these prominent prices, making them significant areas for support/resistance. Stop-Loss Cascades: Sweeps often interact with clustered stop-loss orders. If price reclaims the level after clearing these stops, it can trigger a directional move as the market "clears" the liquidity hurdle.
🔹 Practical Limitations
Footprint Proxy: The POC is calculated by aggregating volume at the close of LTF bars. This is a noisy proxy compared to a true footprint, which tracks every tick. Data Snooping: Like all pattern-based indicators, the "Reclaim" logic should be verified with robust backtesting to ensure signals are not the result of random price noise. Repainting: Because the POC depends on LTF data, the values for the current developing bar may fluctuate until the candle closes.
🔶 SETTINGS
Lower Timeframe for POC: Sets the granularity for volume aggregation. A lower value (like 1m) provides a more precise POC proxy. Show POC: Toggles the visibility of the calculated Point of Control dots for every bar. Show Sweep Dots: Displays markers at the POC level when a wick interaction occurs without a body close. Show BSR (Buyside Reclaim): Highlights candles that successfully close above a swept buyside POC. Show SSR (Sellside Reclaim): Highlights candles that successfully close below a swept sellside POC. Indicator

Neighboring Trailing Stop [LuxAlgo]The Neighboring Trailing Stop indicator provides a dynamic, data-driven trailing stop-loss mechanism by analyzing the local distribution of prices relative to the current market position. It uses a "k-nearest neighbors" approach to identify support and resistance levels based on historical price clusters, offering a unique alternative to standard volatility-based stops like ATR.
🔶 USAGE
The indicator helps traders identify trend reversals and manage open positions by providing a protective stop that adjusts based on where price has historically "congested" near the current level.
🔹 Trend Interpretation
Bullish Trend: When the stop-loss line is below the price (colored green), the market is in a bullish state. The trailing stop will only move upward, securing profits as the price creates new local distribution highs.
Bearish Trend: When the stop-loss line is above the price (colored red), the market is in a bearish state. The trailing stop will only move downward, following the price as it explores lower distribution zones.
🔹 Signals
The script plots "B" (Buy) and "S" (Sell) labels at the point of trend reversals. These occurs when the price breaks through the current "neighboring" distribution boundary, suggesting a shift in the local market structure.
🔶 DETAILS
The methodology behind this indicator is rooted in non-parametric statistics and price distribution analysis rather than simple moving averages or volatility.
🔹 Price Distribution & K-Neighbors
The script maintains a "Historical Buffer" of recent prices in a sorted array. For every new bar, it identifies the position of the current price within this sorted distribution. It then looks at k neighbors above the price and k neighbors below the price.
🔹 Percentile Bands
Within these local "neighborhoods" of price data, the script calculates a specific percentile. This allows the indicator to ignore outliers and focus on where the bulk of historical price action occurred near the current level. If the price moves into a "discovery" phase where it exceeds the range of its historical neighbors, a trend reversal is triggered.
🔹 Trailing Logic
The resulting levels are smoothed via an SMA to prevent erratic jumps. The trailing stop is "ratcheted"—meaning it can only move in the direction of the trend (up for long, down for short)—ensuring that realized gains are protected even if the distribution neighborhood expands.
🔶 SETTINGS
Historical Buffer (Bars): Determines how many historical price points are kept in the distribution memory. A larger buffer considers more history, leading to more stable but slower-reacting levels.
Neighboring Range (K): The number of price points to analyze immediately above and below the current price. Smaller values make the stop more sensitive to local price changes.
Percentile: Controls the depth within the neighborhood used for the stop level. A higher percentile (e.g., 90) places the stop further away from the current price.
Smoothing: Applies a Simple Moving Average (SMA) to the raw distribution levels to create a smoother trailing line.
Indicator

Indicator

SuperTrend Recovery [LuxAlgo]The SuperTrend Recovery indicator provides a modified version of the classic SuperTrend algorithm that incorporates a dynamic "recovery" mechanism designed to adjust the trailing stop when price action moves significantly against the current trend. This script aims to help traders manage volatile environments by tightening the trend band when the market experiences deep pullbacks without triggering a full trend reversal.
🔶 USAGE
The indicator can be used similarly to a standard SuperTrend to identify market direction and potential trailing stop-loss levels. However, the unique recovery logic allows for a more adaptive response to price deviations.
🔹 Trend Detection
When the price is above the band, the indicator signals a BULL trend.
When the price is below the band, the indicator signals a BEAR trend.
Trend switches are marked with "BULL" or "BEAR" labels and a colored circle at the switch point.
🔹 Recovery Mechanism
In a standard SuperTrend, the band stays flat if price moves against the trend (but doesn't break it). In the SuperTrend Recovery version, if the price drops significantly below the "Switch Price" (for a bull trend) or rises above it (for a bear trend), the band begins to move toward the price based on the Recovery Alpha . This allows the trailing stop to "catch up" during high-volatility pullbacks, potentially securing a faster exit if the recovery fails.
🔶 DETAILS
The core of this indicator lies in its two-stage calculation: the Base SuperTrend and the Recovery Logic.
🔹 Base Logic
The indicator calculates a base upper and lower band using the Average True Range (ATR) multiplied by a user-defined factor. Under normal conditions, the band follows the classic rules: it can only move up during a bull trend and only down during a bear trend.
🔹 Recovery Logic
When price enters a "loss" state relative to the price where the trend initially started (the Switch Price), the script checks if the deviation exceeds the Recovery Threshold .
If the threshold is met, the band is calculated as an exponential moving average (EMA) of the current price and the previous band value, weighted by the Recovery Alpha :
targetBand = alpha * close + (1.0 - alpha) * prevBand
This creates a "tapering" effect where the band aggressively tightens toward the price during deep retracements, helping to mitigate drawdown by providing an earlier exit signal compared to the standard static band.
🔶 SETTINGS
🔹 Supertrend Settings
ATR Length : The lookback period used to calculate market volatility.
Base Multiplier : The factor applied to the ATR to determine the distance of the band from the price.
🔹 Recovery Logic
Recovery Alpha (%) : Determines how quickly the band adjusts toward the price when the recovery logic is active. Higher values make the band more reactive.
Recovery Threshold (xATR) : The distance (in ATR units) the price must deviate from the switch price before the recovery mechanism activates.
🔹 Visualization
Show Gradient Fills : Toggles the background gradient between the price (source) and the SuperTrend band.
Show Signal Labels : Toggles the "BULL" and "BEAR" labels at trend reversal points.
Indicator
