OPEN-SOURCE SCRIPT
Updated

Simple VWAP + Bands

1 998
Simple VWAP + Bands
A clean and customizable VWAP (Volume Weighted Average Price) indicator with standard deviation bands and RTH (Regular Trading Hours) session support.

Features:
- VWAP Line: Volume-weighted average price calculation
- Three Standard Deviation Bands: Configurable bands at 1σ, 2σ, and 3σ levels (above and below VWAP)
- RTH Session Support: Option to calculate VWAP only during regular trading hours
- Customizable Session Times: Configure your own trading session hours and timezone
- Clean Visualization: Line breaks between sessions prevent messy connections across non-trading periods
- Toggle Bands: Show/hide individual standard deviation bands as needed

Use Cases:
- Identify overbought/oversold conditions relative to volume-weighted price
- Track price deviation from VWAP during trading sessions
- Support and resistance levels based on standard deviations
- Mean reversion trading strategies
Release Notes
- Migrated simplevwap.pine from Pine v5 to v6
- Added Show previous day value as rectangle for the current day
- Rectangle uses the previous trading day’s +1 / -1 VWAP band area
- Changed trading-day boundary to Globex open (18:00 in sessionTZ)
- Show last days now filters by Globex trading day, not midnight
- Previous-day rectangles now show for each visible trading day, not only today
- Added box styling inputs:
- fill color
- border color
- border width
- Fixed empty-array error on bar 0 for rectangle handling

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.