High Low with Five Sessions - by Zephyros# High Low with Five Sessions - by Zephyros
High Low with Five Sessions is a configurable market-structure overlay that plots High and Low levels from five completed intraday sessions together with levels from completed Daily, Weekly, and Monthly periods.
The indicator is designed to keep important completed-range boundaries visible until price touches them for the first time. It does not generate buy or sell recommendations. The levels are reference points that can be used as additional context for liquidity analysis, market structure, reactions around previous extremes, or a trader's own entry and exit framework.
## What the indicator displays
The script tracks eight categories of completed High/Low levels:
- Asia session
- London session
- NYM session
- NYAM session
- NYPM session
- Previous completed Daily period
- Previous completed Weekly period
- Previous completed Monthly period
The five intraday sessions are fully configurable. Each session has separate inputs for start time, end time, lookback, line colors, line widths, labels, and line visibility.
## Default session settings
The default session time zone is `America/New_York`.
Default session intervals:
- Asia: 20:00-23:59
- London: 02:00-05:00
- NYM: 07:00-09:00
- NYAM: 09:30-12:00
- NYPM: 13:30-16:00
The Asia session ends at `23:59` instead of `00:00` so that the default interval remains inside one calendar day in the script's hour-and-minute session model. Session end times are exclusive, which means a bar whose opening time is exactly equal to the configured end time is not included in that session.
Custom session intervals should therefore begin and end within the same calendar day. Overnight intervals that cross midnight are not supported by this version.
## Time-zone selection
The `Session Time Zone` setting uses a drop-down list of common time zones. The selected value applies to:
- calculation of all five custom sessions;
- the daily reset of crossing counters;
- the daily reset of accumulated crossing flags.
The default IANA time zone, `America/New_York`, automatically follows daylight-saving-time changes. Other IANA locations in the list behave in the same way. `UTC` uses a fixed UTC clock.
The selected custom-session time zone does not redefine the Daily, Weekly, or Monthly candles. Those levels continue to use the standard periods supplied by the exchange or data source for the current symbol.
## How session levels are calculated
While a custom session is active, the script records the highest High and lowest Low of the chart bars that open inside the configured interval.
The level pair is created only after the session has fully ended:
- Session High = highest High recorded during the completed session.
- Session Low = lowest Low recorded during the completed session.
The indicator does not display developing session High/Low levels before the session closes.
Session calculations use the bars of the current chart timeframe. They do not request a separate lower-timeframe data set.
## Daily, Weekly, and Monthly levels
Daily, Weekly, and Monthly levels are taken only from fully completed standard periods of the current symbol:
- Daily High/Low = High and Low of the previous completed Daily period.
- Weekly High/Low = High and Low of the previous completed Weekly period.
- Monthly High/Low = High and Low of the previous completed Monthly period.
The script requests the preceding closed period, so these reference values do not use the developing High or Low of the current Daily, Weekly, or Monthly candle.
## Historical anchoring and level availability
Every level becomes active only after its source session or standard period has fully closed.
For visual context, the script anchors each completed-session line to the start bar of that session. Daily, Weekly, and Monthly lines are anchored to the start time of their completed source period. As a result, part of each line is drawn retrospectively across the range from which the High or Low was calculated.
That historical segment does not mean the final level was known in real time at the beginning of the session or period. First-touch tracking starts only after the level is created, and the script does not count price interactions that occurred while the source session or period was still forming.
## Timeframe hierarchy
The indicator avoids reconstructing lower-period levels inside larger chart candles.
The period hierarchy is:
- Seconds and intraday charts: Session + Daily + Weekly + Monthly calculations. Session lines are displayed only below 60 minutes.
- Daily chart: Daily + Weekly + Monthly.
- Weekly chart: Weekly + Monthly.
- Monthly chart: Monthly only.
On multi-period chart timeframes larger than a source period, the smaller source period is excluded. For example, Daily levels are not processed on a 2-day chart, Weekly levels are not processed on a 2-week chart, and Monthly levels are not processed on chart timeframes above one month.
## Session-line visibility by timeframe
Session lines and session labels are automatically hidden on chart timeframes of 60 minutes or higher. Session calculations and hidden crossing outputs continue to run from the current chart bars.
On 30-minute and 45-minute charts, a chart candle can overlap a configured session boundary. In that situation, the session High or Low can include the full High or Low of that chart candle. For the most precise session boundaries, use a timeframe whose bars align with the configured start and end times.
## First-touch crossing logic
Each completed level is active until its first touch.
A High level is considered crossed when:
`Current bar High >= level price`
A Low level is considered crossed when:
`Current bar Low <= level price`
Only the first touch of each individual level is counted. Repeated touches of the same level are ignored.
If one candle touches several previously active levels, each level is counted separately. For example, if one candle first touches three High levels, `High Crosses Today` increases by three.
## Crossed-line behavior
The `Delete Crossed Lines` setting controls what happens after the first touch:
- Disabled by default: the line stops at the first-touch bar and remains visible as a completed historical fragment.
- Enabled: the crossed line is removed from the chart.
The `Show High/Low Lines` setting inside each group controls visual display only. Disabling a line group does not disable its level calculations, first-touch tracking, daily flags, counters, or hidden outputs when that category is permitted on the current chart timeframe.
## Lookback Bars
Each level group includes a `Lookback Bars` setting.
It defines the maximum age, measured in bars of the current chart timeframe, for an uncrossed level to remain active and eligible for first-touch processing. The default and maximum value is 5000 bars.
Once a level is crossed, it is removed from active tracking. If `Delete Crossed Lines` is disabled, its truncated line can remain visible until TradingView removes older drawing objects under the platform's drawing limits.
## Labels and debug information
Normal level labels are disabled by default and can be enabled separately for each session or period group.
`Show Debug Information` is also disabled by default. When enabled, it displays:
- a label at each detected first touch;
- a table containing daily counters and flags;
- the number of currently active tracked High/Low levels;
- the current priority values used by the hidden classification outputs.
Debug information is intended for inspection and integration testing, not as a trading recommendation.
## Hidden outputs
The script includes hidden plots for use in the Data Window, data export, or integration with other Pine Script tools.
### Daily accumulated flags
Each flag resets at the beginning of a new calendar day in the selected `Session Time Zone`. After the first qualifying touch during that day, the corresponding flag becomes `1` and remains `1` until the next daily reset.
- `Asia High Cross Flag`
- `Asia Low Cross Flag`
- `London High Cross Flag`
- `London Low Cross Flag`
- `NYM High Cross Flag`
- `NYM Low Cross Flag`
- `NYAM High Cross Flag`
- `NYAM Low Cross Flag`
- `NYPM High Cross Flag`
- `NYPM Low Cross Flag`
- `Daily High Cross Flag`
- `Daily Low Cross Flag`
- `Weekly High Cross Flag`
- `Weekly Low Cross Flag`
- `Monthly High Cross Flag`
- `Monthly Low Cross Flag`
### Daily crossing counters
- `High Crosses Today` = number of individual active High levels first touched during the current selected-time-zone day.
- `Low Crosses Today` = number of individual active Low levels first touched during the current selected-time-zone day.
### Per-bar priority outputs
The following values describe only first-touch events detected on the current bar:
- `ZEP_HL_HIGH_STRENGTH`
- `ZEP_HL_LOW_STRENGTH`
- `ZEP_HL_SIGNAL`
The word `STRENGTH` is retained for compatibility with the output names, but the value is a predefined category priority, not a statistically measured signal strength:
- `1` = custom intraday session level;
- `2` = Daily level;
- `3` = Weekly or Monthly level.
`ZEP_HL_HIGH_STRENGTH` returns the highest High-side priority touched on the current bar.
`ZEP_HL_LOW_STRENGTH` returns the highest Low-side priority touched on the current bar.
`ZEP_HL_SIGNAL` is classified as follows:
- positive value = the strongest current-bar event is a Low-level touch;
- negative value = the strongest current-bar event is a High-level touch;
- `0` = no event, or equal highest priorities occurred on both sides of the same bar.
These values are technical classifications. They are not independent long or short signals.
## Basic usage
1. Add the indicator to a time-based chart.
2. Select the time zone used for the five custom sessions.
3. Adjust the five session intervals when required.
4. Choose which line groups and labels should be visible.
5. Use the extended High/Low levels as contextual references.
6. Observe the first interaction between price and each active level.
7. Combine the information with an independent method such as market structure, price reaction, volume, volatility, or risk-management rules.
## Originality
This is an original implementation by Zephyros.
Its purpose is not simply to display a single previous High or Low. The script combines:
- five independently configurable completed sessions;
- a selectable session time zone with daily state resets;
- completed Daily, Weekly, and Monthly reference levels;
- timeframe-aware period hierarchy;
- first-touch-only lifecycle management for each individual level;
- separate visual and calculation states;
- accumulated daily flags and counters;
- per-bar priority outputs for external integration.
The script is published with open source code so users can inspect, verify, modify, and study its calculations.
## Limitations
- The plotted levels are historical reference points, not predictions.
- A touch of a High or Low does not guarantee a reversal, continuation, liquidity sweep, or profitable trade.
- The indicator does not open positions, place orders, calculate position size, set stop-losses, set profit targets, or provide strategy-test results.
- Custom sessions are calculated from the current chart bars. Boundary precision therefore depends on the selected timeframe and its bar alignment.
- Custom session intervals that cross midnight are not supported.
- Missing market data or exchange closures can reduce the number of bars available inside a session.
- Daily, Weekly, and Monthly boundaries depend on the standard periods supplied for the selected symbol by its exchange or data provider.
- The current open bar can trigger a first touch as its High or Low develops.
- The script is intended for time-based charts. Non-time-based chart types can produce unavailable timeframe classifications or behavior that does not match the intended session model.
- TradingView limits the number of line and label drawings maintained by one script. The indicator requests the platform maximum of 500 lines and 500 labels, but older visual objects can still be removed automatically when those limits are reached.
- Hidden priority values are deterministic category codes, not statistical confidence scores.
- The indicator should not be used as the sole basis for a trading decision.
Chỉ báo






















