OPEN-SOURCE SCRIPT
[AlscapeLabs] HTF Candle Stack (Multi-Timeframe)

Overview
The HTF Candle Stack (Multi-TF) indicator is a powerful visualization tool designed to overlay high-timeframe (HTF) price action directly onto your current chart, independent of the chart's price scale. This gives traders a clear, aligned, and non-overlapping view of simultaneous price movements across customizable timeframes.
By stacking the candles horizontally next to the chart's price action, the indicator allows for quick identification of multi-timeframe correlation, trend confluence, and key levels without switching chart timeframes.
Key Features
- 6 Independent Stacks: Configure up to 6 separate timeframes (e.g., 5m, 15m, 1H, 4H, Daily, Weekly) to view the complete market fractals from micro to macro.
- Price-Aligned Visualization: All HTF candle stacks are perfectly aligned with the main chart's vertical price axis
- Replay Mode Safe: Includes dedicated logic to prevent "duplicate candles" during Bar Replay, ensuring accurate backtesting and historical analysis.
- Toggleable Stacks: Each stack can be individually enabled or disabled via input settings
- Dynamic Spacing: The distance between active stacks is automatically calculated and adjusted based on the visibility of the preceding stack.
Settings Guide
Stack Configuration (1 - 6)
Each of the six stacks has identical controls:
- Show/Hide: Enable or disable this specific stack.
- Timeframe: The specific HTF to display (e.g., "60" for 1 Hour, "D" for Daily).
[*}Count: How many candles to show in this stack (Current Active Candle + Past Closed Candles). Tip: Use higher counts (10-12) for lower TFs (Stack 1-2) and lower counts (2-4) for higher TFs (Stack 5-6)
Candle Color
Controls global coloring
- Bullish / Bearish: Customize the body colors.
- Wick: Separate control for wick color and transparency
Layout
- Distance from Chart: How far (in bars) to the right the first stack begins
- Space between Stacks: The gap (in bars) between each active stack.
- Candle Width: The thickness of the HTF candles.
Labels
Displays a time-frame next to the active (live) candle in each stack
- Show TF Labels: Enable or disable labels through all stacks
- Text Color: Label text color
- Background: Label background color
- Style: Label position (Left, Down)
- Size: Label text size (Tiny, Small, Normal, Large, Huge)
Developed by AlscapeLabs
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.