OPEN-SOURCE SCRIPT
VWAP Mean Reversion Scalper with Multi-SD Bands and CVD

The VWAP Mean Reversion Scalper is an execution-focused indicator designed to identify potential price exhaustion points at statistical extremes. It utilizes a Volume Weighted Average Price (VWAP) core with multiple standard deviation bands to define overextended market conditions, confirmed by real-time Volume Delta (CVD).
How It Works (Technical Logic)
This script identifies reversal setups based on the convergence of three primary data points:
Statistical Extremes (VWAP SD Bands): The indicator calculates three standard deviation bands based on the VWAP. These bands serve as dynamic "overbought" and "oversold" zones.
Universal Rejection: A signal is generated when a candle tests a band (or the VWAP mid-line) and closes in the opposite direction (e.g., price touches the upper band and closes as a red candle).
Cumulative Volume Delta (CVD) Confirmation: Using request.security_lower_tf, the script analyzes volume delta from a lower timeframe (e.g., 1-minute). A signal only confirms if the aggressive market orders (buying for longs, selling for shorts) align with the rejection direction.
Volatility Filtering: An optional ATR-based filter ensures that the rejection candle has sufficient range to represent a meaningful shift in momentum.
Unique Signal Filtering
To maintain a clean interface and avoid "signal clusters" during trending periods, the script uses a State-Based Filter:
Neutral Zone Reset: After a signal triggers at the outer bands, the script will not generate another signal in that direction until price returns to the "Neutral Zone" (the area between the SD 1.0 bands).
Scaling Logic: The indicator permits "scaling in" signals if the price moves to a deeper standard deviation level (e.g., from SD 2 to SD 3) before returning to the mean.
Usage & Best Practices
Timeframes: Optimized for intraday scalping (1m, 5m, 15m).
Execution: Ideal targets are the VWAP mid-line (mean) or the opposite SD 1 band.
CVD Setup: For the most accurate delta readings, ensure the "CVD Calculation Timeframe" in settings is set to 1-minute or lower.
How It Works (Technical Logic)
This script identifies reversal setups based on the convergence of three primary data points:
Statistical Extremes (VWAP SD Bands): The indicator calculates three standard deviation bands based on the VWAP. These bands serve as dynamic "overbought" and "oversold" zones.
Universal Rejection: A signal is generated when a candle tests a band (or the VWAP mid-line) and closes in the opposite direction (e.g., price touches the upper band and closes as a red candle).
Cumulative Volume Delta (CVD) Confirmation: Using request.security_lower_tf, the script analyzes volume delta from a lower timeframe (e.g., 1-minute). A signal only confirms if the aggressive market orders (buying for longs, selling for shorts) align with the rejection direction.
Volatility Filtering: An optional ATR-based filter ensures that the rejection candle has sufficient range to represent a meaningful shift in momentum.
Unique Signal Filtering
To maintain a clean interface and avoid "signal clusters" during trending periods, the script uses a State-Based Filter:
Neutral Zone Reset: After a signal triggers at the outer bands, the script will not generate another signal in that direction until price returns to the "Neutral Zone" (the area between the SD 1.0 bands).
Scaling Logic: The indicator permits "scaling in" signals if the price moves to a deeper standard deviation level (e.g., from SD 2 to SD 3) before returning to the mean.
Usage & Best Practices
Timeframes: Optimized for intraday scalping (1m, 5m, 15m).
Execution: Ideal targets are the VWAP mid-line (mean) or the opposite SD 1 band.
CVD Setup: For the most accurate delta readings, ensure the "CVD Calculation Timeframe" in settings is set to 1-minute or lower.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.