Overview
Draws Asia, London and New York session high-low boxes for the last N days, with your broker time offset and range labels in pips.
- What it is
- A free Indicator for MetaTrader 4, written in MQL4.
- What it does
- Draws Asia, London and New York session high-low boxes for the last N days, with your broker time offset and range labels in pips.
- Shared by
- Alex
- Licence
- MIT
- Version
- 1.0 (1 Dec 2026)
- Settings
- 22 inputs
- Lab check
- Compiled with MetaEditor build 2425 for MT4 on 1 Dec 2026: 0 errors, 0 warnings.
- Price
- Free to download
Session Boxes marks the Asia, London and New York trading sessions on your chart as boxes that span each session's high and low. You can see at a glance where the Asian range formed, whether London broke it, and how far each session travelled. Session hours are entered in GMT and shifted by one broker offset, so the boxes line up on any broker's server time.
How it works
- For each of the last N trading days (taken from the daily bars) the indicator builds each session window:
start = day start + (session start hour + GMT offset) hours. If the end hour is smaller than the start hour the session runs past midnight. - The high and low of the window come from H1 data (or from the chart's own bars on charts below H1). Because the sessions use whole hours, this is exact.
- A rectangle is drawn from the session start to its planned end, between that high and low. A label shows the session name and its range in pips (on 3 and 5 digit symbols one pip is 10 points).
- A session that is still running grows with each tick. Everything else is only redrawn when a new H1 bar (or chart bar on lower timeframes) begins, so the indicator stays light.
Inputs
| Input | Default | What it does |
|---|---|---|
| GMT offset | 2 | Broker server time minus GMT, in hours. Use 3 for a GMT+3 server. |
| Days back | 5 | Number of trading days to draw (1-60). |
| Show Asia / London / New York | true | Turns each session on or off. |
| Asia start / end | 0 / 9 | Asia session hours in GMT. |
| London start / end | 7 / 16 | London session hours in GMT. |
| New York start / end | 12 / 21 | New York session hours in GMT. |
| Session colours | blue, green, rust | Colour of each box and its label. |
| Fill boxes | true | Fills the boxes behind the candles; off draws outlines only. |
| Show labels | true | Shows the session name and range in pips. |
| Label font size | 8 | Size of the label text. |
How to use it
- In MetaTrader choose File > Open Data Folder.
- MT4: copy
FXN_SessionBoxes.mq4intoMQL4/Indicators. MT5: copyFXN_SessionBoxes.mq5intoMQL5/Indicators. - Restart the terminal, or right-click Indicators in the Navigator and choose Refresh. If the indicator does not appear, open the file in MetaEditor and press F7 to compile it.
- Drag the indicator onto a chart, adjust the inputs and press OK.
First find your broker's server offset: compare the time in Market Watch with GMT. Enter that number as GMT offset. Use the indicator on M5 to H1 charts. If your broker changes its offset for daylight saving time, update the input when the clocks change, or adjust the session hours instead.
Good to know
- The session hours are approximate market hours; edit them to match the hours you trade.
- The indicator uses one fixed offset. It does not switch daylight saving time by itself.
- The box of a running session changes until the session ends. Finished sessions do not change.
- On H4 and higher charts the boxes still draw, but they cover only a few candles and are less useful.
- If price history for older days is not loaded yet, those boxes appear once MetaTrader downloads it.
- All objects use the prefix
FXN_SB_and are removed when you remove the indicator. It does not trade.
Trading carries risk. Test on a demo account first; past results do not predict future results.
Settings read from the code
| Input | Type | Default | Note |
|---|---|---|---|
| InpGroup1 | string | === Time === | ---- Time ---- |
| InpGmtOffset | int | 2 | Broker server time minus GMT in hours (2 = server at GMT+2) |
| InpDaysBack | int | 5 | Number of trading days to draw (1-60) |
| InpGroup2 | string | === Asia session (GMT hours) === | ---- Asia session (GMT hours) ---- |
| InpShowAsia | bool | true | Draw the Asia session |
| InpAsiaStart | int | 0 | Asia start hour, GMT (0-23) |
| InpAsiaEnd | int | 9 | Asia end hour, GMT (0-23) |
| InpAsiaColor | color | C'70,110,160' | Asia box colour |
| InpGroup3 | string | === London session (GMT hours) === | ---- London session (GMT hours) ---- |
| InpShowLondon | bool | true | Draw the London session |
| InpLondonStart | int | 7 | London start hour, GMT (0-23) |
| InpLondonEnd | int | 16 | London end hour, GMT (0-23) |
| InpLondonColor | color | C'60,140,90' | London box colour |
| InpGroup4 | string | === New York session (GMT hours) === | ---- New York session (GMT hours) ---- |
| InpShowNY | bool | true | Draw the New York session |
| InpNYStart | int | 12 | New York start hour, GMT (0-23) |
| InpNYEnd | int | 21 | New York end hour, GMT (0-23) |
| InpNYColor | color | C'170,90,60' | New York box colour |
| InpGroup5 | string | === Display === | ---- Display ---- |
| InpFill | bool | true | Fill the boxes (drawn behind the candles) |
| InpShowLabels | bool | true | Show session name and range in pips |
| InpFontSize | int | 8 | Label font size |
How to use it
- Download the compiled file (or the source and compile it in MetaEditor).
- Put it in MetaTrader: File → Open Data Folder → MQL4 → Indicators, then refresh the Navigator.
- Test it on a demo account before any real money.
- Want changes? Open a copy in your Lab and ask for them in plain words.