OPEN-SOURCE SCRIPT
Closing Range Levels

Turn the last few minutes of every block into ready-made support and resistance.
Closing Range Levels captures the high/low of the final X minutes of each block — for example, the last 3 minutes of every 4-hour block — and projects that range as two horizontal levels across the block that follows. Where price closed out a block often acts as reference support/resistance for the next one, and this draws it for you automatically, with full history on the chart.
Highlights
Objective levels drawn automatically — no manual work
Based on where the market actually closed, not round numbers
Full historical projection to see how levels behaved
Boundaries follow the chart's own clock, DST handled automatically
Inputs
Minutes before block end — capture window size (default 3)
Block length (hours) — the projection block (default 4)
Max historical blocks kept
Colors and line width
Notes
Works best when your chart timeframe divides the capture window evenly (e.g. a 3-minute chart with a 3-minute window) and on 24h markets like FX and crypto, where block boundaries land on clean grid times. Treat the band as a reference zone rather than a hard line — on fast blocks price can push through early.
Closing Range Levels captures the high/low of the final X minutes of each block — for example, the last 3 minutes of every 4-hour block — and projects that range as two horizontal levels across the block that follows. Where price closed out a block often acts as reference support/resistance for the next one, and this draws it for you automatically, with full history on the chart.
Highlights
Objective levels drawn automatically — no manual work
Based on where the market actually closed, not round numbers
Full historical projection to see how levels behaved
Boundaries follow the chart's own clock, DST handled automatically
Inputs
Minutes before block end — capture window size (default 3)
Block length (hours) — the projection block (default 4)
Max historical blocks kept
Colors and line width
Notes
Works best when your chart timeframe divides the capture window evenly (e.g. a 3-minute chart with a 3-minute window) and on 24h markets like FX and crypto, where block boundaries land on clean grid times. Treat the band as a reference zone rather than a hard line — on fast blocks price can push through early.
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.
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.
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.