OPEN-SOURCE SCRIPT
HTF Levels | 1H 4H Daily

HTF Levels | 1H 4H Daily
Plots the current and previous High, Low, and Midpoint for the 1-Hour, 4-Hour, and Daily timeframes directly on your chart — regardless of which timeframe you are trading on.
What makes this original:
Most HTF level tools simply draw static lines from request.security() on every bar, cluttering historical price action. This script draws only on the current bar (barstate.islast), keeping the chart clean. It also includes an automatic level merging algorithm — when levels from different timeframes fall within a configurable percentage threshold of each other, they are averaged into a single line with a combined label (e.g. 4H H | Prv D H), visually identifying high-confluence zones without requiring manual comparison.
Levels plotted:
Current period: High, Midpoint ((H+L)/2), Low — lines extend across the full chart
Previous period: High, Midpoint, Low — lines extend left only for visual separation
Confluence Merging:
When two or more levels are within the merge threshold (default 0.05%), they collapse into one averaged line with a merged label. Adjust the threshold in settings to suit your instrument's tick size.
Alerts:
Every level has its own named alert condition. Use individual alerts (e.g. "4H High", "Prev Daily Low") or the master "Any HTF Level" alert to get notified when price enters proximity of any key zone. The alert buffer % is fully adjustable.
Settings:
Toggle each timeframe independently
Custom color per timeframe
Line width and label size controls
Merge threshold % — how close levels must be to combine
Alert buffer % — how close price must be to trigger
Best used on intraday timeframes (1m–30m) where 1H, 4H, and Daily levels act as key support and resistance.
Plots the current and previous High, Low, and Midpoint for the 1-Hour, 4-Hour, and Daily timeframes directly on your chart — regardless of which timeframe you are trading on.
What makes this original:
Most HTF level tools simply draw static lines from request.security() on every bar, cluttering historical price action. This script draws only on the current bar (barstate.islast), keeping the chart clean. It also includes an automatic level merging algorithm — when levels from different timeframes fall within a configurable percentage threshold of each other, they are averaged into a single line with a combined label (e.g. 4H H | Prv D H), visually identifying high-confluence zones without requiring manual comparison.
Levels plotted:
Current period: High, Midpoint ((H+L)/2), Low — lines extend across the full chart
Previous period: High, Midpoint, Low — lines extend left only for visual separation
Confluence Merging:
When two or more levels are within the merge threshold (default 0.05%), they collapse into one averaged line with a merged label. Adjust the threshold in settings to suit your instrument's tick size.
Alerts:
Every level has its own named alert condition. Use individual alerts (e.g. "4H High", "Prev Daily Low") or the master "Any HTF Level" alert to get notified when price enters proximity of any key zone. The alert buffer % is fully adjustable.
Settings:
Toggle each timeframe independently
Custom color per timeframe
Line width and label size controls
Merge threshold % — how close levels must be to combine
Alert buffer % — how close price must be to trigger
Best used on intraday timeframes (1m–30m) where 1H, 4H, and Daily levels act as key support and resistance.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
profitgang
haze
haze
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
profitgang
haze
haze
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.