PulseHub
OPEN-SOURCE SCRIPT
Updated

Session Range Completion Clock

210
This indicator measures WHEN, inside a chosen intraday session, that session's range is actually
built. It answers a question that session tools normally skip: by a given time of day, how much of
the day's eventual range is typically already spent, and has the extreme that will define the day
usually already printed?

It draws no levels, marks nothing on price, and produces no signals. It is a measurement
instrument that reports descriptive statistics over the sessions in your loaded history.

THE UNDERLYING PRINCIPLE

A session's range is not built at a constant rate, and how it is built differs by symbol, by
session and by contract. The script assumes nothing about the shape - it measures it on whatever
instrument and window you point it at.

"How much range is left" and "is the extreme already in" are two different statistics, and the
script keeps them separate. For every completed session in the loaded history it records the
running high and low at the end of each time bucket, then waits for the session to close so the
FINAL range is known. It then attributes, for each bucket:

- the fraction of the final range that had been traversed by the end of that bucket;
- whether the session's high had already been made at or before that bucket;
- whether the session's low had already been made;
- whether both were already in place, meaning the range was finished and everything afterwards
happened inside it;
- the traversed range expressed in units of daily ATR or of the previous day's range, which makes
the figure comparable across volatility regimes.

These are accumulated across sessions and reported as means and frequencies.

HOW TO READ THE TABLE

The table is drawn once, on the last bar of the chart. Each row is a point in time, labelled with
the clock time at the end of that bucket.

"n" is the number of sessions contributing to that row. "Range built" is the mean percentage of
the session's final range already traversed. "High set" and "Low set" are the percentage of
sessions in which that extreme was already established. "Both set" is the percentage of sessions
in which the entire range was already complete; that column is shaded by value. "Range/unit" is
the mean range so far in the normalization unit selected in the inputs, which is named in the
bottom-right cell.

If the session contains more buckets than the row limit, buckets are sampled at an even stride so
the table still ends on the session's final bucket.

The pane also plots two lines during a live session: the current session's range so far, and the
mean range so far of all prior qualifying sessions at the same point in the session, both in the
same unit. That is a like-for-like comparison at equal elapsed session time. It is not a
projection and the script does not extend either line forward.

On a daily or higher chart the table prints a message instead of statistics: the whole measurement
is defined on intraday bars and there is nothing to compute.

WHAT IT DOES NOT DO

It does not predict where price will go, does not identify breakouts, and does not mark levels. A
high "Both set" figure at a given time means only that historically, on this symbol and this
session, the range was usually already complete by then. It is a frequency over past sessions, not
a statement about today, and nothing in the script says whether acting on it would be a good idea.

METHOD, AND WHY IT DOES NOT REPAINT

A session is folded into the statistics only after it has closed, so the session in progress never
contributes to its own statistics.

Historical values are never recalculated. The statistics accumulate forward in time, which means
the historical-mean line on early bars was computed from a smaller sample than the same line on
recent bars. That is deliberate; the alternative would be a curve that silently rewrites its own
past.

The daily normalization unit comes from a single bundled request on the daily timeframe. The
requested expression is offset by one bar and the request uses lookahead, which is the pair the
Pine Script documentation specifies for confirmed higher-timeframe values: the offset discards the
daily bar that is still forming and returns the one before it, which was already final. Historical
and realtime bars therefore receive the same value. This matters more here than it looks, because
the unit is latched once at session start and then used for that whole session - a unit that
differed between live and reloaded charts would give a session two different "Range/unit" figures
depending on when you looked at it.

Time buckets are anchored to the declared session start time rather than to the first bar
observed. This keeps the time-of-day axis stable on illiquid symbols, on sessions that run through
midnight, and on continuous 24-hour sessions where there is no gap between sessions to detect. A
session string containing more than one range, such as 0900-1130,1230-1500, is treated as a single
window running from the first start to the last end; buckets falling inside the break carry the
pre-break state forward, which is what you want, because the range does not reset over lunch. An
optional day mask such as 0930-1600:23456 is respected.

SETTINGS

Session and Session time zone define the window. Use the exchange's own time zone so buckets stay
aligned across daylight-saving changes.

Bucket size should be a multiple of the chart timeframe. A bucket narrower than the chart
timeframe contains no bars of its own and simply carries the previous bucket's state forward.

Minimum session completeness excludes half-days, early closes and partially loaded history, which
would otherwise depress the late-session figures. Lower it if a market you are studying
legitimately has short sessions.

Normalise range by chooses between daily ATR and the previous day's range. ATR is smoother; the
previous day's range reacts faster.

ORIGINALITY

The session and time-of-day category on this platform is overwhelmingly made of level-drawing
tools: opening-range boxes, session high/low lines, session shading. Those draw where. Very little
published measures when, and the two are different objects - this script plots nothing on price at
all.

There is a small existing family of scripts that chart the distribution of the hour at which the
daily high or low prints, and the "High set" and "Low set" columns overlap with that idea. This is
not a reskin of any of them: the accumulator here is cumulative by elapsed session time rather
than a histogram of one timestamp, it is folded only on session close, it is keyed to a
user-supplied session string with mid-session-break handling and a day mask, and it is combined
with final-range-fraction and volatility normalization. No code is borrowed from any published
script.

LIMITATIONS

Requires an intraday chart timeframe.

The sample is whatever history the chart has loaded, which on lower timeframes may be only a few
hundred sessions - check "n" before reading anything into a row.

Results are sensitive to the chart timeframe, because the exact bar on which an extreme prints is
resolution-dependent. Coarser timeframes will place extremes in later buckets than they truly
occurred.

The "Range/unit" column can be based on a smaller sample than the percentage columns, because the
earliest sessions in the loaded history have no completed daily bar to normalize against and are
skipped for that column only.

Sessions spanning a daylight-saving transition can be misattributed by one hour for a single day.

On non-standard chart types - Heikin Ashi, Renko, Kagi, Point and Figure, Range - the highs and
lows are synthetic, so the statistics describe the synthetic series rather than traded prices.

The statistics describe the loaded history only and carry no assumption that the distribution is
stable over time.

Source is open and commented.
Release Notes
The statistics table now draws on the price pane instead of inside the indicator's own pane, where the two comparison plots ran straight through it. The footer is also one labelled line rather than seven unlabelled values that read as an eighth row of statistics — the numbers in it are settings, not results. No change to any calculation.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.