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
| Setting | Default | What it does |
|---|---|---|
| Asian enabled | true | Show Asian session |
| Asian start hour | 0 | Asian session start hour (broker time, 0-23) |
| Asian end hour | 8 | Asian session end hour (broker time, 0-23) |
| Asian color | clrLavender | Asian session colour |
| London enabled | true | Show London session |
| London start hour | 8 | London session start hour (broker time, 0-23) |
| London end hour | 16 | London session end hour (broker time, 0-23) |
| London color | clrHoneydew | London session colour |
| New york enabled | true | Show New York session |
| New york start hour | 13 | New York session start hour (broker time, 0-23) |
| New york end hour | 21 | New York session end hour (broker time, 0-23) |
| New york color | clrMistyRose | New York session colour |
| Days back | 10 | Calendar days of history to shade |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Breakout · Price Action · Trading Sessions · MT4 Indicator · MQL4 Source Code