OPEN-SOURCE SCRIPT
HTF Previous Candle High/Low

HTF Previous Candle High/Low is a multi‑timeframe support‑and‑resistance tool designed for traders who rely on higher‑timeframe structure while executing on lower timeframes. The indicator automatically plots the previous candle’s high and low from any selected higher timeframe (HTF), such as 15m, 30m, 1h, 4h, or any custom timeframe supported by TradingView.
The levels update automatically at the moment a new HTF candle opens, ensuring the lines always reflect the most recent completed candle. Unlike traditional horizontal rays that extend across the entire chart, this tool allows you to define a custom line length (in minutes) so the levels only extend as far as you want—ideal for scalpers and intraday traders who prefer clean charts.
Key Features
HTF Selection: Choose any timeframe (15m, 30m, 1h, 4h, etc.) to pull the previous candle’s high and low.
Auto‑Updating Lines: The indicator updates the same lines every time a new HTF candle forms—no clutter, no line duplication.
Custom Line Length: Define how far the lines extend (in minutes), instead of using full‑screen rays.
Color & Width Customization: Independently set the color, transparency, and width for both high and low lines.
Timeframe Visibility Control: Choose whether the levels appear on all timeframes, only lower timeframes, only higher timeframes, or only the same timeframe.
Clean & Lightweight: Uses minimal resources and avoids unnecessary objects on the chart.
Use Cases
Intraday traders marking key HTF levels while trading on 1m/5m charts.
Scalpers who want HTF structure without cluttering the entire chart.
Swing traders who want clear visual confirmation of previous candle boundaries.
Anyone who uses HTF highs/lows as liquidity zones, breakout levels, or reaction points.
This indicator is designed to be simple, efficient, and highly customizable—giving you full control over how HTF levels appear on your chart.
The levels update automatically at the moment a new HTF candle opens, ensuring the lines always reflect the most recent completed candle. Unlike traditional horizontal rays that extend across the entire chart, this tool allows you to define a custom line length (in minutes) so the levels only extend as far as you want—ideal for scalpers and intraday traders who prefer clean charts.
Key Features
HTF Selection: Choose any timeframe (15m, 30m, 1h, 4h, etc.) to pull the previous candle’s high and low.
Auto‑Updating Lines: The indicator updates the same lines every time a new HTF candle forms—no clutter, no line duplication.
Custom Line Length: Define how far the lines extend (in minutes), instead of using full‑screen rays.
Color & Width Customization: Independently set the color, transparency, and width for both high and low lines.
Timeframe Visibility Control: Choose whether the levels appear on all timeframes, only lower timeframes, only higher timeframes, or only the same timeframe.
Clean & Lightweight: Uses minimal resources and avoids unnecessary objects on the chart.
Use Cases
Intraday traders marking key HTF levels while trading on 1m/5m charts.
Scalpers who want HTF structure without cluttering the entire chart.
Swing traders who want clear visual confirmation of previous candle boundaries.
Anyone who uses HTF highs/lows as liquidity zones, breakout levels, or reaction points.
This indicator is designed to be simple, efficient, and highly customizable—giving you full control over how HTF levels appear on your chart.
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.