The Open Range Gap (ORG) is a core concept utilized in the ICT methodology, representing the price discrepancy between the prior Regular Trading Hours (RTH) close and the first opening tick of the current RTH session at 09:30 AM EST. This gap immediately frames the daily context:
Premium: Today's open is higher than the prior close.
Discount: Today's open is lower than the prior close.
According to statistical market behavior, there is a high probability that price action will retrace and close 50% or more of this gap within the first 30 minutes of trading (09:30 AM to 10:00 AM). These gaps often act as significant support and resistance zones. This indicator provides a highly customizable visual framework for tracking, measuring, and interacting with these crucial market levels natively on your chart.
2. Logic
The indicator dynamically calculates the gap between the 16:14 PM EST close and the 09:30 AM EST open. It is engineered with robust mathematical logic to ensure flawless performance even on sub-minute timeframes.
Gap Fill Tracking: The script visualizes price action filling the gap in real-time. It plots a tracking box that shows exactly how far the price has retraced into the gap boundaries, updating dynamically with every tick.
Pre-Session Preview: For traders who want to monitor how price is being positioned into the 09:30 open, a live ORG preview is projected before the open. During this preview, the developing "open" tracks the current live price. At 09:30, it seamlessly locks in to form the finalized gap.
Intelligent Thresholds: To keep the chart clean, Quadrants and Octants (Eighths) will only plot if the gap size meets a user-defined minimum point threshold.
Session Extensions: By default, the Open Range Gap logic spans until 10:00 AM, but can be automatically extended to the end of the trading day.
Standard Deviations (SD) & Auto-SD: You can now project Standard Deviation lines directly from the defined Opening Range Gap. We also implemented a dynamic Auto-SD engine that automatically draws new SD levels in real-time as price expands outward and breaches current extremes, keeping your chart perfectly scaled without manual adjustments.
ORG SD Selector: Gives you control over your Standard Deviation (SD) projections. Instead of plotting SDs for every ORG on the chart, you can now isolate and project SDs for specific ORG historical instances directly from the settings panel.
Equidistant Minimum Range Filter (E-MRF): To prevent chart clutter when ranges are exceptionally narrow, the new E-MRF intelligently calculates the physical point distance between projected levels. If levels (like Quadrants and Octants) get too densely packed together, the script automatically hides the tightest lines first to ensure your chart remains pristine.
US Market & Holidays Filters: Prevent plotting RTH ORGs during Holidays when future markets are trading as ETH during the RTH session. Also the ORG indicator relies on measuring the exact price difference between the prior day's Regular Trading Hours (RTH) close and today's RTH open. However, when the market is closed for a holiday—or operates on a shortened schedule—these gaps can become distorted, meaningless, or based on extremely low-volume overnight sessions. To keep your charts clean and your data accurate, this indicator features a highly advanced internal US calendar that automatically filters out these irregular days.
Advanced & Separated Labeling Engine: You now have complete, independent control over your Pane Labels and Hover Tooltips. ORG levels and SD levels have separated text formatting controls. You can mix and match Price, Fractional levels (/), Decimal levels (.), and Percentages (%) for each system exactly to your liking.
Master-Dependent UI Controls: We have integrated a highly requested dynamic settings panel. Toggling a master feature on or off will now automatically enable or gray-out all of its related sub-settings, drastically cleaning up the indicator settings menu and making customization intuitive.
3. Settings & Options
3.1 General Settings
Hide ORG above TimeFrame: Keeps your high-timeframe charts clean. By default, the ORG will automatically hide itself if you switch to a timeframe higher than the one defined here (e.g., 60 minutes).
Min ORG Range (# Points): A noise filter for insignificant gaps. If the physical size of the gap (between the prior close and current open) is smaller than this point threshold, the script will completely hide it to prevent useless data from cluttering your view.
Max ORG History (# Days): Controls how many past days of Opening Range Gaps are plotted on the chart. If the master toggle is unchecked, no historical gaps are shown (leaving only the current/active ORG).
Max SD History (# Days): A separated history limit specifically for Standard Deviation lines. Because SD lines take up a lot of vertical chart space, you can set them to disappear earlier than the core ORG lines (e.g., keeping 5 days of ORG history, but only 2 days of SD history).
Extend ORG Right (# Bars): Pushes the visual drawings forward by a set number of bars into the future space on the right side of the chart, making it easier to see impending levels before price reaches them.
E-MRF ORG & E-MRF SD (# Points): (Equidistant Minimum Range Filter) Intelligent density filters. If a gap is very narrow, the script calculates the exact point distance between the internal fractions (like 1/8ths) or Standard Deviations. If the distance falls below your set threshold, it auto-hides the densest lines to keep the chart readable.
ORG Plotting Bracket: A visual bracketing system that defines a strict, hard-coded time window (e.g., 11:00 to 15:00) for drawing the ORG. Note: When enabled, this completely overrides both the ORG Range Start and Extend ORG Right settings to strictly enforce your custom time boundaries. It only affects the drawing, not the mathematical math.
ORG Range Start: Determines the left anchor point for where the visual lines begin plotting. You can choose to start drawing the lines at the RTH Close (the prior afternoon's closing bar) or at the RTH Open (the morning's opening bar).
3.2 Pre-Session Dynamic Preview
ORG Pre-Session Preview: Enable the dynamic tracking of the projected gap before the market opens.
Preview Time prior RTH (min): Define how early the preview begins tracking.
3.3 Standard Deviations (SD) & Auto-SD Found under the Standard Deviations Settings and Standard Deviation Lines Settings groups, these controls allow you to project highly customizable mathematical extensions of the ORG range.
SD Master Toggle: Completely enables or disables Standard Deviation projections on the chart.
Auto-SD: When checked, the script operates in dynamic mode. It will mathematically project new SD levels outward in real-time only as price approaches or breaches the current extremes.
# SD: If Auto-SD is unchecked, this sets a fixed, static number of standard deviation levels to plot regardless of price action.
Sub-Level Granularity: Under the SD Lines Settings, you have independent control over the SD Master levels, 1/2 levels, 1/4 levels, and 1/8 levels. Each fraction has its own dedicated toggle, label visibility, line style, width, and color.
ORG SD Selector: The master checkbox to enable specific SD targeting.
Format String Input: A text field where you define exactly which historical instances of the ORG(s) should display SDs by using bracketed numbers.
How to use the Format String: The format string uses numbers enclosed in curly brackets to target ORG chronologically. {1} represents the current (most recent) gap in time, {2} is the previous one, {3} is the one before that, and so on.
Example 1: type {1} {3} into the format string. The indicator will plot Standard Deviations for the current ORG, skip the second one, and plot SDs for the third ORG back in time.
Example 2: type {1} {3} {7} {10} into the format string. The indicator will project SDs for the 1st, 3rd, 7th, and 10th most recent ORGs on your chart.
Note: If you accidentally input any numbers that are higher than your set maximum ORG history, the indicator will intelligently ignore them to prevent plotting errors and keep your chart clean.
3.4 Enhanced US Market Holiday & Early Close Filters
Enable Holiday Filters: This is the master switch for the internal calendar. When enabled, the indicator actively detects major US holidays and completely skips plotting the Opening Range Gap (and Dynamic Preview) for those specific days. If unchecked, the indicator will treat every day of the year exactly the same.
Official Market Holidays: The indicator includes toggles for all standard US market holidays (New Year's Day, MLK Jr. Day, Presidents' Day, Memorial Day, Juneteenth, Independence Day, Labor Day, Thanksgiving, and Christmas).
Smart Weekend Observation: The calendar is mathematically programmed to follow official NYSE/NASDAQ weekend observation rules. If a fixed holiday (like Christmas or July 4th) falls on a weekend, the indicator automatically shifts the holiday filter to the correct Friday or Monday.
Good Friday (Manual): Because Good Friday is based on the lunar calendar, its date changes drastically every year and cannot be reliably hardcoded. You must manually input the correct Month (3 for March, 4 for April) and Day each year to filter it out.
Filter Early Closes Too: This setting acts as a master switch for scheduled half-days (Day after Thanksgiving / Black Friday, Christmas Eve, and the day before Independence Day).
How ORG Handles Early Closes: Unlike continuous intraday indicators, the ORG strictly measures the overnight gap. Therefore, it does not need a "Close Hour" setting. When this filter is enabled, the indicator simply treats half-days as full holidays and skips plotting the gap entirely. This prevents irrelevant, low-volume gaps from cluttering your chart.
3.5 ORG Lines Settings
Open / Close / C.E.: Independently toggle styles (Solid, Dashed, Dotted), widths, and colors for the Open, Close, and C.E. (50% level).
Track Open: A customizable trace line leading up to the gap.
3.6 Quadrants & Octants Settings
Quadrants: Enable 25% and 75% internal gap levels. Includes a minimum point threshold filter to only show on larger gaps.
Octants: Enable eighths levels (12.5%, 37.5%, 62.5%, 87.5%) with an entirely independent point threshold filter.
3.7 Fills & Background Settings
Background: Highlights the distinct quadrants of the gap with premium/discount color coding.
Dynamic Fill Level: Enables dynamic, real-time visualization boxes showing the total gap versus the remaining unfilled gap.
3.8 Labels & Tooltips
Show Labels: Toggle core text labels. Keep labels on previous days or just the current day.
Label Elements: Choose to display Price, Level Fractions (e.g., 1/2), Decimals (0.5), or Percentages (50%).
Info Tags: Display the gap date and total range size. Features highly advanced placement options including Inline attachments to specific levels (High, Low, EQ) or Outside placement (Top/Bottom, Left/Right) with custom X/Y tick offsets.
Hover Tooltips: Keep your chart entirely clean by hiding static text and displaying Gap Name, Price, Date, and Size exclusively when you hover your mouse over the label objects.
3.9 Advanced & Separated Labeling Engine Found across the Pane Labels, Hover Tooltips, and Info Tags settings, this gives you absolute control over what data is displayed and how it looks.
Separated Data Toggles: The engine allows you to independently enable or disable specific data points for both ORG Lines and SD Lines. You can display the Price, Level as a Fraction (/), Level as a Decimal (.), or Level as a Percentage (%).
Label Customization: Total control over the visual presentation, including Label Offset, Text Color, Background Color, Font Size (Tiny to Huge), and Font Style (Bold, Italic, etc.).
Hover Tooltips: A dedicated menu to toggle interactive mouse-hover tooltips on labels. You can specifically include or exclude the Line Name, Price, Gap Date, and Gap Size inside the tooltip.
Historical Labels Toggle: Choose to keep labels drawn on all historical ORG days, or restrict labeling to only the current active trading day.
3.10 Master-Dependent UI Controls Built natively into the Pine Script interface, this provides a seamless and intuitive user experience.
Intelligent UI Hierarchy: The settings menu utilizes dynamic active/inactive states. Checkboxes act as "Master Controls" that automatically reveal or gray out dependent sub-settings.
Conflict Prevention: If you enable a feature that overrides another—for example, enabling the ORG Plotting Bracket(which strictly bounds the drawing to specific hours)—the script will intelligently disable and gray out the conflicting Extend ORG Right setting.
Clean Navigation: By hiding parameters that do not apply to your current configuration (e.g., hiding fixed SD numbers when Auto-SD is checked), the menu remains uncluttered and easy to navigate.
4. Under the Hood: Engineered for Performance
Built entirely from the ground up using the latest Pine Script™ v6 architecture, this indicator utilizes a highly optimized strict-typing approach to deliver a lightning-fast, reliable charting experience.
Sub-Minute Precision: Built using optimized exact-tick anchoring. The 16:14 close and 09:30 open are captured instantaneously without future-leak warnings, maintaining perfect accuracy on seconds and 1-minute charts.
Memory-Efficient State Management: Relies on strictly typed User-Defined Types (UDTs) and array collections to manage historical gap drawings. This guarantees that limits (e.g., "Last 10 days") are respected without memory overflow or chart rendering lag.
Native Formatting Engine: Utilizes Pine Script's native time and string formatting engines for instant label and tooltip generation, removing the bottlenecks of legacy concatenation methods.
State Machine Architecture: Gaps are tracked using advanced User-Defined Types (UDTs) and array methods, ensuring the script executes exceptionally fast while consuming minimal system memory.
Zero-Lag Rendering: Historical data calculations and complex visual elements (lines, boxes, labels, linefills) are intelligently managed and garbage-collected in real-time. This guarantees a smooth, lag-free experience, even when deployed on the 1-second timeframe with extensive historical data.
Clean-Room Execution: By strictly utilizing native v6 string formatting, streamlined execution loops, and precise multi-timeframe tuple requests, the indicator's computational footprint is virtually non-existent.
Shipping Details / Offers The products and services on this site are software-based and electronic in nature (not physical items) and are delivered via the internet and electronic networks. Therefore, physical shipping is not applicable.
Merchant Return Policy / Offers The products and services on this site are software-based and electronic in nature (not physical items). Therefore, physical returns are not possible. Customers are entitled to a limited-time free trial to test and evaluate the products and services. Once the trial period ends, they can opt to purchase a prepaid monthly, quarterly, or yearly subscription.
Merchant Refund Policy / Offers All Product and Service subscriptions may be canceled, with refunds calculated on a prorated basis for the unused portion of the term. Customers subscribed to a long-term discounted plan may request a cancellation and refund. The refund amount will be calculated based on the standard monthly rate for the period used, less a €50 administrative and processing fee per cancellation.