Custom Time Zone Indicator: A Desk Clock For Sessions

Written by Dominic Walsh · Published · Last updated

The custom time zone indicator is a clock as much as a chart tool. It shades the three liquidity blocks, tracks the running high and low of each, and keeps a panel showing what time it is in three places at once.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 6: Asia high, Asia low, London high, London low, New York high, New York low
Alerts popup, push notification, email, sound
Inputs 38

What the Custom Time Zone Indicator draws on the chart

Six line plots carry the running high and low of each block, from `Asia high` through to `New York low`.

Boxes cover every session instance, one colour per block.

`InpShowZoneLabels` adds a name plate with the block range in pips.

The panel shows server time, GMT, your reference clock and a countdown.

  • Asia high: line, medium purple, width 1
  • Asia low: line, medium purple, width 1
  • London high: line, dodger blue, width 1
  • London low: line, dodger blue, width 1
  • New York high: line, orange, width 1
  • New York low: line, orange, width 1
Custom time zone indicator session blocks and clock panel on the EURUSD H1 chart.
Custom time zone indicator session blocks and clock panel on the EURUSD H1 chart.

How the Custom Time Zone Indicator calculates its values

MQL has no timezone database

The terminal clock is broker time, and nothing in the language reveals how far that sits from GMT. So `InpServerGmtOffset` `3` is an input, and every conversion derives from it.

Sessions live in GMT

You enter each block in GMT, with Asia at `InpAsiaStartGmt` `”00:00″` and London at `InpLonStartGmt` `”07:00″`. The code shifts those into broker minutes, wrapping cleanly through midnight.

Labels get placed in pixels

The code measures name plates in screen pixels rather than price. It then keeps them clear of the price scale, the one-click panel and each other. That is why they stay readable through a zoom or a scroll.

How to read the signals

The six buffers publish only while their block is open, so brackets break at each close.

A wide block range means that session did the work that day.

`InpRefGmtOffset` `0` sets the third clock to whatever zone you care about.

The countdown ticks every second, even when no price arrives.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` is the master switch and arrives true with `EnablePopup`. `EnablePushNotify` targets the MetaQuotes ID. `EnableEmail` needs mail set up in the terminal options. `EnableSound` plays `SoundFile`. A boundary reports once per bar.

Every Custom Time Zone Indicator input

Core settings

Setting What it does Default
InpServerGmtOffset Broker server offset from GMT in hours (+2 winter, +3 summer). Hours between broker time and GMT, default `3`. 3
InpRefGmtOffset Your own reference timezone offset from GMT in hours. Hours between your own reference clock and GMT, default `0`. 0
InpAsiaStartGmt Asia block open HH:MM GMT. Asia block open in GMT, default `”00:00″`. 00:00
InpAsiaEndGmt Asia block close HH:MM GMT. 09:00
InpLonStartGmt London block open HH:MM GMT. London block open in GMT, default `”07:00″`. 07:00
InpLonEndGmt London block close HH:MM GMT. 16:00
InpNyStartGmt New York block open HH:MM GMT. New York block open in GMT, default `”12:00″`. 12:00
InpNyEndGmt New York block close HH:MM GMT. 21:00
InpFillZones Solid fill (BACK stays false so it can never vanish). Fill those boxes solid, default `false`. off
InpDaysBack How many past session instances per block to draw. Past instances drawn per block, default `5`. 5
InpMaxTags Hard cap on session name plates drawn at once. Cap on name plates drawn at once, default `24`. 24
InpPriceScalePx Right margin owned by the price scale, in pixels. 62
InpOneClickWpx Width of the one-click trade panel zone, top-left. 260
InpOneClickHpx Height of the one-click trade panel zone, top-left. 100
InpX Panel X offset (px). 14
InpY Panel Y offset (px) – clears the one-click panel. 120

Display settings

Setting What it does Default
InpShowZones Draw a box around every session instance. Draw a box per session instance, default `true`. on
InpShowOpenLines Dotted vertical boundary on every session open. on
InpShowZoneLabels Name plate with the block name and its range in pips. on
InpMaxBars History bars scanned for session membership. 3000
InpAsiaColor Asia block colour. medium purple
InpLonColor London block colour. dodger blue
InpNyColor New York block colour. orange
InpAvoidPanel Keep the name plates clear of the info panel. on
InpLabelEdgePadPx Padding kept clear at the chart edges, in pixels. 10
InpShowPanel Show the clock and session panel. Show the clock and session panel, default `true`. on
InpCorner Panel corner (0=UL 1=UR 2=LL 3=LR). 0
InpFontSize Panel font size. 9
InpFont Panel font (monospaced keeps the columns square). Consolas
InpPanelBg Panel background (deep violet). RGB 18,8,28
InpBorderColor Panel border colour. medium purple
InpTextColor Panel body text colour. gainsboro

Alert settings

Setting What it does Default
EnableAlerts Master alert switch. on
EnablePopup Terminal popup alert. on
EnablePushNotify Push notification to the MetaQuotes ID. off
EnableEmail E-mail alert (configure Tools > Options > Email). off
EnableSound Play a sound file on a session boundary. off
SoundFile Sound file name inside terminal Sounds folder. alert.wav
Custom time zone indicator inputs panel with InpServerGmtOffset and the session times.
Custom time zone indicator inputs panel with InpServerGmtOffset and the session times.

Settings that fit your chart

Session work belongs on intraday charts. EURUSD H1 is the reference chart, where three blocks and five days of history fit without crowding. On M5 the boxes run off screen. Daily bars make session tracking pointless.

When the Custom Time Zone Indicator fails

`InpServerGmtOffset` `3` suits a summer GMT plus three server and needs changing in winter.

Daylight saving shifts real session hours, and no calendar ships here.

Five days of boxes plus name plates is a lot of objects on one chart.

Copy the compiled Custom Time Zone Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Custom Time Zone Indicator: Swap rate on Wikipedia, Bullish Percent Index Bpi at StockCharts ChartSchool.

Download the Custom Time Zone Indicator for MT4 and MT5

The zip holds the compiled Custom Time Zone Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What problem does InpServerGmtOffset solve?

Because MQL carries no timezone database. The terminal clock is broker time, and the language cannot tell you how far that is from GMT. Supplying it by hand is the only reliable way to place a session correctly.

What does InpRefGmtOffset 0 control?

The third clock on the panel, meaning your own reference zone. Set it to your local offset from GMT and the panel then shows broker time, GMT and your time together, which removes most session arithmetic.

What breaks when InpFillZones is true?

On some terminal builds a filled rectangle behind price vanishes entirely. Leaving fill off keeps the boxes as outlines, which always render. Switch it on only if your build handles it.

What does InpMaxTags 24 protect?

Chart readability. Five days across three blocks would place fifteen or more name plates, and each one needs measuring and de-overlapping. The cap keeps that work bounded and the chart legible.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Custom Time Zone Indicator as one input. Always backtest before trading live.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment