OPEN-SOURCE SCRIPT
H4 High Low Lines

OVERVIEW
This indicator marks the high and low of the last N completed 4-hour candles on any chart timeframe (1m, 5m, 15m, 4H, etc.), syncing automatically to the symbol's real 4-hour session boundaries.
HOW TO USE
Add the indicator to any chart. Two lines are drawn for each completed 4H candle: one at the wick high, one at the wick low. Each line starts exactly at the bar where that high or low occurred, extends a configurable distance ahead of price, and is labeled "H4" to the right.
Use the "Max H4 Candles to Show" input to choose how many recent 4H candles to display (1 to 10, default 2). Line color, width, style, label text, label color, label size, extend length, and label gap are all configurable in the inputs.
LIMITATIONS
The script relies on a non-repainting multi-timeframe request to the native 240 ("240" minute / 4H) series. Because of this, on a realtime bar the script waits for the underlying 4H bar to be confirmed before drawing it, which introduces a small delay relative to the moment the 4H candle actually closes. This is expected behavior for non-repainting higher-timeframe requests and is not a bug.
NOTES
This script uses the request.security() offset-and-lookahead technique documented by PineCoders in their "Higher-timeframe requests" publication to avoid repainting and ensure consistent timing across historical and live bars.
This indicator marks the high and low of the last N completed 4-hour candles on any chart timeframe (1m, 5m, 15m, 4H, etc.), syncing automatically to the symbol's real 4-hour session boundaries.
HOW TO USE
Add the indicator to any chart. Two lines are drawn for each completed 4H candle: one at the wick high, one at the wick low. Each line starts exactly at the bar where that high or low occurred, extends a configurable distance ahead of price, and is labeled "H4" to the right.
Use the "Max H4 Candles to Show" input to choose how many recent 4H candles to display (1 to 10, default 2). Line color, width, style, label text, label color, label size, extend length, and label gap are all configurable in the inputs.
LIMITATIONS
The script relies on a non-repainting multi-timeframe request to the native 240 ("240" minute / 4H) series. Because of this, on a realtime bar the script waits for the underlying 4H bar to be confirmed before drawing it, which introduces a small delay relative to the moment the 4H candle actually closes. This is expected behavior for non-repainting higher-timeframe requests and is not a bug.
NOTES
This script uses the request.security() offset-and-lookahead technique documented by PineCoders in their "Higher-timeframe requests" publication to avoid repainting and ensure consistent timing across historical and live bars.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.