OPEN-SOURCE SCRIPT
STS4x - Initial Balance

Clean Initial Balance with bar-anchored line origins, H/L letter markers, and a live info dashboard. Built for index futures (ES/NQ/YM and their micros) but works on anything intraday.
What it does:
Tracks the high and low established in the first 30 or 60 minutes of the RTH session, locks the range when the window closes, and gives you the IBH, IBL, midpoint, plus optional 1x and 2x range extensions for the rest of the day.
What sets it apart:
IBH and IBL lines start at the exact bar that printed each extreme. Not at session open. The midpoint anchors at whichever extreme came first.
"H" and "L" letter tag markers sit on those exact candles so you can see at a glance where the structural extremes were set.
Solid color info dashboard with sectioned layout. No transparent washes. Four built-in schemes: STS4x Cyan, Amber Terminal, Crimson Pro, Mono Slate.
Live position and break tracking. The table shows whether price is above IBH, inside, or below IBL, the live distance to each level, and flips green or red the moment either side breaks.
Day-end freeze. Lines extend forward each bar during RTH and freeze permanently at session close. New day resets cleanly.
No repaint. IB values lock when the window closes and stay frozen for the day.
How traders use the IB:
Above IBH on a strong open: trend-day potential, IBH becomes support
Below IBL on a weak open: same logic short, IBL becomes resistance
Holding inside the IB: rotational day, fade the edges
Both sides broken: distribution day, lower conviction
1x and 2x extensions act as target zones on trend days
Settings:
IB Length: 30 min or 60 min (60 default)
RTH session and timezone (defaults to 0930-1600 ET)
Bars ahead of price: how far lines project forward
Independent color, width, and style controls for IBH, IBL, IBM
Marker style: Letter Tag, Letter Circle, or Plain Circle
1x and 2x range extensions, optional
Solid color price tags at the right edge
Info table position, size, and color scheme
Alerts:
IB Locked
IBH Break
IBL Break
Recommended timeframes: 1m, 3m, 5m, 15m. Lower timeframes give cleaner extremes since the lines anchor to the exact bars that set them.
Works on any intraday timeframe. Will not load on Daily, Weekly, or Monthly since IB doesn't apply there.
What it does:
Tracks the high and low established in the first 30 or 60 minutes of the RTH session, locks the range when the window closes, and gives you the IBH, IBL, midpoint, plus optional 1x and 2x range extensions for the rest of the day.
What sets it apart:
IBH and IBL lines start at the exact bar that printed each extreme. Not at session open. The midpoint anchors at whichever extreme came first.
"H" and "L" letter tag markers sit on those exact candles so you can see at a glance where the structural extremes were set.
Solid color info dashboard with sectioned layout. No transparent washes. Four built-in schemes: STS4x Cyan, Amber Terminal, Crimson Pro, Mono Slate.
Live position and break tracking. The table shows whether price is above IBH, inside, or below IBL, the live distance to each level, and flips green or red the moment either side breaks.
Day-end freeze. Lines extend forward each bar during RTH and freeze permanently at session close. New day resets cleanly.
No repaint. IB values lock when the window closes and stay frozen for the day.
How traders use the IB:
Above IBH on a strong open: trend-day potential, IBH becomes support
Below IBL on a weak open: same logic short, IBL becomes resistance
Holding inside the IB: rotational day, fade the edges
Both sides broken: distribution day, lower conviction
1x and 2x extensions act as target zones on trend days
Settings:
IB Length: 30 min or 60 min (60 default)
RTH session and timezone (defaults to 0930-1600 ET)
Bars ahead of price: how far lines project forward
Independent color, width, and style controls for IBH, IBL, IBM
Marker style: Letter Tag, Letter Circle, or Plain Circle
1x and 2x range extensions, optional
Solid color price tags at the right edge
Info table position, size, and color scheme
Alerts:
IB Locked
IBH Break
IBL Break
Recommended timeframes: 1m, 3m, 5m, 15m. Lower timeframes give cleaner extremes since the lines anchor to the exact bars that set them.
Works on any intraday timeframe. Will not load on Daily, Weekly, or Monthly since IB doesn't apply there.
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.