OPEN-SOURCE SCRIPT
업데이트됨 Opening Range Box

Opening Range Box
Opening Range Box highlights the high and low of a user-defined opening session and visualizes the range directly on the chart. The script tracks price during the selected session window and dynamically builds a range using the highest high and lowest low that occur within that period. As the session progresses, the range updates in real time so traders can see the developing structure of the opening market activity.
Once the session begins, the indicator starts calculating the opening range and draws a box around the price action between the session high and low. At the same time, horizontal lines are plotted at the high and low levels of the range. These levels represent important reference points that many intraday traders use to identify potential breakout, breakdown, or support and resistance zones.
After the opening session ends, the final range is locked in. If enabled, the high and low levels can automatically extend to the right side of the chart so they remain visible for the rest of the trading session. This allows traders to easily monitor how price interacts with the opening range throughout the day.
An optional midpoint line can also be displayed. This dashed line represents the 50% level of the opening range and can be used as an additional reference level for balance, mean reversion, or intraday bias.
All visual elements can be customized. Users can control the session time, enable or disable the range box, show or hide the midpoint, extend the range levels across the chart, and adjust colors and line width to match their chart layout.
The default session is set to 09:30–10:00 to match the first thirty minutes of the U.S. equities market open, but it can be changed to any time window to suit different markets or trading strategies. The indicator is designed for intraday charts and is commonly used for opening range breakout strategies and early-session support and resistance analysis.
Opening Range Box highlights the high and low of a user-defined opening session and visualizes the range directly on the chart. The script tracks price during the selected session window and dynamically builds a range using the highest high and lowest low that occur within that period. As the session progresses, the range updates in real time so traders can see the developing structure of the opening market activity.
Once the session begins, the indicator starts calculating the opening range and draws a box around the price action between the session high and low. At the same time, horizontal lines are plotted at the high and low levels of the range. These levels represent important reference points that many intraday traders use to identify potential breakout, breakdown, or support and resistance zones.
After the opening session ends, the final range is locked in. If enabled, the high and low levels can automatically extend to the right side of the chart so they remain visible for the rest of the trading session. This allows traders to easily monitor how price interacts with the opening range throughout the day.
An optional midpoint line can also be displayed. This dashed line represents the 50% level of the opening range and can be used as an additional reference level for balance, mean reversion, or intraday bias.
All visual elements can be customized. Users can control the session time, enable or disable the range box, show or hide the midpoint, extend the range levels across the chart, and adjust colors and line width to match their chart layout.
The default session is set to 09:30–10:00 to match the first thirty minutes of the U.S. equities market open, but it can be changed to any time window to suit different markets or trading strategies. The indicator is designed for intraday charts and is commonly used for opening range breakout strategies and early-session support and resistance analysis.
릴리즈 노트
Updated릴리즈 노트
Updated with option to show historical orbs.릴리즈 노트
Updated with Historical Lookback feature.릴리즈 노트
Added Midline Style functionality.릴리즈 노트
Added break of range labels.릴리즈 노트
Added reverse signals/logic.Added non-repaint user control/logic.
릴리즈 노트
Added custom ATR target lines.릴리즈 노트
Historical ORB behavior updated.릴리즈 노트
Internal adjustments.릴리즈 노트
Pine category updated.릴리즈 노트
Here's what changed between the original and the current version:---
**Settings Panel Organization**
The original had all settings dumped in one flat list with no grouping. The current version organizes everything into labeled sections — Session, ORB Display, ORB Style, ATR Lines, and Break Labels — so related settings are visually grouped together in the indicator's settings panel. Every single input also has a tooltip, meaning if you hover over a setting you get a plain-English explanation of what it does.
---
**Separate Line Width Controls**
The original had one single "Line Width" knob that applied to everything — the box, the green/red/mid lines, and all the orange ATR lines. The current version splits this into two independent controls. "ORB Line Width" governs the box border, the green high line, the red low line, and the midline. "ATR Line Width" governs only the orange ATR target lines. This lets you make the ORB itself visually bold while keeping the ATR lines thinner (or vice versa).
---
**Default Changes**
Three defaults were updated. Show Historical ORBs flipped from off to on, so prior sessions are visible immediately without having to dig into settings. ORB Line Width defaults to 2 instead of 1, giving the range box and its lines a slightly heavier appearance out of the box. Historical ORBs to Show remains at 2.
릴리즈 노트
Break label logic updated.Added break label style controls.
릴리즈 노트
**Opening Range XL — Change Log**---
**Version: Chart Timeframe Mode + Warning System**
---
**New: "Chart" Duration Mode**
The Range Duration input has been converted from a number picker to a dropdown that includes a new "Chart" option. This option is now the first item in the list and the default selection when the indicator is first added to a chart.
- When "Chart" is selected, the ORB spans exactly one bar of whatever timeframe the chart is currently on — a 5-minute chart gives you a 5-minute ORB, a 15-minute chart gives you a 15-minute ORB, and so on
- All existing minute-duration options (1 through 480) remain exactly as before and behave identically to the original script
- Internally, "Chart" mode detects the single bar whose open timestamp matches your configured Start Time and uses that bar's high and low as the range — no duration math involved
---
**New: Timeframe Warning Table**
A warning label is now displayed directly on the chart when the indicator detects it cannot produce reliable data for the current chart timeframe. The warning is rendered as a fixed table element anchored to the screen edge so it never drifts with price.
- In minute-duration mode, the warning fires when the chart timeframe is larger than the selected duration — for example, a 30-minute ORB setting on a 1-hour chart
- In Chart mode, the warning fires when the chart timeframe is Daily (1440 minutes) or higher, where a single-bar ORB is meaningless
- The warning message tells you exactly what the mismatch is, showing both the chart timeframe in minutes and the selected duration in minutes
- When the warning is not active, nothing is shown and the indicator operates silently as normal
---
**New: Warning Label Position Input**
A new input has been added to the **ORB Display** group allowing you to choose where the warning table appears on screen. The six available positions are Top Left, Top Center, Top Right, Bottom Left, Bottom Center, and Bottom Right. The default is Top Right.
---
**New: ORB Suppressed When Warning Is Active**
When the warning is showing, the indicator now draws nothing at all. This is intentional — if the timeframe mismatch means the data would be wrong, displaying it silently would be worse than displaying nothing.
- The ORB box, high line, low line, midline, and all ATR projection lines are blocked from drawing
- Break of range labels are suppressed and will not fire
- If you switch to an invalid timeframe while an ORB is already drawn on screen, all existing drawings are immediately cleared so nothing stale remains visible
- Switching back to a valid timeframe removes the warning and resumes normal drawing immediately
릴리즈 노트
**Opening Range XL — What's New**The updated version is functionally identical to the original in every way that matters for charting — all the opening range box drawing, high/low/midline extensions, ATR projection lines, historical ORB overlays, break-of-range labels, and alerts work exactly as they did before. The only addition is a new on-chart information panel that gives you a quick-glance summary of the session's key settings without having to open the indicator settings menu.
---
**The Info Box**
A compact table now appears on your chart — defaulting to the bottom-left corner — that displays five rows of session and ATR configuration data at a glance:
- **Start** — shows the opening range start time you have configured, such as 0930
- **Range** — shows the range duration setting exactly as you selected it, such as Chart, 5, 15, 30, and so on
- **ATR1** — shows the multiplier value set for ATR Line 1, such as 2
- **ATR2** — shows the multiplier value set for ATR Line 2, such as 4
- **ATR3** — shows the multiplier value set for ATR Line 3, such as 6
The table has a title row at the top that reads "Opening Range XL" and spans the full width of both columns. Below that is a Metric and Value column header row, followed by the five data rows above. Values are color-coded — the start time displays in yellow, the range duration in aqua, and the three ATR multipliers in orange — matching the visual language of the indicator's lines on the chart.
The info box is fully aware of the warning state. If your chart timeframe is too high for the selected ORB duration, the box hides itself automatically, just like the rest of the indicator's drawings do.
---
**New User Inputs — ℹ️ Info Box Group**
All controls for the info box live in their own dedicated settings group at the bottom of the inputs tab. In order from top to bottom:
- **Show Info Box** — a simple on/off toggle to show or hide the panel entirely, defaulting to on
- **Info Box Position** — lets you place the table anywhere on the chart across nine positions: Top Left, Top Center, Top Right, Middle Left, Middle Center, Middle Right, Bottom Left, Bottom Center, or Bottom Right, defaulting to Bottom Left
- **Text Size** — controls the font size of all text inside the table, with options of Tiny, Small, Normal, Large, or Huge, defaulting to Tiny to keep the panel compact and unobtrusive
- **Text Color** — controls the color of the metric label text in the left column, defaulting to a near-white
- **Heading Color** — controls the background color of the title row that reads "Opening Range XL", defaulting to a semi-transparent blue so it stands out clearly from the data rows
- **Background Color** — controls the fill color behind all the data rows, defaulting to a semi-transparent dark background
- **Border Color** — controls the color of the table's outer frame and the dividing lines between cells, defaulting to a semi-transparent gray
릴리즈 노트
**What Was Updated**The info box — the small data table that appears on your chart — now has two display modes you can switch between depending on how much information you want visible at a glance.
**The New "Info Box Mode" Dropdown**
Inside the **ℹ️ Info Box** settings group, directly below the "Show Info Box" toggle, you'll find a new dropdown called **Info Box Mode** with two choices:
- **Detailed** — This is the default and matches exactly what the info box showed before. It displays five rows of data: the session start time, the range duration, and all three ATR multiplier values (ATR1, ATR2, ATR3). Choose this when you want a full at-a-glance summary of your session and target settings.
- **Compact** — Strips the box down to just two rows: start time and range duration. The ATR multiplier rows are completely removed, making the table noticeably smaller. Choose this when you already know your ATR settings cold and just want a quick reminder of the session parameters without the extra visual weight on your chart.
**How to Switch Modes**
1. Open your indicator settings (click the gear icon next to the indicator name on your chart).
2. Navigate to the **ℹ️ Info Box** section.
3. Click the **Info Box Mode** dropdown — it will show `Detailed` by default.
4. Select `Compact` to shrink the box, or leave it on `Detailed` to keep everything visible.
5. Click OK. The info box updates immediately.
That's the entire change — everything else about the indicator behaves identically.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.