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.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。