Loading…

Session Highlighter

Knowing which session price action happened in matters for reading it correctly - a breakout during the London open means something different from the same move during a thin Asian session. This indicator draws each enabled session as a shaded background box for every day it appears on the chart, using the terminal's own server-time hours, which is the same clock every bar's timestamp already uses. There is no timezone lookup table to get wrong or keep updated as daylight-saving rules change; the hours are whatever the broker's server clock says, entered directly as inputs. A session box's height is set from the high and low of the bars that actually occurred inside it, not the chart's full visible range, so the box always reflects what that session actually did. Today's session box keeps growing as new bars complete inside it and is only fixed in place once the session's end hour passes. A session whose end hour is earlier than its start hour (an overnight session, such as Asian trading from 22 through to 6) is handled by anchoring it to the calendar day the session started on, not the day it ends on. To keep object counts sane on charts with years of low-timeframe history, only the most recent configurable number of calendar days are ever drawn. Notes and limitations - Session hours are broker server time, exactly as time[] already reports it - there is no conversion to the trader's local time or to any named timezone such as GMT or EST, so the inputs must be set against the broker's own clock, not a generic session-time reference. - Only the most recent InpDaysBack calendar days are drawn; older sessions are never shaded, by design, to keep the object count bounded. - A session box's top/bottom reflects the high/low of the bars that fell inside it on the chart's current timeframe - the same session viewed on a much higher timeframe can show a visibly different box because fewer, coarser bars are being measured. - Overlapping sessions (for example London and New York) draw as overlapping rectangles; the fill colours will visibly blend or occlude by object draw order rather than a dedicated overlap colour. - Purely a visual overlay with no signal or alert output.

Indicator · MT4 · v1.0 · Free

About Session Highlighter

Session Highlighter is an indicator for MetaTrader 4. It has 13 settings, such as Asian enabled, Asian start hour and Asian end hour. MQL source code included.

Files in the download: SessionHighlighter.ex4, SessionHighlighter.mq4, SessionHighlighter.txt.

Settings

SettingDefaultWhat it does
Asian enabledtrueShow Asian session
Asian start hour0Asian session start hour (broker time, 0-23)
Asian end hour8Asian session end hour (broker time, 0-23)
Asian colorclrLavenderAsian session colour
London enabledtrueShow London session
London start hour8London session start hour (broker time, 0-23)
London end hour16London session end hour (broker time, 0-23)
London colorclrHoneydewLondon session colour
New york enabledtrueShow New York session
New york start hour13New York session start hour (broker time, 0-23)
New york end hour21New York session end hour (broker time, 0-23)
New york colorclrMistyRoseNew York session colour
Days back10Calendar days of history to shade

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Breakout · Price Action · Trading Sessions · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria