Market Session Indicator: Three Boxes And A Day Range

Written by Dominic Walsh · Published · Last updated

The market session indicator does two jobs on one chart. It shades the three main trading windows using the hour inputs, and separately tracks the running high and low of the day. A close beyond either of those extremes then puts a mark on the bar.

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 4: Session Buy, Session Sell, Day High, Day Low
Alerts popup, push notification, email, sound
Inputs 16

What the Market Session Indicator draws on the chart

Day High is the dodger blue line at the running high of the session day.

Day Low is the tomato line at the running low.

Session Buy and Session Sell mark a close beyond one of those lines.

OBJ_RECTANGLE boxes shade the three windows when `ShowSessions` is on.

  • Session Buy: arrow, lime, width 2, arrow code 233
  • Session Sell: arrow, red, width 2, arrow code 234
  • Day High: line, dodger blue, width 1
  • Day Low: line, tomato, width 1
Market session indicator on EURUSD H1 with shaded sessions and the day range
Market session indicator on EURUSD H1 with shaded sessions and the day range

How the Market Session Indicator calculates its values

Shading the windows

Six hour inputs bound the three windows. `AsianStartHour` `0` through `AsianEndHour` `8`, then London from `LondonStartHour` `8` to `LondonEndHour` `16`, then New York from 13 to 22. All six read server time, and London overlaps New York on purpose.

Tracking the day range

dHi extends whenever a bar prints higher inside the current day, and dLo extends downward the same way. Both feed the plotted buffers, which is why the two lines look like a staircase.

Marking a break

The code compares the current close and the previous one against those running extremes. pad takes `ArrowOffsetPoints` `12` times Point, which keeps the mark clear of the candle.

How to read the signals

Shaded boxes show which participants were active during each stretch.

London overlapping New York is the busiest window on most days.

Both lines reset at the day boundary, so an early break means little.

`DarkTheme` only changes the shading colours, not the logic.

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

`EnableAlerts` starts on with `EnablePopup` and `EnableSound` both true, while `EnablePushNotify` and `EnableEmail` begin false. `SoundFile` picks the clip. The break test reads two completed closes, one message per bar.

Every Market Session Indicator input

Core settings

Setting What it does Default
DarkTheme Dark theme (vs light). Picks the shading palette, default `true`. on
AsianStartHour Asian session start (server hour). Asian window start in server time, default `0`. 0
AsianEndHour Asian session end. Asian window end, default `8`. 8
LondonStartHour London session start. London window start, default `8`. 8
LondonEndHour London session end. London window end, default `16`. 16
NYStartHour New York session start. New York window start, default `13`. 13
NYEndHour New York session end. New York window end, default `22`. 22

Display settings

Setting What it does Default
ShowSessions Show Asian / London / NY shaded boxes. Draws the three shaded boxes, default `true`. on
ShowDailyRange Show projected daily high/low lines. Draws the day high and low lines, default `true`. on
ArrowOffsetPoints Vertical pad for arrows (points). Mark distance from the bar in points, default `12`. 12

Alert settings

Setting What it does Default
EnableAlerts Master alert switch. Master switch for the session break alerts, default `true`. on
EnablePopup Pop-up alert. Terminal dialog on a session break, default `true`. on
EnablePushNotify Mobile push. Phone push on a session break, default `false`. off
EnableEmail Email. Mail delivery on a session break, default `false`. off
EnableSound Sound. Sound playback on a session break, default `true`. on
SoundFile Sound file. Wav clip for the session alert, default `alert.wav`. alert.wav
Market session indicator inputs: ShowSessions, AsianStartHour, LondonStartHour, NYStartHour
Market session indicator inputs: ShowSessions, AsianStartHour, LondonStartHour, NYStartHour

Settings that fit your chart

Session shading needs a chart fine enough to show the windows. EURUSD H1 is the reference chart, where each window covers several candles. On M15 the boxes read clearly and the day range fills gradually. On H4 a whole session is two bars, which makes the shading almost pointless.

When the Market Session Indicator fails

Every hour input reads server time, so a broker offset shifts all three boxes.

The day extremes reset at midnight server time, which rarely matches a trading day.

A break early in the day happens constantly, because the range has barely formed.

Copy the compiled Market Session 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.

Related on forexmt4systems.com: London Session Breakout Strategy.

Background reading on the method behind the Market Session Indicator: the foreign exchange market at Britannica, Mirror trading on Wikipedia.

Download the Market Session Indicator for MT4 and MT5

The zip holds the compiled Market Session 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

Why does NYStartHour sit inside the London window?

Because the two sessions genuinely overlap. London runs to `LondonEndHour` `16` while New York opens at `NYStartHour` `13`. Those three hours are the busiest window most days, and shading them twice makes that visible.

Does AsianStartHour read server time?

Yes, all six of them. Broker server clocks vary by several hours, so the shading can sit in the wrong place until you adjust. Check your terminal clock against GMT before trusting the boxes.

What resets the Day High line?

The session day boundary. Both extremes start fresh at the new day and extend from there. That is why a break shortly after the reset is common and usually means very little.

Does DarkTheme change any calculation?

No. It only picks which palette the shaded boxes use, so the tool stays readable on a dark or a light chart. Every hour input, both lines and the break test behave the same either way.

Are results guaranteed?

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

Category: this is part of our Sessions collection. Browse more Sessions for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

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