OPEN-SOURCE SCRIPT
Aktualisiert Futures Sessions with NY Opening Range, Levels, FVGs, & Holidays

This is a session-anchored intraday framework for futures. Every element on the chart is derived from the same session definitions, so the tools stay consistent with each other: the sessions paint the ranges, the completed ranges leave behind levels, the level lifecycle is tied to the session clock, the NY Opening Range anchors the morning, fair value gaps give context inside the ranges, and holiday markers explain the days when sessions are missing or shortened.
Session Ranges
Each market session is defined using IANA names (America/New_York, Asia/Tokyo) – never fixed UTC offsets. The indicator renders identically no matter what timezone your chart is set to (Exchange, New York, etc). Daylight saving is handled automatically: New York flips between EST and EDT on its own, and Tokyo has no DST, so its position against the New York clock simply shifts with the US clock changes (Tokyo's 9:00 open lands at 20:00 New York in summer, 19:00 in winter).
Each session is a shaded fill: Asia in red, London in yellow, New York in blue as defaults.
NY Pre-Open: a dotted range tracks the morning trade from the ORB open at 8:00 America/New_York until the session fill starts at 9:30. It is derived from the ORB input, so moving the ORB moves it too.
Globex Open: the CME futures trading day opens at 18:00 America/New_York (17:00 Chicago), indicated by the pre-open dotted range before the session fill starts at Tokyo open when volume comes in.
New York Opening Range (ORB)
The ORB captures the range of the America/New_York 8:00–8:15 candle, shown as a box with a dashed midline in maroon. It is visible on all smaller timeframes and up to 1h. The ORB ends on the last candle of the New York session — the end time is derived from the NY session input, so the two can never drift apart.
If the ORB range is oversized (18 or more points, configurable), the box is flagged with a red "ORB INVALID" label and shows the range in points.
Sessions Levels (Untested Highs and Lows)
When a session completes, its final highs (black) and lows (teal) are drawn from the candle and extend to the right indefinitely until a level is tested on its first touch. You can configure whether a test means a wick touch (ICT/liquidity style, the default) or a candle close beyond the level (support/resistance style).
Tested levels stay on the chart until the session running at the time of the test ends, so you can use them as points of reference until then. During the London/NY overlap, New York counts as the running session. A level tested during a session gap survives the gap and is handed to the next session that opens. At the NY ORB open at 8:00, all tested levels are removed to prevent clutter.
Untested levels never expire. You can toggle the prices on the price scale on or off based on preference.
Fair Value Gaps
Classic three-candle imbalances in both directions: bullish when a candle's low is above the high from two candles back, bearish when a candle's high is below the low from two candles back. Gaps are shaded in green (by default, configurable) from the middle candle and extend to the right until price trades fully through it (bullish: a low at or below the gap bottom; bearish: a high at or above the gap top), then it is removed. Each gap can draw its Consequent Encroachment — a dashed line at the 50% of the gap, the level where a gap is commonly considered mitigated. Inputs: fill color, CE toggle and color, minimum gap size in points (useful on low timeframes), and a cap on how many gaps are kept.
Holiday Markers
US (NYSE) holidays: a dotted vertical line and a Statue of Liberty marker anchored to the ORB's first candle. Detection is fully rule-based — weekday-observance rules for every holiday, and Good Friday computed from the Easter algorithm (Butcher's computus), so nothing is hardcoded and no yearly maintenance is needed.
Note: NYSE does not observe New Year's on the prior Friday when January 1 falls on a Saturday, and holidays observed on a Friday/Monday (like July 4 on a weekend) are marked on the actual closure day.
Japanese holidays: a dotted vertical line and a shrine marker anchored to the Tokyo session's first candle. Covers the fixed-date holidays, the Happy Monday holidays, both equinox holidays (astronomical formulas, valid through 2150), Monday substitute holidays, the occasional Silver Week citizens' holiday, and the TSE year-end closures (Dec 31, Jan 2, Jan 3).
Markers sit at the bottom of the pane. Days when CME is fully closed have no bars, so there is nothing to mark — markers appear on holidays with shortened or normal trading.
Alert
One built-in alert condition: Tokyo Range Break — fires when price closes outside the completed Tokyo session range, active from the Tokyo close until 11:30 New York time.
How to Use
Built for intraday charts of 1h and below (it draws nothing on higher timeframes). The ORB needs a 15-minute chart or lower to line up with whole candles. Defaults are tuned for CME index futures (ES/MES); the session inputs work on any symbol with continuous futures-style hours. Old drawings persist until Pine's 500-object limits trim the oldest.
These tools are combined because each one feeds the next: the sessions define the ranges, the completed ranges produce the levels, the level lifecycle runs on the session clock and the ORB open, the pre-open dotted ranges share the same derived timings, and the holiday markers explain the days when the rest of the framework is dark. Changing one session input moves everything that depends on it, consistently.
Session Ranges
Each market session is defined using IANA names (America/New_York, Asia/Tokyo) – never fixed UTC offsets. The indicator renders identically no matter what timezone your chart is set to (Exchange, New York, etc). Daylight saving is handled automatically: New York flips between EST and EDT on its own, and Tokyo has no DST, so its position against the New York clock simply shifts with the US clock changes (Tokyo's 9:00 open lands at 20:00 New York in summer, 19:00 in winter).
Each session is a shaded fill: Asia in red, London in yellow, New York in blue as defaults.
NY Pre-Open: a dotted range tracks the morning trade from the ORB open at 8:00 America/New_York until the session fill starts at 9:30. It is derived from the ORB input, so moving the ORB moves it too.
Globex Open: the CME futures trading day opens at 18:00 America/New_York (17:00 Chicago), indicated by the pre-open dotted range before the session fill starts at Tokyo open when volume comes in.
New York Opening Range (ORB)
The ORB captures the range of the America/New_York 8:00–8:15 candle, shown as a box with a dashed midline in maroon. It is visible on all smaller timeframes and up to 1h. The ORB ends on the last candle of the New York session — the end time is derived from the NY session input, so the two can never drift apart.
If the ORB range is oversized (18 or more points, configurable), the box is flagged with a red "ORB INVALID" label and shows the range in points.
Sessions Levels (Untested Highs and Lows)
When a session completes, its final highs (black) and lows (teal) are drawn from the candle and extend to the right indefinitely until a level is tested on its first touch. You can configure whether a test means a wick touch (ICT/liquidity style, the default) or a candle close beyond the level (support/resistance style).
Tested levels stay on the chart until the session running at the time of the test ends, so you can use them as points of reference until then. During the London/NY overlap, New York counts as the running session. A level tested during a session gap survives the gap and is handed to the next session that opens. At the NY ORB open at 8:00, all tested levels are removed to prevent clutter.
Untested levels never expire. You can toggle the prices on the price scale on or off based on preference.
Fair Value Gaps
Classic three-candle imbalances in both directions: bullish when a candle's low is above the high from two candles back, bearish when a candle's high is below the low from two candles back. Gaps are shaded in green (by default, configurable) from the middle candle and extend to the right until price trades fully through it (bullish: a low at or below the gap bottom; bearish: a high at or above the gap top), then it is removed. Each gap can draw its Consequent Encroachment — a dashed line at the 50% of the gap, the level where a gap is commonly considered mitigated. Inputs: fill color, CE toggle and color, minimum gap size in points (useful on low timeframes), and a cap on how many gaps are kept.
Holiday Markers
US (NYSE) holidays: a dotted vertical line and a Statue of Liberty marker anchored to the ORB's first candle. Detection is fully rule-based — weekday-observance rules for every holiday, and Good Friday computed from the Easter algorithm (Butcher's computus), so nothing is hardcoded and no yearly maintenance is needed.
Note: NYSE does not observe New Year's on the prior Friday when January 1 falls on a Saturday, and holidays observed on a Friday/Monday (like July 4 on a weekend) are marked on the actual closure day.
Japanese holidays: a dotted vertical line and a shrine marker anchored to the Tokyo session's first candle. Covers the fixed-date holidays, the Happy Monday holidays, both equinox holidays (astronomical formulas, valid through 2150), Monday substitute holidays, the occasional Silver Week citizens' holiday, and the TSE year-end closures (Dec 31, Jan 2, Jan 3).
Markers sit at the bottom of the pane. Days when CME is fully closed have no bars, so there is nothing to mark — markers appear on holidays with shortened or normal trading.
Alert
One built-in alert condition: Tokyo Range Break — fires when price closes outside the completed Tokyo session range, active from the Tokyo close until 11:30 New York time.
How to Use
Built for intraday charts of 1h and below (it draws nothing on higher timeframes). The ORB needs a 15-minute chart or lower to line up with whole candles. Defaults are tuned for CME index futures (ES/MES); the session inputs work on any symbol with continuous futures-style hours. Old drawings persist until Pine's 500-object limits trim the oldest.
These tools are combined because each one feeds the next: the sessions define the ranges, the completed ranges produce the levels, the level lifecycle runs on the session clock and the ORB open, the pre-open dotted ranges share the same derived timings, and the holiday markers explain the days when the rest of the framework is dark. Changing one session input moves everything that depends on it, consistently.
Versionshinweise
UPDATED: Dynamic London LevelsLondon's highs and lows no longer generate past NYSE open at 9:30 New York. The New York session will take over.
If London's high or low occurs at NYSE session open at 9:30 New York, the level will appear until the end of New York session and disappear after session end if tested.
FIXED: Fair Value Gaps Trimming and Gap Up/Downs
FVG detection now runs on pure 3-candle structure and ignores chart breaks; gap ups and gap downs create an FVG like any other candles do. Each gap draws exactly one box, anchored on the candle that created it, instead of stacked duplicates around big gaps.
When price trades partway into a gap and leaves, the part it filled is removed from the box; the shading always shows exactly how much of the gap is still open. Trading through the entire gap removes it completely. The CE midline stays at the original gap's 50%.
FIXED: Session Levels Disappearing
Only the levels furthest from the current price will drop if the number levels on the chart reaches 150 and new levels need to appear around current price.
Versionshinweise
UPDATED: Fair Value Gaps show only the unfilled portion and die at CEWhen price trades partway into a gap and leaves, the part it filled is removed from the box; the shading always shows exactly how much of the gap is still open. Once price trades beyond the gap's CE (the 50% of the original gap), the imbalance is considered rebalanced and the FVG is removed entirely. A gap can never shrink past its own midpoint.
NEW: Strong Levels
A session high or low that gets wick-tapped on two separate occasions without any candle ever closing beyond it is promoted to a Strong Level and recolored (maroon by default, configurable); wicks alone could not break it. Strong levels cannot be removed by wicks, even with the wick-touch test trigger: they persist through session ends and the 8:00 cleanup. Only a candle closing through a strong level breaks it — it loses its color and is then removed under the normal session rules.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.