OPEN-SOURCE SCRIPT
2-Day Rolling VWAP

2-Day Rolling VWAP extends the traditional Volume Weighted Average Price calculation beyond a single session, providing a smoother and more stable reference level that spans two full trading days. While standard VWAP resets at the start of each new session, this rolling approach maintains continuity by continuously calculating the volume-weighted average price over the most recent 48-hour window—making it particularly valuable for swing traders and those holding positions overnight who need context beyond intraday levels. The indicator automatically manages historical data, dropping the oldest day's bars as each new trading day begins to maintain a consistent 2-day lookback. Optional percentage-based bands (default ±1%) provide dynamic support and resistance zones around the rolling VWAP, helping identify potential mean-reversion opportunities when price extends too far from the volume-weighted fair value. Visual crossover signals—green triangles below bars when price crosses above VWAP, red triangles above bars when price crosses below—highlight potential momentum shifts and entry/exit points. The source input allows calculation based on close, open, high, low, or any custom value. Whether you're looking for a more stable intraday anchor than single-session VWAP, identifying multi-day value areas, or timing entries around volume-weighted levels, this rolling VWAP provides the extended context that traditional VWAP calculations lack.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.