Dynamic Global Exchange Sessions

Please test and send me a message or leave a comment if the indicator doesn't automatically adjust the session starts and ends to your broker's server time. The indicator has been tested on Admirals Europe and IC Markets Europe.


Global Exchange Sessions

Global Exchange Sessions is an MQL5 indicator that marks the regular trading hours of the world’s main stock exchanges directly on your chart.

Each session is shown as a colored rectangle. The rectangle starts at the official market open and ends at the official market close. Its upper and lower edges follow the session high and low as new prices arrive.

This makes it easy to see when major equity markets are active, where each session formed its range, and how price reacted when sessions overlapped.

Included exchanges

The indicator supports six stock exchanges:

  • New York Stock Exchange — NYSE

  • London Stock Exchange — LSE

  • Shanghai Stock Exchange — SSE

  • Tokyo Stock Exchange — TSE

  • Hong Kong Stock Exchange — HKEX

  • Euronext

Each exchange can be enabled or disabled separately.

By default, the indicator displays:

  • NYSE

  • London Stock Exchange

  • Shanghai Stock Exchange

Tokyo, Hong Kong, and Euronext are included but disabled by default. You can enable them from the indicator inputs at any time.

Regular session hours

The indicator uses the following regular cash-market hours:

  • NYSE: 09:30–16:00 New York time

  • London Stock Exchange: 08:00–16:30 London time

  • Shanghai Stock Exchange: 09:30–15:00 Shanghai time

  • Tokyo Stock Exchange: 09:00–15:30 Tokyo time

  • Hong Kong Stock Exchange: 09:30–16:00 Hong Kong time

  • Euronext: 09:00–17:30 Central European time

Automatic broker-time conversion

You do not need to calculate the difference between exchange time and broker time.

The indicator reads the broker’s current server time and compares it with GMT. It then converts each exchange session into the time used by your chart.

This is useful because MetaTrader brokers do not all use the same server time. One broker may use UTC, another may use UTC+2, and another may change its server offset during daylight saving time.

Three broker-time modes are available.

Auto Current Offset

This is the default mode.

The indicator calculates the current broker offset from:

TimeTradeServer() - TimeGMT()

The detected offset is used for all displayed sessions.

This mode is suitable when you mainly use the current day or when your broker keeps a fixed UTC offset.

Auto European DST

This mode detects the current broker offset and applies a European daylight-saving schedule to historical dates.

It is useful for brokers that change their server time according to European summer-time rules.

Use this mode when older session rectangles shift by one hour after a daylight-saving change.

Manual Fixed Offset

This mode lets you enter the broker’s UTC offset in minutes.

Examples:

  • UTC: 0

  • UTC+1: 60

  • UTC+2: 120

  • UTC+3: 180

  • UTC-5: -300

This mode is useful when the automatic result does not match your broker or when you use a broker with a fixed server offset.

Exchange daylight saving time

The indicator calculates daylight saving time separately for the exchanges that use it.

It includes:

  • US daylight saving time for NYSE

  • UK daylight saving time for the London Stock Exchange

  • European daylight saving time for Euronext

Shanghai, Tokyo, and Hong Kong use fixed UTC offsets because these locations do not currently change their clocks during the year.

This separate calculation is important during the weeks when the United States and Europe change their clocks on different dates.

Dynamic session highs and lows

The rectangle is not based on a fixed price height.

When a session starts, the indicator reads the price bars inside that session. It finds the highest high and the lowest low, then uses those values as the top and bottom of the rectangle.

While the session is active:

  • A new session high moves the upper edge higher.

  • A new session low moves the lower edge lower.

  • The rectangle keeps its official opening and closing times.

  • The range updates as new price data arrives.

After the session closes, the completed high and low remain visible for the selected history period.

The default calculation timeframe is M1. This gives the indicator a more precise session range, even when it is attached to a higher chart timeframe.

You can change the calculation timeframe if you want to reduce the amount of historical data that MetaTrader must load.

Transparent-style session fills

Each session uses two separate rectangles:

  • A soft background fill

  • A clear foreground border

The fill color is blended with the current chart background. This produces a transparent-style result on both dark and light chart themes.

The default fill opacity is 22%.

You can change the opacity from 0 to 100:

  • 0 makes the fill fully hidden.

  • Lower values create a softer session area.

  • Higher values make the session color stronger.

  • 100 uses the full selected fill color.

The border is not affected by the fill opacity. It remains clear so that the session range is still easy to identify.

By default, fills are drawn behind the candles and borders are drawn in front of the candles.

Session colors

Every exchange has separate fill and border color settings.

The default colors are:

  • NYSE: blue

  • London: purple

  • Shanghai: orange-red

  • Tokyo: yellow

  • Hong Kong: green

  • Euronext: cyan

You can change each color from the indicator inputs.

The fill and border colors do not need to match. For example, you can use a dark blue fill with a bright blue border, or turn the fill off and display only the session outline.

Labels

The indicator can place the exchange name at the upper-left area of each session rectangle.

Labels use the session border color, which helps connect the name with its rectangle.

You can:

  • Show or hide labels

  • Change the label font size

  • Change the label color by changing the session border color

Labels are enabled by default.

Border settings

The session border can be adjusted to match your chart style.

Available settings include:

  • Border color for each exchange

  • Border width

  • Border line style

  • Foreground or background drawing

The default border width is two pixels, which keeps the session outline visible without covering too much price information.

Historical sessions

The History Days input controls how many calendar days the indicator processes.

The default value is 10 days.

A higher value displays more historical sessions, but it also requires more price data and more chart objects.

For normal intraday use, a value between 5 and 20 days is usually sufficient.

Only Monday-to-Friday session dates are processed. Weekend sessions are not drawn.

Refresh rate

The indicator checks active sessions at a regular interval.

The default refresh interval is five seconds.

It also updates when:

  • A new price calculation occurs

  • The chart changes

  • The chart scale or visible area changes

A shorter refresh interval gives faster visual updates but causes MetaTrader to process the session data more often.

Main inputs

General settings

InpHistoryDays

Sets the number of historical calendar days to process.

InpHighLowTimeframe

Sets the timeframe used to calculate each session high and low. The default is M1.

InpRefreshSeconds

Sets the update interval in seconds.

InpShowLabels

Shows or hides exchange names.

InpLabelFontSize

Sets the label text size.

InpFillRectangles

Enables or disables the colored session fills.

InpFillOpacityPercent

Controls the strength of the session fill from 0 to 100.

InpDrawFillBehindCandles

Places the session fill behind the price candles.

InpDrawBordersInForeground

Places session borders in front of the candles.

InpBorderStyle

Sets the border line style.

InpBorderWidth

Sets the border thickness.

Broker-time settings

InpBrokerOffsetMode

Selects automatic current offset, automatic European DST, or manual fixed offset.

InpManualBrokerUTCMinutes

Sets the manual broker UTC offset in minutes.

This value is used when Manual Fixed Offset is selected. It is also used as a fallback if automatic time detection is not available.

Exchange settings

Each exchange has:

  • An enable or disable switch

  • A fill color

  • A border color

This lets you build a simple three-session layout or display all six exchanges.

Suggested setup

For a clean intraday chart, start with the default settings:

  • NYSE enabled

  • London enabled

  • Shanghai enabled

  • All other exchanges disabled

  • M1 high and low calculation

  • 10 history days

  • 22% fill opacity

  • Two-pixel borders

  • Labels enabled

If the chart becomes too busy, reduce the history period or disable the labels.

If the fill is too weak, increase the opacity to approximately 30–35%.

If the fill is too strong, reduce it to approximately 10–15%.

Practical uses

The indicator can help with several types of analysis.

Session range analysis

See the high and low formed during each stock-market session.

Session overlap

Identify periods when two major markets are open at the same time, such as London and New York.

Breakout context

See whether price breaks above or below a completed session range.

Volatility comparison

Compare the size of the Asian, European, and US session ranges.

Intraday support and resistance

Use completed session highs and lows as reference levels for later price action.

Market timing

See which major equity market is active without converting local exchange times manually.

Important notes

The indicator uses regular weekday session schedules.

It does not contain an exchange holiday calendar. It also does not automatically adjust for special early-close days, emergency closures, or temporary exchange schedule changes.

If the chart symbol continues to trade while a stock exchange is closed for a holiday, MetaTrader may still provide price bars during the normal session window. In this case, the indicator can draw a rectangle even though the physical exchange is closed.

Historical accuracy also depends on the price history supplied by your broker. Missing M1 data can prevent a session rectangle from appearing or can produce an incomplete range.

The indicator is designed for visual analysis. It does not provide trading signals, alerts, order execution, or profit guarantees.


作者的更多信息
Liquidity Breaks and Swings
Erik Istvan Fazekas
5 (2)
請查看「新功能」以了解版本 1.3 的詳細說明 //+---------------------------------------------------------------------------------------------------------------+ 我創建了這個指標,因為在我的策略中缺少了這樣的工具,並且沒有找到類似的工具。對我來說,這個指標在日內交易中表現最好,但你可以隨意進行實驗。 概述 此指標旨在通過分析價格走勢和成交量動態,幫助識別市場中的關鍵轉折點。 特點 指標策略的核心是基於識別通常在重大價格變動之前出現的高點和低點模式。這些模式通過掃描圖表,尋找具有以下特徵的K線來確定: 看跌K線模式 :當K線的高點高於[用戶可調]的前置(默認5)和後置(默認3)K線的高點時,該模式被識別。僅當該K線之前的K線數中有[用戶可調]數量的成交量逐漸減少時,才進行標記。 看漲K線模式 :當K線的低點低於[用戶可調]的前置(默認5)和後置(默認3)K線的低點時,該模式被識別。僅當該K線之前的K線數中有[用戶可調]數量的成交量逐漸減少時,才進行標記。 成交量標準
FREE
动态成交量/价格变化曲线 成交量/价格变化曲线显示用户自定义图表范围内成交量分布和计算出的价格变化值。移动或调整选择矩形框的大小,即可分析不同的周期。该指标显示成交量分布、正负价格变化值、控制点 (POC) 以及成交量高点 (VVL) 和低点 (VVH)。 成交量分布可以基于报价单或更低时间周期的柱状图计算,并支持基于报价单或实际成交量(如有)。可配置参数包括价格线数量、价值区域百分比、成交量分布方法、曲线宽度、实时预览、水平投影、标签、颜色、线条样式和初始选择大小。 可配置参数 数据和计算 曲线计算方法:选择基于报价单或更低时间周期柱状图的计算方法。 更低时间周期曲线周期:设置更低时间周期计算方法使用的柱状图时间周期。 成交量来源:选择基于柱状图的成交量来源,可以是自动成交量、报价单成交量或实际成交量。  柱线成交量分布方式:将每根柱线的成交量分配到特定价格区间,或将其分配给典型价格或收盘价。 价格轮廓行数:控制轮廓的垂直分辨率。行数越多,细节越丰富。 价值区域百分比:设置 VVL 和 VVH 之间包含的总成交量百分比。 性能 缓存已下载的逐笔数据:在重新计算
FREE
筛选:
无评论
回复评论