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.
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.