PROTECTED SOURCE SCRIPT
Updated

InitialBalance

55
# Initial Balance Indicator

## Overview

The Initial Balance indicator visualizes the price range (High and Low) established during a specific user-defined session time (e.g., the first hour of the trading day). It plots three key levels:
- **IB High**: The highest price reached during the session.
- **IB Low**: The lowest price reached during the session.
- **IB 50%**: The mid-point between the High and Low.

## Features

- **Custom Session Times**: Users can define the specific start and end times for the Initial Balance period (input as `HHMM`). **Note: Times are fixed to the `America/New_York` timezone.**
- **Real-Time Updates**: The levels dynamically update as the session progresses.
- **Session Independence**: Each trading day/session is treated independently using a struct-based data structure, preserving the historical lines for previous days on the chart.
- **Visual Customization**:
- Customizable colors for High (Green), Low (Red), and Mid (White) lines.
- Customizable background fill color and transparency between the High and Low lines.

## Usage

1. **Add to Chart**: specific the file `InitialBalance.pine` to your TradingView Chart.
2. **Configure Inputs**:
- **Session Settings**: Set your desired `Start Time` and `End Time` (default: 09:30 - 10:30). These times are interpreted in the **America/New_York** timezone.
- **Visual Settings**: Adjust line colors and background fill to your preference.
Release Notes
New Features:
  • Range Label: Added a dynamic label showing the range size in points and percentage. It intelligently positions itself above the High or below the Low depending on which extreme was established first.
  • Price Levels: Added optional labels for High, Low, and Mid prices.
  • Settings: Added inputs to toggle these labels and control the position of price tags (Left vs. Right side).

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.