OPEN-SOURCE SCRIPT
Rolling Anchored VWAP

Rolling Anchored VWAP (RAVWAP) plots up to three independent, volume-weighted average price lines that roll forward bar by bar. Unlike session VWAP, which resets at the open, each line uses a moving anchor: at every bar, the window starts exactly N bars ago and runs through the current bar, so you get a continuously updating fair-value reference without session breaks.
Overview
VWAP is widely used by institutions to gauge whether price is trading above or below the volume-weighted average. This indicator extends that idea with rolling anchored windows of any length you choose — useful on any timeframe, including higher timeframes where session VWAP is less relevant.
Each VWAP is fully configurable: enable or disable it, set its own period, color, and line width, and optionally display volume-weighted standard deviation bands at ±1σ, ±2σ, and ±3σ.
How it works
For a given Period setting of N:
The anchor is placed N bars before the current bar
VWAP is calculated from that anchor through the current bar (inclusive)
On each new bar, the anchor advances by one bar
Example with Period = 100:
Bar 100 → VWAP over bars 0 through 100
Bar 101 → VWAP over bars 1 through 101
Bar 102 → VWAP over bars 2 through 102
The calculation uses efficient rolling sums, so it stays responsive even with periods in the hundreds or thousands.
Standard deviation bands use the same volume-weighted formula as TradingView’s built-in VWAP:
σ = √( Σ(V × P²) / Σ(V) − VWAP² )
Band toggles affect display only — they do not change the VWAP value.
Features
3 independent rolling VWAPs with separate periods (defaults: 100, 250, 500)
Individual enable/disable for each VWAP
Custom color and line width per VWAP
Optional ±1σ, ±2σ, ±3σ bands per VWAP
Optional filled band between ±1σ
Configurable source (default: HLC3)
Non-repainting — historical values are fixed after each bar closes
No session resets — continuous rolling windows on any timeframe
Overlay on price — plots directly on the chart scale
Overview
VWAP is widely used by institutions to gauge whether price is trading above or below the volume-weighted average. This indicator extends that idea with rolling anchored windows of any length you choose — useful on any timeframe, including higher timeframes where session VWAP is less relevant.
Each VWAP is fully configurable: enable or disable it, set its own period, color, and line width, and optionally display volume-weighted standard deviation bands at ±1σ, ±2σ, and ±3σ.
How it works
For a given Period setting of N:
The anchor is placed N bars before the current bar
VWAP is calculated from that anchor through the current bar (inclusive)
On each new bar, the anchor advances by one bar
Example with Period = 100:
Bar 100 → VWAP over bars 0 through 100
Bar 101 → VWAP over bars 1 through 101
Bar 102 → VWAP over bars 2 through 102
The calculation uses efficient rolling sums, so it stays responsive even with periods in the hundreds or thousands.
Standard deviation bands use the same volume-weighted formula as TradingView’s built-in VWAP:
σ = √( Σ(V × P²) / Σ(V) − VWAP² )
Band toggles affect display only — they do not change the VWAP value.
Features
3 independent rolling VWAPs with separate periods (defaults: 100, 250, 500)
Individual enable/disable for each VWAP
Custom color and line width per VWAP
Optional ±1σ, ±2σ, ±3σ bands per VWAP
Optional filled band between ±1σ
Configurable source (default: HLC3)
Non-repainting — historical values are fixed after each bar closes
No session resets — continuous rolling windows on any timeframe
Overlay on price — plots directly on the chart scale
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.