OPEN-SOURCE SCRIPT
cd_VW_Cx IMPROVED - Quant VWAP System: Regime, Magnets & Z-Sco

Quant VWAP System: Regime, Magnets & Z-Score Matrix
This indicator is a comprehensive Quantitative Trading System designed to move beyond simple support and resistance. Instead of static lines, it uses Statistical Probability (Z-Score) and Standard Deviation to define the current market regime, identify institutional value zones, and project high-probability liquidity targets.
It is engineered for Day Traders and Scalpers (Crypto & Futures) who need to know if the market is Trending, Ranging, or preparing for a Breakout.
1. The "Regime" System (Standard Deviation Bands)
The core engine anchors a VWAP (Volume Weighted Average Price) to your chosen timeframe (Daily, Weekly, or Monthly) and projects volatility bands based on market variance.
The Trend Zone (Inner Band / 1.0 SD): This is the "Fair Value" zone. In a healthy trend, price will pull back into this zone and hold. A hold here signals a high-probability continuation (Trend Following).
The Reversion Zone (Outer Band / 2.0 SD): This represents a statistical extreme. Price rarely sustains movement beyond 2 Standard Deviations without a reversion. A touch of this band signals "Overbought" or "Oversold" conditions.
2. Liquidity Magnets (Virgin VWAPs)
The script automatically tracks "Unvisited VWAPs" from previous sessions. These are price levels where significant volume occurred but have not yet been re-tested.
The Logic: Algorithms often target these "open loops." The script visualizes them as Blue Dashed Lines with price tags.
Smart Scaling (Anti-Scrunch): Includes a custom "Ghost Engine" that automatically hides or "ghosts" magnets that are too far away. This prevents your chart from being squashed (scrunched) on lower timeframes, keeping your candles perfectly readable while still tracking targets in the background.
3. The Quant Matrix (Dashboard)
A real-time Heads-Up Display (HUD) that interprets the data for you:
Regime: Detects Volatility Squeezes. If the bands compress, it signals "⚠ SQUEEZE", warning you to stop mean-reversion trading and prepare for an explosive breakout.
Bias: Color-coded Trend Direction (Bullish/Bearish) based on VWAP slope.
Signal: actionable text prompts such as "BUY DIP" (Trend Following), "FADE EXT" (Mean Reversion), or "PREP BREAK" (Squeeze).
4. Visual Intelligence
Bold Day Separators: Clear, vertical dotted dividers with Date Stamps to instantly separate trading sessions.
Dynamic Labels: Floating labels on the right axis identify exactly which deviation level is which, preventing chart confusion.
How to Use
Strategy A: The Trend Pullback (continuation)
Check Matrix: Ensure Bias is BULLISH (Green).
Wait: Allow price to pull back into the Inner Band (Dark Green Zone).
Trigger: If price holds the Center VWAP or the -1.0 SD line, enter Long.
Target: The next Liquidity Magnet above or the +2.0 SD band.
Strategy B: The Reversion Fade (Counter-Trend)
Check Matrix: Ensure price is labeled "EXTREME" or Signal says "FADE EXT".
Trigger: Price touches or pierces the Outer Band (2.0 SD).
Action: Enter counter-trend (Short) with a target back to the Center VWAP (Mean Reversion).
Strategy C: The Magnet Target
Identify a "MAGNET" line (Blue Dashed) near current price.
These act as high-probability Take Profit levels. Price will often rush to these levels to "close the loop" before reversing.
Settings
Anchor: Daily (default), Weekly, or Monthly.
Magnet Focus Range: Adjusts how aggressively the script hides distant magnets to fix chart scaling (Default: 2%).
Visuals: Fully customizable colors, label sizes, and dashboard position.
This indicator is a comprehensive Quantitative Trading System designed to move beyond simple support and resistance. Instead of static lines, it uses Statistical Probability (Z-Score) and Standard Deviation to define the current market regime, identify institutional value zones, and project high-probability liquidity targets.
It is engineered for Day Traders and Scalpers (Crypto & Futures) who need to know if the market is Trending, Ranging, or preparing for a Breakout.
1. The "Regime" System (Standard Deviation Bands)
The core engine anchors a VWAP (Volume Weighted Average Price) to your chosen timeframe (Daily, Weekly, or Monthly) and projects volatility bands based on market variance.
The Trend Zone (Inner Band / 1.0 SD): This is the "Fair Value" zone. In a healthy trend, price will pull back into this zone and hold. A hold here signals a high-probability continuation (Trend Following).
The Reversion Zone (Outer Band / 2.0 SD): This represents a statistical extreme. Price rarely sustains movement beyond 2 Standard Deviations without a reversion. A touch of this band signals "Overbought" or "Oversold" conditions.
2. Liquidity Magnets (Virgin VWAPs)
The script automatically tracks "Unvisited VWAPs" from previous sessions. These are price levels where significant volume occurred but have not yet been re-tested.
The Logic: Algorithms often target these "open loops." The script visualizes them as Blue Dashed Lines with price tags.
Smart Scaling (Anti-Scrunch): Includes a custom "Ghost Engine" that automatically hides or "ghosts" magnets that are too far away. This prevents your chart from being squashed (scrunched) on lower timeframes, keeping your candles perfectly readable while still tracking targets in the background.
3. The Quant Matrix (Dashboard)
A real-time Heads-Up Display (HUD) that interprets the data for you:
Regime: Detects Volatility Squeezes. If the bands compress, it signals "⚠ SQUEEZE", warning you to stop mean-reversion trading and prepare for an explosive breakout.
Bias: Color-coded Trend Direction (Bullish/Bearish) based on VWAP slope.
Signal: actionable text prompts such as "BUY DIP" (Trend Following), "FADE EXT" (Mean Reversion), or "PREP BREAK" (Squeeze).
4. Visual Intelligence
Bold Day Separators: Clear, vertical dotted dividers with Date Stamps to instantly separate trading sessions.
Dynamic Labels: Floating labels on the right axis identify exactly which deviation level is which, preventing chart confusion.
How to Use
Strategy A: The Trend Pullback (continuation)
Check Matrix: Ensure Bias is BULLISH (Green).
Wait: Allow price to pull back into the Inner Band (Dark Green Zone).
Trigger: If price holds the Center VWAP or the -1.0 SD line, enter Long.
Target: The next Liquidity Magnet above or the +2.0 SD band.
Strategy B: The Reversion Fade (Counter-Trend)
Check Matrix: Ensure price is labeled "EXTREME" or Signal says "FADE EXT".
Trigger: Price touches or pierces the Outer Band (2.0 SD).
Action: Enter counter-trend (Short) with a target back to the Center VWAP (Mean Reversion).
Strategy C: The Magnet Target
Identify a "MAGNET" line (Blue Dashed) near current price.
These act as high-probability Take Profit levels. Price will often rush to these levels to "close the loop" before reversing.
Settings
Anchor: Daily (default), Weekly, or Monthly.
Magnet Focus Range: Adjusts how aggressively the script hides distant magnets to fix chart scaling (Default: 2%).
Visuals: Fully customizable colors, label sizes, and dashboard position.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。