Updated

Grandoc's MTF Separators

664
What it is
This indicator draws vertical lines at the day, week, month and year opens, plus the open and close of the five main forex sessions: Sydney, Tokyo, Frankfurt, London and New York. It can also box each session's high and low, and the last 30 minutes before each session closes (the "closing range").

What is different about it
Most period separators use the exchange's day, or one fixed time zone for every session. Then the lines move by an hour whenever a country changes its clocks, and you have to go back into the settings to fix them. This script works differently:
  • The trading day starts at 09:00 Sydney time. This is the day roll used here, and the hour can be changed. The week, month and year also start at a Sydney open. The week starts on the Sunday evening (European/African time) Sydney open, the first open of the forex week.
  • Each session is read on its own city clock: Sydney (Australia/Sydney), Tokyo (Asia/Tokyo), Frankfurt (Europe/Berlin), London (Europe/London) and New York (America/New_York). Each city changes for daylight saving on its own date, so the lines move on the right day without any input from you. For example, in late October London's open moves from 08:00 to 09:00 on a Lagos clock, while it stays at 08:00 on a London clock.
  • The lines use the real moment in time, so they land in the right place whatever time zone the chart is set to. Changing the chart's time zone, or the season, gives nothing to readjust.


How it works
  • Period opens: on each candle the script finds the 09:00 Sydney open of that Sydney date and decides which Sydney trading day the candle belongs to. A line is drawn on the first candle at or after a new open. A new week is a new Sydney Monday. A new month or year is the first Sydney open in that month or year. Broker candles that print before 09:00 Sydney on Monday morning do not create a false open. When several periods open on the same candle, only the biggest one is drawn (Year, then Month, Week, Day), so lines do not stack.
  • Sessions: each session's hours are checked on its own city clock, Monday to Friday in that city. An open line goes on the first candle inside the session. A close line goes at the end of the last candle inside it.
  • Session box: starts at the session open, grows candle by candle while the session runs, and shows the session's highest and lowest price.
  • Closing range: the same idea for a short window you choose, by default the last 30 minutes before each session closes. The box shows the high and low traded in that window.
  • Written in Pine Script v6. The script uses only the chart's own candles. It requests no other data and has no lookahead. Lines and boxes on past candles do not change. Only the box of a session that is still running keeps growing until that session ends.


How to use it
Add it to an intraday chart (1 to 60 minutes works best for sessions). Use the day, week, month and year lines to see where each period starts. Use the session lines to see which market is open. Turn on the session boxes or closing ranges when you want the high and low of a session or of its final minutes as reference levels. Each session has its own master switch, so you can show only the sessions you follow.

Settings
  • General: Day open hour and minute on the Sydney clock (default 09:00). "Hide session lines/boxes/closing ranges above" a chart timeframe in minutes (default 60). "Sessions to keep" sets how many past sessions keep their drawings (default 20).
  • Day / Week / Month / Year open: show, colour, width, style (solid, dashed, dotted) and lookback (how many past lines to keep). Defaults: Day white dotted 1, Week green dashed 2, Month red solid 3, Year purple solid 3. The solid lines default to 60% transparency.
  • Each session (Sydney, Tokyo, Frankfurt, London, New York):
    - Show (master switch for everything in that session)
    - Hours in that city's local time. Defaults: Sydney 09:00-18:00, Tokyo 09:00-18:00, Frankfurt 08:00-17:00, London 08:00-17:00, New York 08:00-17:00.
    - City time zone (leave as is so daylight saving is automatic)
    - Line colour
    - Open line: on/off, width, style
    - Close line: on/off, width, style
    - Session box: on/off, colour, fill transparency, border width
    - Closing range: on/off, window in local time (default last 30 minutes, e.g. 16:30-17:00 for London), colour, fill transparency, border width


Limitations
  • Session lines, session boxes and closing ranges are hidden on charts above 60 minutes by default. On bigger candles a session or a 30-minute window cannot be drawn accurately. You can raise this limit, but the results will be rough.
  • Lines can only sit on a candle. On higher intraday timeframes such as 4 hours, the day open lands on the first candle that starts at or after 09:00 Sydney, which can be up to a few hours after the true open.
  • On daily and higher charts the day line is not drawn, and week, month and year opens are judged by each candle's close time.
  • TradingView allows at most 500 lines and 500 boxes per script. Lookback and "Sessions to keep" values are capped so the drawings stay within this.
  • Sessions run Monday to Friday. Public holidays and early closes are not handled separately. If a market has no candles at an open time, the line goes on the next candle.
  • The Sydney session open falls on the same candle as the day open. Turn off the Sydney open line if you only want one line there.
  • This is a visual time reference. It gives no buy or sell signals and makes no prediction.


Credits
This script started from sbtnc's open-source "Multi-Timeframe Period Separators" (Mozilla Public License 2.0). Thanks to sbtnc for the original. It was rewritten and extended: the opens are anchored to the Sydney open with a Sunday-evening week, each of the five sessions follows its own city clock with automatic daylight saving, each session has its own line settings and master switch, and session high/low boxes and editable closing-range boxes were added. Published open-source under the same license.

This indicator is built with HORC(Hendray's Open Range Concept) traders in Mind
Release Notes
v2.4: Day, week, month and year opens now follow London time

The day, week, month and year opens are now set at 23:00 London time and follow London's daylight saving (GMT/BST) only:
  • While London is on summer time (BST, last Sunday of March to last Sunday of October), the open is at 23:00 Lagos time, which is 22:00 UTC.
  • While London is on winter time (GMT, last Sunday of October to last Sunday of March), the open is at 00:00 Lagos time, which is 23:00 UTC.

The switch happens automatically on London's clock-change dates. The next one is Sunday 25 October 2026: from that evening the open moves from 22:00 UTC to 23:00 UTC (from 23:00 to 00:00 Lagos). It moves back in late March. You don't need to change anything. It works the same whatever time zone your chart is set to and on any timeframe.

The week still starts at the Sunday evening open, the first open of the forex week. Early broker candles on Sunday before that open still do not create a false open.

Sessions are unchanged. Sydney, Tokyo, Frankfurt, London and New York each still follow their own city clock and daylight saving.

The "Day open hour" setting is now on the London clock (default 23:00). If you had changed it before, please check it once after updating.
Release Notes
v2.4.1: Refreshed the chart preview image. No behaviour change; v2.4 rules still apply (day, week, month and year opens at 23:00 London time, switching automatically with London's GMT/BST daylight saving).
Release Notes
v2.4.2 - "Closing ranges only" switch

What's new
- One new setting at the top, under General: "Closing ranges only".
- Tick it to see just the 30-minute closing range boxes for every session. All session open lines, close lines and session boxes are hidden in one click.

How to use
- Open the indicator settings, Inputs tab, General group, and tick "Closing ranges only".
- Each session's own "Show" and "Closing range" switches still apply, so you can still turn off a session or its closing range individually.
- Untick it to go back to your normal session settings.

Nothing else changed
- Day, week, month and year separators, session times and closing range windows work exactly as before. The new switch is off by default, so existing charts look the same.
Release Notes
v2.4.2: preview image refreshed to show the weekly separators, session open lines and closing ranges together. No changes to how the indicator works.

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 TradingView. Read more in the Terms of Use.