OPEN-SOURCE SCRIPT
Inside Day

The Inside Day Background indicator automatically highlights Inside Day candles directly on the chart using a customizable background color.
An Inside Day occurs when the current candle’s high is lower than the previous candle’s high, and the current low is higher than the previous candle’s low — signaling price consolidation and range compression.
This condition often precedes volatility expansion and breakout opportunities.
How It Works
The script scans each bar and checks the following condition:
Current High < Previous High
Current Low > Previous Low
When both are true:
The chart background is highlighted
No shapes or labels are plotted (clean chart visualization)
An alert condition is triggered (optional)
Trading Use Cases
Inside Days are commonly used for:
Breakout strategies
Range expansion setups
Volatility contraction signals
Bull Flag / consolidation continuation patterns
Opening range continuation plays
Traders often watch for a break above the Inside Day high (bullish) or below the low (bearish).
Features
Clean background highlight only (no chart clutter)
Fully customizable background color
Toggle on/off visibility
Built-in alert condition
Works on all timeframes
Overlay on price chart
Notes
Consecutive Inside Days will continue highlighting until range expansion occurs.
Best combined with volume, VWAP, or range breakout strategies.
Effective for both day trading and swing trading environments.
An Inside Day occurs when the current candle’s high is lower than the previous candle’s high, and the current low is higher than the previous candle’s low — signaling price consolidation and range compression.
This condition often precedes volatility expansion and breakout opportunities.
How It Works
The script scans each bar and checks the following condition:
Current High < Previous High
Current Low > Previous Low
When both are true:
The chart background is highlighted
No shapes or labels are plotted (clean chart visualization)
An alert condition is triggered (optional)
Trading Use Cases
Inside Days are commonly used for:
Breakout strategies
Range expansion setups
Volatility contraction signals
Bull Flag / consolidation continuation patterns
Opening range continuation plays
Traders often watch for a break above the Inside Day high (bullish) or below the low (bearish).
Features
Clean background highlight only (no chart clutter)
Fully customizable background color
Toggle on/off visibility
Built-in alert condition
Works on all timeframes
Overlay on price chart
Notes
Consecutive Inside Days will continue highlighting until range expansion occurs.
Best combined with volume, VWAP, or range breakout strategies.
Effective for both day trading and swing trading environments.
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.