OPEN-SOURCE SCRIPT
已更新 Opening Range {basic}

Introduction
Opening range {basic} is a clean and reliable indicator designed to help traders visualize the opening range of a trading session with minimal setup and visual clutter.
This version focuses on the core components of opening range analysis, making it ideal for traders who want a simple, effective framework for identifying early-session structure across futures, forex and crypto markets.
Description
The indicator automatically calculates the opening range high, low and midpoint over a user-defined opening window (5m, 15m, 30m or 60m) within a selected trading session (default: NY session).
During the opening range window, the indicator dynamically tracks price to form the range. Once the opening range is complete, the high, low and midpoint are extended forward for the remainder of the session, providing clear reference levels that can be used for bias, mean reversion or breakout-based decision making.
A shaded fill highlights the opening range area, with an optional size display showing the total range in price units. Styling and logic are intentionally simplified to keep the chart clean and easy to interpret.
Features
Configurable opening range length
Choose between 5m, 15m, 30m or 60m opening ranges.
Session-based calculation
Opening range is calculated only within the selected trading session.
Opening range levels
Opening range high, low and midpoint.
Range fill & size display
Clean, minimal design
Optimized performance
Designed for intraday timeframes compatible with the selected opening range length.
Terms & Conditions
Opening range {basic} is a clean and reliable indicator designed to help traders visualize the opening range of a trading session with minimal setup and visual clutter.
This version focuses on the core components of opening range analysis, making it ideal for traders who want a simple, effective framework for identifying early-session structure across futures, forex and crypto markets.
Description
The indicator automatically calculates the opening range high, low and midpoint over a user-defined opening window (5m, 15m, 30m or 60m) within a selected trading session (default: NY session).
During the opening range window, the indicator dynamically tracks price to form the range. Once the opening range is complete, the high, low and midpoint are extended forward for the remainder of the session, providing clear reference levels that can be used for bias, mean reversion or breakout-based decision making.
A shaded fill highlights the opening range area, with an optional size display showing the total range in price units. Styling and logic are intentionally simplified to keep the chart clean and easy to interpret.
Features
Configurable opening range length
Choose between 5m, 15m, 30m or 60m opening ranges.
Session-based calculation
Opening range is calculated only within the selected trading session.
Opening range levels
Opening range high, low and midpoint.
Range fill & size display
- Shaded fill between the opening range high and low.
- Text showing total opening range size.
Clean, minimal design
- Fixed line styles and thickness for clarity.
- Dark and light theme support.
- Minimal settings for fast, intuitive use.
Optimized performance
Designed for intraday timeframes compatible with the selected opening range length.
Terms & Conditions
- This indicator is provided for educational and informational purposes only and does not constitute financial advice.
- Trading involves risk and past performance is not indicative of future results.
- The user assumes full responsibility for any trading decisions made using this indicator.
發行說明
This update consolidates the {premium} & {basic} versions of this indicator into one single version - free and accessible to the whole TradingView community.New Features (from {premium} version)
- Project the opening range by up to 4 customizable extension levels. Useful for potential targets or reversal zones.
- Highlight a breakout of the opening range by changing the color of the first candle which closes outside of the opening range.
發行說明
Additions- Volume profile — an optional volume profile of the opening range, drawn once the range has formed. It starts at the left edge of the range and extends over the candles that follow. The POC is highlighted in blue, and the value area — the rows holding 70% of the range's volume — is shaded more strongly than the rows outside it. Only the latest range shows a profile. Turn it on with Volume Profile in the Setup group.
- Volume profile data — choose 1-Minute Data, which works on every TradingView plan, or Footprint, which uses TradingView's volume footprint data for exact volume at each price and needs a Premium or Ultimate plan.
- Open Time — the range can now start at any New York time, entered as HH:MM — for example 08:20 for gold or 09:30 for the NYSE open.
Changes
- The range now starts at a set open time instead of a session window, and its levels run until the market's next daily candle instead of stopping at the session end — into the evening on futures and forex, for example. Breakout highlighting follows the same period.
- Past ranges are now faded and unlabelled, so the latest range stands out. A range becomes past when the next one opens.
- Settings are simplified into Style, Setup and Extensions groups. The theme is Light or Dark, with Light as the default. The Custom theme and the individual colour, line style and width settings have been removed in favour of a fixed look designed for both themes.
- The range high, low, mid, fill and range size are always shown.
- The range high, low and mid lines and their labels are drawn from the start of the range while it forms. The mid line previously only appeared once the range was complete, starting from its last candle.
- The range size now sits just above the range high at its left edge, rather than inside the fill, and is rounded to the symbol's tick size.
- Breakout highlighting is now a single setting covering both directions, on by default, in the theme's blue.
- Extension levels keep their level selection but use a fixed style, and past days keep their extensions.
- Because the settings have changed, check your open time, range length and extension levels after updating.
Fixes
- Stock charts without extended hours now get a new range every day. Previously, with no gap between sessions, the range only formed once.
- Seconds charts now use the correct range length. Previously a 15 minute range on a 1 second chart covered 15 seconds.
- The range is now measured in time rather than a number of candles, so missing candles on thinly traded symbols no longer stretch it.
- On a timeframe that does not fit the range — a 5 minute range on a 3 minute chart, or a 9:30 open on a 1 hour chart where no candle starts at 9:30 — the range is no longer built from the wrong candles. It is not drawn.
- Extension levels no longer disappear on long chart histories. Each day's drawings are now kept together, and the oldest day is removed in full first.
Repainting
- Breakout candles are coloured only once the candle closes. Previously the colour could appear and disappear while a candle was still forming.
- While the range is forming, its high, low, mid, fill and size update as price moves. That is a range still being built, not a finished level being changed. Once complete, the range does not change.
- The volume profile is drawn from completed candles once the range has formed, and does not change afterwards.
- Levels extend to the right as the day progresses. That is a drawing being lengthened, not a value being changed.
Limitations
- A range is only drawn when a candle starts exactly at the open time and the range length divides evenly by the chart timeframe. Otherwise nothing is drawn.
- If a symbol has no candle at the open time on a given day, there is no range that day.
- Levels end at the symbol's own daily candle, which differs by market — 18:00 New York time for CME futures, 17:00 for forex and midnight UTC for crypto, for example. If a new daily candle starts before the range has finished forming, that day's range is not drawn.
- The open time is always New York time.
- Drawing objects are capped by the platform, so history is limited — around 166 days with no extensions and 45 with all four.
- Zoomed far out, the range size text can extend past the end of the range.
- The volume profile needs volume data, so it is not drawn on symbols without volume, such as some indices. With 1-Minute Data, each 1-minute candle's volume is spread evenly across its high and low, so the profile is an approximation. Footprint is exact.
- Footprint needs a Premium or Ultimate plan. If footprint data is not available, the profile uses 1-minute data instead.
- This is an indicator, not a strategy. It offers no entries, exits, stop levels, position sizing or risk management, and makes no claim about profitability.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。