OPEN-SOURCE SCRIPT
Cập nhật VWAP Gravity Oscillator (VGO) (Intraday Only)

VWAP Gravity Oscillator (VGO)
The VWAP Gravity Oscillator (VGO) is an intraday analytical indicator designed to quantify price displacement from VWAP and the rate of change of that displacement.
The indicator models VWAP as a statistical equilibrium level and evaluates:
Price deviation from VWAP (Delta)
Momentum and acceleration of that deviation via MACD
This framework enables assessment of trend persistence versus mean-reversion pressure in intraday price action.
Methodology
VWAP Delta
Measures the signed distance between price and VWAP, representing directional bias relative to equilibrium.
MACD on Delta
Captures the first- and second-order dynamics of VWAP deviation, highlighting acceleration, deceleration, and potential inflection points.
Zero Line
Represents price–VWAP equilibrium. Crossings may indicate regime transitions.
Interpretation Guidelines
Positive Delta
Price is trading above VWAP with positive directional bias.
Negative Delta
Price is trading below VWAP with negative directional bias.
Increasing MACD
Expansion of VWAP deviation (trend reinforcement).
Decreasing or reversing MACD
Contraction of VWAP deviation (mean-reversion risk).
Intended Applications
Intraday trend validation
Early detection of trend exhaustion
Mean-reversion risk assessment
Filtering low-conviction or balanced market conditions
Implementation Notes
Designed exclusively for intraday timeframes
Automatically suppressed on higher-timeframe charts
Intended as a contextual analysis tool, not a standalone signal generator
Conceptual Summary
VGO evaluates whether price is diverging from, stabilising around, or reverting toward VWAP by analysing both displacement and its rate of change.
The VWAP Gravity Oscillator (VGO) is an intraday analytical indicator designed to quantify price displacement from VWAP and the rate of change of that displacement.
The indicator models VWAP as a statistical equilibrium level and evaluates:
Price deviation from VWAP (Delta)
Momentum and acceleration of that deviation via MACD
This framework enables assessment of trend persistence versus mean-reversion pressure in intraday price action.
Methodology
VWAP Delta
Measures the signed distance between price and VWAP, representing directional bias relative to equilibrium.
MACD on Delta
Captures the first- and second-order dynamics of VWAP deviation, highlighting acceleration, deceleration, and potential inflection points.
Zero Line
Represents price–VWAP equilibrium. Crossings may indicate regime transitions.
Interpretation Guidelines
Positive Delta
Price is trading above VWAP with positive directional bias.
Negative Delta
Price is trading below VWAP with negative directional bias.
Increasing MACD
Expansion of VWAP deviation (trend reinforcement).
Decreasing or reversing MACD
Contraction of VWAP deviation (mean-reversion risk).
Intended Applications
Intraday trend validation
Early detection of trend exhaustion
Mean-reversion risk assessment
Filtering low-conviction or balanced market conditions
Implementation Notes
Designed exclusively for intraday timeframes
Automatically suppressed on higher-timeframe charts
Intended as a contextual analysis tool, not a standalone signal generator
Conceptual Summary
VGO evaluates whether price is diverging from, stabilising around, or reverting toward VWAP by analysing both displacement and its rate of change.
Phát hành các Ghi chú
Update: Gravity Thresholds & Clearer SignalsThis update adds a user-defined Absolute Delta Threshold to filter low-quality signals near VWAP, along with dynamic upper and lower gravity bands (±threshold) for clearer context. The histogram is now split into Accelerating and Decelerating regimes, and visual entry/exit markers have been added for improved signal clarity.
Default behavior remains largely unchanged, and the indicator continues to operate on intraday charts only.
Phát hành các Ghi chú
Update: Volatility-Adaptive Gravity & Signal Strength FilterThis update introduces ATR-based dynamic gravity thresholds for VWAP Delta, allowing entry conditions to adapt to changing market volatility while enforcing a minimum distance from VWAP. In addition, a minimum MACD (signal) strength filter has been added to avoid weak or noisy momentum flips near equilibrium.
These enhancements improve signal quality by combining volatility-aware price displacement with momentum validation, without altering the core behavior of the indicator.
Phát hành các Ghi chú
Update: Smarter VWAP Reclaims & Less Chop NoiseThis update improves how the indicator handles direction changes around VWAP. After price makes a meaningful move away from VWAP, the indicator now allows reversal entries on VWAP reclaim, without forcing price to stay inside the gravity range. This helps capture real regime shifts instead of missing them.
It also reduces over-trading during VWAP chop by preventing repeated entries when price keeps oscillating around VWAP. New entries are allowed only when a fresh context is formed.
In testing, this logic was found to work best on 5-minute charts, where VWAP structure and momentum signals are more stable.
Overall, this makes the indicator more reliable in range days, trend days, and transition phases, while keeping the original momentum-confirmation logic intact.
Phát hành các Ghi chú
Update: Flexible Gravity Limits & Safer Bounds HandlingThis update makes gravity thresholds more flexible and robust.
Default behaviour: Both lower and upper gravity limits are now OFF by default, allowing entries without distance constraints unless explicitly configured.
Added safer bound handling to prevent invalid or collapsed gravity ranges.
Upper and lower gravity bands (and cloud) are now plotted only when they are meaningful, avoiding scale distortion and improving chart readability.
Continuation logic remains unchanged, while VWAP reclaim (regime-change) logic continues to ignore gravity limits by design.
These changes improve usability out of the box, reduce visual clutter, and make gravity constraints fully opt-in for advanced users.
Phát hành các Ghi chú
Update: Triple-Confirmation Engine + Custom Momentum EMA Length 🔥This release brings a major upgrade to VGO’s entry logic and momentum tuning:
1. Triple-Confirmation Entry Rules (Stronger, Cleaner Signals)
A position is now entered only when all three confirmations align:
Delta > 0
– Price must be on the correct side of VWAP (context / regime)
Velocity > 0 (Fast EMA on Delta)
– Delta must be rising, confirming momentum
Acceleration > 0 (MACD Histogram on Delta)
– Delta must be accelerating in the same direction
Short entries use the exact inverse (all three < 0).
This drastically reduces VWAP-side chop and improves trend-continuation reliability.
2. NEW: Dedicated Momentum EMA Length Input ⚡
You can now independently control the EMA length used to calculate Delta momentum (Velocity).
This lets you tune the “responsiveness” of momentum without affecting MACD parameters.
No other behaviour, visuals, documentation, or threshold logic has been altered.
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.
Gokul Ramachandran – software architect, programmer. Interested in trading and investment. Currently trading and researching strategies that can be employed in NSE.
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
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.
Gokul Ramachandran – software architect, programmer. Interested in trading and investment. Currently trading and researching strategies that can be employed in NSE.
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
Contact: gokul4trading@gmail.com]
LinkedIn: linkedin.com/in/gokulramachandran/
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.