World Sessions & Countdown [AFD]
Which session is actually running right now, and how many bars are left in it?
Every session tool on the shelf draws the same coloured stripes. Almost all of them are built on a fixed UTC offset, which means twice a year they are quietly an hour wrong and nothing on the chart says so. The highest-profile clock script in the niche states plainly in its own description that it requires manual UTC offset adjustment at each changeover.
World Sessions is anchored to IANA time zone names instead - Europe/London, America/New_York, Asia/Tokyo, Australia/Sydney. Each window follows its own city's daylight-saving policy, on its own, with nothing for you to adjust. The script draws a rectangle around each session's own bars rather than a full-height stripe, a separate rectangle wherever sessions overlap, and a dashboard that tells you what time it is in all four cities and how much of the
current session is left.
Why the time zone thing matters
14 January - London GMT, New York EST - overlap 15:00-17:00 UTC, two hours.
25 March - London BST, New York EDT - overlap 14:00-17:00 UTC, three hours.
15 July - London BST, New York EDT - overlap 14:00-16:00 UTC, two hours.
28 October - London GMT, New York EDT - overlap 14:00-17:00 UTC, three hours.
A fixed-offset script prints one identical row for all four. The late-October row is the one that bites: Europe has left summer time and the United States has not, so the two cities are five hours apart instead of the usual four, and every band built on a captured offset is an hour wrong for that week.
This is a statement about how the script resolves time. It says nothing about volatility, liquidity, or what you should do with any of it.
At a glance
Session boxes - one rectangle per session RUN, spanning that run's own high and low, not a full-height stripe.
Overlap box - a separate rectangle over the bars two or more sessions share, carrying its own composite name.
IANA time zones - each session follows its own city's daylight-saving policy, with no UTC offset to maintain.
Bars left in session - not minutes, BARS, on your current timeframe.
Dashboard - each session's hours, its city's live clock, an open/closed dot, a progress bar, and the countdown to its next boundary.
Five sessions - Sydney, Tokyo, London, New York, and one Custom slot of your own.
New York hours - regular, extended-equities, or CME Globex, chosen automatically from the symbol or forced by hand.
Eight alerts - four session opens, all sessions closed, overlap start, N seconds to bar close, and last bar of session.
Appearance - fill, four gradient depths in two directions, border transparency, width and style, or outline-only.
One box per run, not one box per chart
A session's rectangle is bounded by that session's run, identified by the instant that run closes, and not by a stretch of bars on which the session happened to be live. The distinction is not academic. On a regular-hours US chart every bar is inside New York's 09:30-16:00 window, so a liveness-based tool never sees New York stop being live: it opens one rectangle on the first
bar of history and never closes it, washing the entire chart in one color. This product drew exactly that defect once, and the lifecycle is now keyed on the run instead. You get one box per day, with clean gaps between them.
A box is a session's EXTENT, not a level. It has a top and a bottom and that is where the resemblance to a zone tool stops - no line is drawn at either edge, no edge is labelled or alerted with a price, and nothing downstream reads one.
The overlap box
Two or more enabled sessions running at once get their own rectangle over the shared bars, spanning the high and low of those bars only, and it carries the name of the sessions that actually made it - TOKYO + LONDON, LONDON + NEW YORK.
One color at any depth, deliberately: Sydney, Tokyo and London genuinely stack three deep, and a per-pair colour scheme has no honest answer for a three-way overlap.
Overlap only is the shipped default, so out of the box the chart draws the overlap rectangle and nothing else. On a chart with no overlap running that means no rectangles at all - the intended state, not a fault. Set Overlap to Highlight overlap to see every session box alongside it, or Off for session boxes with no overlap rectangle.
Every session is named exactly once. Where the overlap box is drawn it carries the joint name, so a session's own name centres on the bars it held ALONE. A session that is never alone shows no separate name, because it has already been named.
The dashboard
Per session - a colour chip, the name, an open/closed dot, that session's own hours, the current wall clock in its city (marked +1 or -1 when the city is on another date), a progress bar, and OPENS IN or CLOSES IN to its next boundary. The open session's row is tinted in its own color and its name set bold.
Two kinds of time, on purpose - LOCAL, the dot, PROGRESS and NEXT are real-world clock readings and stay current on a weekend, on a scrolled-back chart, and in Bar Replay. BAR CLOSE is a property of the bar in front of you and shows an em dash on anything but a genuinely live bar, because a countdown to the close of a bar that has already closed cannot mean what it says.
BARS LEFT keeps counting where BAR CLOSE cannot, because one is a bar-structure count and the other is a clock reading. It names the session it is following. Both step green, then amber, then red as they run out.
The progress column always says something - the bar while a session runs, Not in session while it is closed, and No bars here when that session's window has no bars at all on the symbol you are looking at. Tokyo on a US regular-hours chart is the common case.
Position, background, grid lines, the outer frame and its width, one text size for the whole panel, and progress-bar width are all settings. The frame's Countdown mode makes it the same green-amber-red traffic light BARS LEFT carries.
Weekdays are digits, and the rule has a trap in it
Weekdays live in a field of their own, because input.session() renders two clock fields and no weekday picker. 1 is Sunday through 7 is Saturday, so the shipped '23456' is Monday to Friday.
They are not optional. A session string without them applies to EVERY day of the week - invisible on a stock chart, but on a 24/7 symbol it draws a London box straight through Saturday.
For a session that runs past midnight, the digits name the day it ENDS. PulseWire's own documented example is 1700-1700:23456, in which the Monday session starts Sunday at 17:00 and ends Monday at 17:00. So the CME Globex window here is 1800-1700 with the ordinary 23456 - Sunday evening through Friday afternoon, five sessions, the real Globex week. The intuitive-looking 12345 invents a Saturday-evening session that never trades and loses Thursday evening entirely.
Alerts
Sydney session open
Tokyo session open
London session open
New York session open
All sessions closed
Session overlap start
N seconds to bar close - the threshold is a user input, and 0 turns it off
Last bar of session - off by default
Create these from PulseWire's alert dialog. How often an alert re-fires while
its condition holds is set in that dialog, not in the script.
How to use it
Add it to an INTRADAY time-based chart. Boxes and session names need an intraday timeframe; the dashboard works on any timeframe, because its countdowns read the wall clock.
Leave Overlap on Overlap only for the overlap rectangle alone, or switch to Highlight overlap to see every session.
Turn off the sessions you do not follow. Set hours and weekday digits to match what you actually trade.
On a futures contract, check the New York hours group is on extended hours if the Globex window is the one you want boxed. Auto by symbol handles this for you on a real futures contract.
Everything else - fill, gradient depth and direction, border style, boxes kept, panel appearance - is a setting to configure once to taste.
What it deliberately does not do
It draws no zone and publishes no session high or low as a level. It offers no fixed UTC offset option, because a dropdown reading UTC-5 would let you silently break the one thing the product is for. It gives no arrows, no signals, and nothing about what price will do during any session. Educational chart context, not financial advice.
Data, timeframes and repainting
The script uses current chart data only. There are no request.security() calls, no higher-timeframe imports, and no lookahead of any kind.
A running session's box updates as new highs and lows print on the forming bar, and its right edge advances with the chart; it is final once that session's run has ended. Confirm the behaviour with the bar-replay tool on your own chart and timeframe before relying on it.
The dashboard's clock columns advance per tick. Pine provides no timer, so on a closed market - where no tick arrives - they hold at the last moment the script executed rather than ticking on by themselves. Scrolling, zooming, or changing any setting re-executes the script and brings them current. This is platform behaviour, not a setting.
Boxes and session names are intraday-only. On a daily or higher chart a session window is shorter than one bar, so they are not drawn.
Drawing history is bounded by Pine's limits. The source declares budgets of 500 boxes and 500 labels, and Session boxes kept is trimmed automatically to stay inside the box ceiling - a faded session costs one box per gradient step plus its outline.
Standard time-based candles. The session arithmetic reads chart time.
A running alert keeps the inputs, symbol and timeframe it was created with - recreate an alert after changing any of them.
Originality and credit
Other session tools draw stripes on a fixed offset. This one bounds each session run by its own high and low, names the overlap for the sessions that actually made it, resolves every window through an IANA time zone so it holds across daylight saving, and reports the one number the shelf does not carry - how many bars are left in the session you are in, on the timeframe you are on. Open source under the Mozilla Public License 2.0. (c) Auction Foundry.
Disclosure: this indicator describes session structure and elapsed time on the current chart. It is not a forecast, a signal, or financial advice.
Indicator






