PROTECTED SOURCE SCRIPT

Volume Weighted Initial Balance

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

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.