Session Overlap Behaviour Study
"Trade the overlap, it's the most active time" is common advice, but it is rarely backed by anything beyond a chart glance. This script sorts every H1 bar in the requested history into one of three classes - inside both London and New York hours, inside exactly one of them, or inside neither - and reports, per class, the average bar range in pips, the average absolute open-to-close drift, and the rate of bars that moved a meaningful distance in both directions before closing (a simple two-sided/"reversal" flag). Session hours are read from four plain hour inputs rather than a fixed table, because every broker's server clock sits at a different offset from GMT and that offset itself changes with each side's own daylight-saving calendar. The hour windows also handle wraparound past midnight, since some broker clocks place a session's hours on either side of the day boundary. The reversal flag is intentionally simple: a bar counts as two-sided when both its open-to-high move and its open-to-low move exceed a configurable fraction of the bar's own range. It is a rough proxy for "the bar didn't just walk in one direction", not a claim about intrabar tick sequencing, which H1 bar data cannot reconstruct. Notes and limitations - All four session-hour inputs are server time as reported by iTime(); they are not auto-detected and must be set to match the broker this history came from. - The reversal flag is a same-bar open/high/low proxy, not a genuine tick-by-tick reversal count - H1 bar data has no finer resolution. - Session windows that overlap by design (as London/New York normally do) will always populate the "Overlap" class; setting both windows identical or non-overlapping is a valid but different study.
Script · MT4 · v1.0 · Free
About Session Overlap Behaviour Study
Session Overlap Behaviour Study is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 7 settings, such as Symbol, Max bars and London start hour. MQL source code included.
Files in the download: SessionOverlapStudy.mq4, SessionOverlapStudy.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to study, blank = this chart's symbol | |
| Max bars | 5000 | Most recent H1 bars to include |
| London start hour | 8 | London session start, server-time hour (0-23) |
| London end hour | 17 | London session end, server-time hour (0-23, exclusive) |
| New york start hour | 13 | New York session start, server-time hour (0-23) |
| New york end hour | 22 | New York session end, server-time hour (0-23, exclusive) |
| Reversal fraction | 0.30 | Both open->high and open->low must exceed this fraction of the bar's range to count as a two-sided ( |
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 → Scripts.
- 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 script onto a chart to run it once.
Tags: Trading Sessions · Alerts · MT4 Script · MQL4 Source Code