PROTECTED SOURCE SCRIPT
Volume Weighted Initial Balance

This indicator dynamically calculates and plots a Volume-Weighted Initial Balance (VW-IB) for U.S. equity trading sessions (Regular Trading Hours: 9:30–16:00 ET). Unlike traditional time-based Initial Balance (fixed first 30/60 minutes), this version ends the IB formation when a user-defined percentage of the 20-day Average Daily Volume (ADV) is reached – providing a more adaptive, market-activity-driven range that better reflects actual participation.
Key Concepts and Methodology:
- 20-day Average Daily Volume (ADV20) is calculated using daily volume from the security's daily timeframe.
- A customizable target volume percentage (default 25%, adjustable 10–50%) determines the threshold (e.g., 25% of ADV20).
- The Initial Balance period begins at 9:30 AM ET and accumulates intrabar volume in real time.
- The IB completes on the first bar where either:
- Cumulative volume since open reaches or exceeds the target, OR
- A safety time cap (default 30 minutes, adjustable 15–60) is hit.
- Once complete, the script locks in the high and low of the IB period and plots them as horizontal lines.
- Additionally, it maintains a rolling 20-day history of prior IB ranges and computes their average. This average range is projected as a centered band around today's 9:30 open price, giving traders a statistical expectation of "normal" early-session volatility based on recent behavior.
Visual Features:
- Solid green/red lines for today's completed IB high and low.
- Blue circled lines and lightly filled band showing the 20-day average IB projection (centered on actual 9:30 open price).
- Subtle background shading while the IB is still forming.
- A clean top-right table displaying live status: completion state, today's IB range, 20-day average range, ADV20, and volume target.
- A label appears at completion showing exact range, minutes taken, and volume reached.
Usage Ideas:
- Use the VW-IB high/low as early support/resistance or breakout levels.
- Compare today's actual IB range to the 20-day average band for expansion/contraction context (wide today = high volatility day potential).
- Ideal for day traders on stocks, ETFs, or futures with clear RTH sessions (e.g., ES, NQ, SPY, QQQ, AAPL).
- Built-in alert fires only once per day when the VW-IB completes.
This is not a simple replication of fixed-time Initial Balance indicators. The volume-weighted termination (instead of rigid clock time), combined with real-time intrabar volume accumulation, safety time cap, rolling 20-day average projection band centered on actual open, and comprehensive live table, makes it uniquely adaptive and informative.
Key Concepts and Methodology:
- 20-day Average Daily Volume (ADV20) is calculated using daily volume from the security's daily timeframe.
- A customizable target volume percentage (default 25%, adjustable 10–50%) determines the threshold (e.g., 25% of ADV20).
- The Initial Balance period begins at 9:30 AM ET and accumulates intrabar volume in real time.
- The IB completes on the first bar where either:
- Cumulative volume since open reaches or exceeds the target, OR
- A safety time cap (default 30 minutes, adjustable 15–60) is hit.
- Once complete, the script locks in the high and low of the IB period and plots them as horizontal lines.
- Additionally, it maintains a rolling 20-day history of prior IB ranges and computes their average. This average range is projected as a centered band around today's 9:30 open price, giving traders a statistical expectation of "normal" early-session volatility based on recent behavior.
Visual Features:
- Solid green/red lines for today's completed IB high and low.
- Blue circled lines and lightly filled band showing the 20-day average IB projection (centered on actual 9:30 open price).
- Subtle background shading while the IB is still forming.
- A clean top-right table displaying live status: completion state, today's IB range, 20-day average range, ADV20, and volume target.
- A label appears at completion showing exact range, minutes taken, and volume reached.
Usage Ideas:
- Use the VW-IB high/low as early support/resistance or breakout levels.
- Compare today's actual IB range to the 20-day average band for expansion/contraction context (wide today = high volatility day potential).
- Ideal for day traders on stocks, ETFs, or futures with clear RTH sessions (e.g., ES, NQ, SPY, QQQ, AAPL).
- Built-in alert fires only once per day when the VW-IB completes.
This is not a simple replication of fixed-time Initial Balance indicators. The volume-weighted termination (instead of rigid clock time), combined with real-time intrabar volume accumulation, safety time cap, rolling 20-day average projection band centered on actual open, and comprehensive live table, makes it uniquely adaptive and informative.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
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ã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể sử dụng tự do và không giới hạn – tìm hiểu thêm tại đây.
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.