OPEN-SOURCE SCRIPT
SYXX - HTF Candle Overlay

This script, titled "HTF Candle Overlay by SYXX," is designed to visualize the full range and structure of a higher-timeframe (HTF) candle directly onto a lower-timeframe chart. It helps traders maintain context by showing where the current price action sits relative to a much larger candle's boundaries. Combined with LuxAlgo Volume Node Profile.
1. 🔍 Primary Feature: Higher Timeframe Candle Projection
Configurable Timeframe: The user sets the desired HTF using the Interval input, which defaults to 'D' (Daily). The indicator then tracks the High, Low, Open, and Close of that HTF bar.
Live and Historical Drawing: The script uses box.new to draw boxes representing the candle's full range (High to Low).
Historical Boxes (if changeHTF): When a new HTF candle closes, the completed box for the previous period is drawn.
Live Box (if barstate.islast): The indicator draws a live, dynamic box for the current, incomplete HTF candle, which expands with every new High or Low on the lower chart.
2. 🎨 Visualization & Customization
Color-Coded Bias: The boxes are colored based on the HTF candle's direction:
Bullish/Long (BgLong): Green color is used if the HTF candle closed higher than it opened (close > htfOpen).
Bearish/Short (BgShort): Red color is used if the HTF candle closed lower than it opened.
Box Styling: Users can customize the box's appearance, including border color and style, border thickness, and background opacity (BoxOpacity).
Midline: An optional MidLine is calculated as the average of the HTF High and Low, acting as a potential support/resistance reference point.
Range Display: The indicator can display the range of the box in pips (BoxRangePips) or the percentage of movement relative to the full range (BoxRangePercentage).
Time Labels: It plots time labels that show the start and end time of the completed HTF period (e.g., "07:00 - 11:00").
3. 🚨 Alert System (Placeholders)
The script includes placeholder inputs for standard trading alerts, though the internal logic for checking these conditions is currently commented out or set to false:
Alert: Break Above/Below Box: To signal a breakout of the HTF High or Low.
Alert: Price Re-Enters Box: To signal a pullback back into the range.
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.