OPEN-SOURCE SCRIPT
Обновлено Quantized Regime Vector (QRV)

# Quantized Regime Vector (QRV)
## Professional Market Regime & Directional Confluence Overlay
Quantized Regime Vector (QRV) is a multi-factor empirical state-classification engine designed to filter high-frequency market noise into a structured, deterministic directional confluence matrix.
The script systematically evaluates trend structure, higher-timeframe alignment, adaptive moving average behavior, relative volume expansion, volatility dynamics, momentum exhaustion, confirmed divergence, and wick-adjusted order-flow proxy bias. These independent inputs are mapped into an objective, quantitative scoring framework that establishes active market regime classification and directional conviction in real time.
QRV is not a predictive forecasting model. It functions as an objective decision-support framework designed to systematically mitigate adverse selection during low-efficiency market regimes, helping operators evaluate when edge is mathematically present and when conditions are too noisy for execution.
The purpose of QRV is to reduce low-quality signals, organize continuous market context into discrete states, and display aggregate directional strength directly on the interface.
---
## Why “Quantized Regime Vector”?
* **Quantized:** QRV takes continuous, chaotic market inputs and maps them into a structured, finite confluence score. Instead of treating every signal equally, the engine calculates an aggregate value to evaluate whether independent conditions are aligned strongly enough to clear a strict execution floor.
* **Regime:** The system classifies the underlying structural environment via localized trend alignment, multi-timeframe correlation, volatility state tracking, and algorithmic alpha grading.
* **Vector:** QRV evaluates both direction and magnitude. The model calculates long-side and short-side scores completely independently, outputting the active side alongside the raw mathematical strength of the current setup.
---
## Core Algorithmic Components
### 1. Trend Structure
QRV evaluates localized price action in relation to both a mid-term structural moving average and a long-term trend average. This isolates the baseline market state into clear bullish, bearish, or neutral structural regimes.
### 2. Higher-Timeframe Alignment
The framework includes an institutional multi-timeframe trend filter that utilizes **only the previously completed higher-timeframe bar** to ensure zero real-time repainting or forward-looking bias.
* **Timeframe Inversion Protection:** If the selected higher timeframe is less than or equal to the current chart timeframe, the system triggers a `CHECK TF` warning on the dashboard and completely blocks the higher-timeframe contribution from the scoring model to preserve data integrity.
### 3. Adaptive Moving Average Behavior
The engine incorporates a Kaufman Adaptive Moving Average (KAMA) driven by a localized Efficiency Ratio. By adjusting its internal smoothing factor based on trend efficiency, it reduces lag during true expansion legs and flattens out during mean-reverting chop, acting as a dynamic structural barrier for reclaim and breakdown validation.
### 4. Statistical Relative Volume Expansion
Current volume is normalized against historical lookback distributions using a Gaussian Z-score framework:
$$Z = \frac{V - \mu}{\sigma}$$
Elevated Z-scores validate baseline participation necessary to sustain structural breakouts. This metric does not attempt to track specific participants or imply unprovable order-flow mechanics; it is a strict statistical measurement of volume expansion relative to recent historical norms.
### 5. Volatility Expansion Gate
Directional triggers are volatility-gated, requiring localized Average True Range (ATR) expansion to validate execution momentum and filter out mean-reverting noise. If range expansion fails to clear the volatility gate, execution parameters remain locked.
### 6. Momentum Exhaustion Tracking
The system cross-references localized RSI positioning with MACD histogram peaks to flag potential momentum exhaustion points. These conditions indicate exhaustive retail chasing into liquidity pools and should be treated as structural context rather than absolute reversal signals.
### 7. Confirmed Pivot Divergence
The engine includes a non-backplotting divergence system driven by structural pivot points. Divergence labels are printed strictly on the live bar where the pivot confirmation becomes statistically knowable in real time, eliminating retrospective signal placement.
### 8. Wick-Adjusted Flow Bias
A localized volume pressure proxy calculates intra-bar delta based on wick adjustments, categorizing near-term order-flow accumulation or distribution states.
---
## System Risk & Filtration Defaults
The default parameters are intentionally restrictive, prioritizing high-selectivity alignment over high-frequency trading in noisy conditions.
```text
======================================================================
QUANTIZED REGIME VECTOR (QRV) SYSTEM DEFAULTS
======================================================================
• Score Activation Floor : 82 / 110 Total Points
• Volatility Gate Limit : 1.85 × ATR (Noise Isolation)
• Baseline Volume Alpha : ≥ 1.50σ Z-Score
• Major Volume Expansion : ≥ 2.75σ Z-Score
• Signal Cooldown Array : 20 Bars (Cluster Prevention)
• Real-Time Protection : Confirm-on-Close [Enabled]
======================================================================
```
### The QRV Score Engine Matrix
The directional scoring model aggregates weighted confirmations across all core components to assign an objective alpha grade to the live market state:
* **Grade A ($\ge$ 85):** Maximum-probability structural and volume confluence.
* **Grade B ($\ge$ 75):** Strong directional continuation context.
* **Grade C ($\ge$ 65):** Developing structural context.
* **Grade F (< 65):** Insufficient confluence; execution restricted.
---
## The Visual Interface Architecture
### Candle Color System
* **Gold Candle:** High-conviction long execution trigger occurring simultaneous with major relative volume expansion ($Z \ge 2.75$).
* **Crimson Candle:** High-conviction short execution trigger occurring simultaneous with major relative volume expansion ($Z \ge 2.75$).
* **Lime Candle:** Standard long execution trigger meeting all baseline trend, adaptive MA, volume, volatility, and scoring floors.
* **Magenta Candle:** Standard short execution trigger meeting all baseline trend, adaptive MA, volume, volatility, and scoring floors.
* **White Candle:** Isolated Major Relative Volume Expansion ($Z \ge 2.75$). Indicates substantial institutional participation block-clearing or absorption without firing a directional entry signal.
* **Orange Candle:** Momentum exhaustion warning (potential fading structure or near-term reversal context).
* **Dark Green Candle:** Strong bullish structural baseline.
* **Dark Purple Candle:** Strong bearish structural baseline.
* **Gray Candle:** Neutral, compressed, or inactive market condition.
### Telemetry Dashboard
The real-time heads-up display reports live engine metadata including:
* **Entropy State:** `EXPANDING`, `CONTRACTING`, or `TRANSITION` volatility behavior.
* **Bias State:** Real-time accumulation vs. distribution proxy tracking.
* **Command State:** Operational mode tracking (`FIRE`, `STALKING...`, or `SCANNING...`).
* **Bi-Directional Scores:** Independent real-time long and short point values.
* **Core System Metrics:** Volume Z-score tracking, HTF confirmation, and divergence status.
---
## Operational Protocol: How to Use QRV
### For Long Setups
1. Ensure the baseline trend structure and higher-timeframe status report bullish alignment.
2. Monitor the dashboard for an improving, accelerating long score vector.
3. Prioritize Grade-A executions where standard long triggers overlap with dynamic volatility expansion.
4. Utilize localized momentum exhaustion and divergence labels as structural exit or profit-taking context, rather than raw entry signals.
### For Short Setups
1. Ensure the baseline trend structure and higher-timeframe status report bearish alignment.
2. Monitor the dashboard for an improving, accelerating short score vector.
3. Prioritize Grade-A executions where standard short triggers overlap with dynamic volatility expansion.
4. Utilize localized momentum exhaustion and divergence labels as structural exit or profit-taking context, rather than raw entry signals.
### Timeframe Configuration Examples
* **Scalping/Intraday:** 5-Minute Chart with a 30-Minute or 1-Hour HTF Input.
* **Day Trading/Breakouts:** 15-Minute Chart with a 1-Hour or 4-Hour HTF Input.
* **Swing Trading:** 1-Hour or 4-Hour Chart with a Daily HTF Input.
---
## Important Limitations & System Restrictions
* **No Predictive Claims:** QRV evaluates current mathematical alignment based on historical lookback arrays. It does not predict future structural direction or guarantee profitable outcomes.
* **Context vs. Proof:** Statistical relative volume expansion indicates an increase in participation velocity relative to recent norms. It cannot identify specific entity intent or guarantee institutional follow-through.
* **Macro/Event Exclusion:** The engine operates strictly on technical metadata. It cannot account for, protect against, or evaluate incoming economic indicators, earnings releases, central bank decisions, or sudden exogenous liquidity shocks.
* **Chop Regimes:** While the volatility gate and signal cooldown arrays are engineered to systematically mitigate adverse selection, extended low-volume, mean-reverting consolidations can result in performance decay.
---
## Risk Disclaimer
Trading financial instruments, including index futures, commodities, equities, and derivatives, involves a substantial risk of capital loss and is not suitable for every investor. No automated scoring matrix, indicator, or technical framework can eliminate market risk or ensure capital preservation. QRV is provided strictly as an analytical decision-support tool. It should be paired with independent risk management, strict position sizing protocols, robust historical backtesting, and discretionary trader judgment. This material does not constitute financial, legal, or investment advice. Single-point failure mitigation and execution validation remain the sole responsibility of the operator.
## Professional Market Regime & Directional Confluence Overlay
Quantized Regime Vector (QRV) is a multi-factor empirical state-classification engine designed to filter high-frequency market noise into a structured, deterministic directional confluence matrix.
The script systematically evaluates trend structure, higher-timeframe alignment, adaptive moving average behavior, relative volume expansion, volatility dynamics, momentum exhaustion, confirmed divergence, and wick-adjusted order-flow proxy bias. These independent inputs are mapped into an objective, quantitative scoring framework that establishes active market regime classification and directional conviction in real time.
QRV is not a predictive forecasting model. It functions as an objective decision-support framework designed to systematically mitigate adverse selection during low-efficiency market regimes, helping operators evaluate when edge is mathematically present and when conditions are too noisy for execution.
The purpose of QRV is to reduce low-quality signals, organize continuous market context into discrete states, and display aggregate directional strength directly on the interface.
---
## Why “Quantized Regime Vector”?
* **Quantized:** QRV takes continuous, chaotic market inputs and maps them into a structured, finite confluence score. Instead of treating every signal equally, the engine calculates an aggregate value to evaluate whether independent conditions are aligned strongly enough to clear a strict execution floor.
* **Regime:** The system classifies the underlying structural environment via localized trend alignment, multi-timeframe correlation, volatility state tracking, and algorithmic alpha grading.
* **Vector:** QRV evaluates both direction and magnitude. The model calculates long-side and short-side scores completely independently, outputting the active side alongside the raw mathematical strength of the current setup.
---
## Core Algorithmic Components
### 1. Trend Structure
QRV evaluates localized price action in relation to both a mid-term structural moving average and a long-term trend average. This isolates the baseline market state into clear bullish, bearish, or neutral structural regimes.
### 2. Higher-Timeframe Alignment
The framework includes an institutional multi-timeframe trend filter that utilizes **only the previously completed higher-timeframe bar** to ensure zero real-time repainting or forward-looking bias.
* **Timeframe Inversion Protection:** If the selected higher timeframe is less than or equal to the current chart timeframe, the system triggers a `CHECK TF` warning on the dashboard and completely blocks the higher-timeframe contribution from the scoring model to preserve data integrity.
### 3. Adaptive Moving Average Behavior
The engine incorporates a Kaufman Adaptive Moving Average (KAMA) driven by a localized Efficiency Ratio. By adjusting its internal smoothing factor based on trend efficiency, it reduces lag during true expansion legs and flattens out during mean-reverting chop, acting as a dynamic structural barrier for reclaim and breakdown validation.
### 4. Statistical Relative Volume Expansion
Current volume is normalized against historical lookback distributions using a Gaussian Z-score framework:
$$Z = \frac{V - \mu}{\sigma}$$
Elevated Z-scores validate baseline participation necessary to sustain structural breakouts. This metric does not attempt to track specific participants or imply unprovable order-flow mechanics; it is a strict statistical measurement of volume expansion relative to recent historical norms.
### 5. Volatility Expansion Gate
Directional triggers are volatility-gated, requiring localized Average True Range (ATR) expansion to validate execution momentum and filter out mean-reverting noise. If range expansion fails to clear the volatility gate, execution parameters remain locked.
### 6. Momentum Exhaustion Tracking
The system cross-references localized RSI positioning with MACD histogram peaks to flag potential momentum exhaustion points. These conditions indicate exhaustive retail chasing into liquidity pools and should be treated as structural context rather than absolute reversal signals.
### 7. Confirmed Pivot Divergence
The engine includes a non-backplotting divergence system driven by structural pivot points. Divergence labels are printed strictly on the live bar where the pivot confirmation becomes statistically knowable in real time, eliminating retrospective signal placement.
### 8. Wick-Adjusted Flow Bias
A localized volume pressure proxy calculates intra-bar delta based on wick adjustments, categorizing near-term order-flow accumulation or distribution states.
---
## System Risk & Filtration Defaults
The default parameters are intentionally restrictive, prioritizing high-selectivity alignment over high-frequency trading in noisy conditions.
```text
======================================================================
QUANTIZED REGIME VECTOR (QRV) SYSTEM DEFAULTS
======================================================================
• Score Activation Floor : 82 / 110 Total Points
• Volatility Gate Limit : 1.85 × ATR (Noise Isolation)
• Baseline Volume Alpha : ≥ 1.50σ Z-Score
• Major Volume Expansion : ≥ 2.75σ Z-Score
• Signal Cooldown Array : 20 Bars (Cluster Prevention)
• Real-Time Protection : Confirm-on-Close [Enabled]
======================================================================
```
### The QRV Score Engine Matrix
The directional scoring model aggregates weighted confirmations across all core components to assign an objective alpha grade to the live market state:
* **Grade A ($\ge$ 85):** Maximum-probability structural and volume confluence.
* **Grade B ($\ge$ 75):** Strong directional continuation context.
* **Grade C ($\ge$ 65):** Developing structural context.
* **Grade F (< 65):** Insufficient confluence; execution restricted.
---
## The Visual Interface Architecture
### Candle Color System
* **Gold Candle:** High-conviction long execution trigger occurring simultaneous with major relative volume expansion ($Z \ge 2.75$).
* **Crimson Candle:** High-conviction short execution trigger occurring simultaneous with major relative volume expansion ($Z \ge 2.75$).
* **Lime Candle:** Standard long execution trigger meeting all baseline trend, adaptive MA, volume, volatility, and scoring floors.
* **Magenta Candle:** Standard short execution trigger meeting all baseline trend, adaptive MA, volume, volatility, and scoring floors.
* **White Candle:** Isolated Major Relative Volume Expansion ($Z \ge 2.75$). Indicates substantial institutional participation block-clearing or absorption without firing a directional entry signal.
* **Orange Candle:** Momentum exhaustion warning (potential fading structure or near-term reversal context).
* **Dark Green Candle:** Strong bullish structural baseline.
* **Dark Purple Candle:** Strong bearish structural baseline.
* **Gray Candle:** Neutral, compressed, or inactive market condition.
### Telemetry Dashboard
The real-time heads-up display reports live engine metadata including:
* **Entropy State:** `EXPANDING`, `CONTRACTING`, or `TRANSITION` volatility behavior.
* **Bias State:** Real-time accumulation vs. distribution proxy tracking.
* **Command State:** Operational mode tracking (`FIRE`, `STALKING...`, or `SCANNING...`).
* **Bi-Directional Scores:** Independent real-time long and short point values.
* **Core System Metrics:** Volume Z-score tracking, HTF confirmation, and divergence status.
---
## Operational Protocol: How to Use QRV
### For Long Setups
1. Ensure the baseline trend structure and higher-timeframe status report bullish alignment.
2. Monitor the dashboard for an improving, accelerating long score vector.
3. Prioritize Grade-A executions where standard long triggers overlap with dynamic volatility expansion.
4. Utilize localized momentum exhaustion and divergence labels as structural exit or profit-taking context, rather than raw entry signals.
### For Short Setups
1. Ensure the baseline trend structure and higher-timeframe status report bearish alignment.
2. Monitor the dashboard for an improving, accelerating short score vector.
3. Prioritize Grade-A executions where standard short triggers overlap with dynamic volatility expansion.
4. Utilize localized momentum exhaustion and divergence labels as structural exit or profit-taking context, rather than raw entry signals.
### Timeframe Configuration Examples
* **Scalping/Intraday:** 5-Minute Chart with a 30-Minute or 1-Hour HTF Input.
* **Day Trading/Breakouts:** 15-Minute Chart with a 1-Hour or 4-Hour HTF Input.
* **Swing Trading:** 1-Hour or 4-Hour Chart with a Daily HTF Input.
---
## Important Limitations & System Restrictions
* **No Predictive Claims:** QRV evaluates current mathematical alignment based on historical lookback arrays. It does not predict future structural direction or guarantee profitable outcomes.
* **Context vs. Proof:** Statistical relative volume expansion indicates an increase in participation velocity relative to recent norms. It cannot identify specific entity intent or guarantee institutional follow-through.
* **Macro/Event Exclusion:** The engine operates strictly on technical metadata. It cannot account for, protect against, or evaluate incoming economic indicators, earnings releases, central bank decisions, or sudden exogenous liquidity shocks.
* **Chop Regimes:** While the volatility gate and signal cooldown arrays are engineered to systematically mitigate adverse selection, extended low-volume, mean-reverting consolidations can result in performance decay.
---
## Risk Disclaimer
Trading financial instruments, including index futures, commodities, equities, and derivatives, involves a substantial risk of capital loss and is not suitable for every investor. No automated scoring matrix, indicator, or technical framework can eliminate market risk or ensure capital preservation. QRV is provided strictly as an analytical decision-support tool. It should be paired with independent risk management, strict position sizing protocols, robust historical backtesting, and discretionary trader judgment. This material does not constitute financial, legal, or investment advice. Single-point failure mitigation and execution validation remain the sole responsibility of the operator.
Информация о релизе
v2.6.2 - HotfixResolved a Pine Script color compatibility issue by replacing unsupported short-side color references with `color.fuchsia`.
No changes to scoring, triggers, alerts, HTF filtering, divergence logic, or confirm-on-close behavior.
Информация о релизе
v2.6.2 - Clean Publication Chart + Compatibility HotfixThis update improves the QRV publication presentation and resolves a minor Pine Script color compatibility issue.
Changes:
- Updated the publication chart to show only Quantized Regime Vector (QRV) output.
- Removed unrelated indicators, drawings, images, and visual clutter from the preview chart.
- Replaced unsupported short-side color references with Pine-compatible `color.fuchsia`.
- Improved visual clarity so QRV labels, dashboard values, moving averages, candle colors, and score values are easier to identify.
- No changes were made to the scoring model, trigger logic, higher-timeframe filter, divergence logic, or confirm-on-close behavior.
Chart reading note:
Primary actionable outputs are the QRV LONG and QRV SHORT labels. Baseline candle colors are context only and should not be treated as standalone entries. White candles indicate major relative volume expansion only. Purple exhaustion labels and divergence labels are optional context tools, not automatic entry or exit signals.
Информация о релизе
v2.6.2 - Clean Chart + Compatibility Hotfix- Updated the publication chart to show only QRV output.
- Removed unrelated indicators, drawings, images, and visual clutter from the preview.
- Replaced unsupported short-side color references with Pine-compatible `color.fuchsia`.
- No changes were made to scoring, triggers, HTF filtering, divergence logic, or confirm-on-close behavior.
Primary actionable outputs remain the QRV LONG and QRV SHORT labels. Baseline candle colors are context only.
Comment for questions.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.