Session Open Microscope
The first few minutes after a session opens behave differently from the rest of the day - tick rate jumps, spread often widens then settles, and price can move further than the calm hours either side. Exactly how different is usually left as folklore ("London open is volatile") rather than measured on the trader's own feed and symbol. This script measures it directly. Attach it at or slightly before the configured session open and it samples live bid/ask on the chosen symbol for InpWindowMinutes, tracking the number of ticks, the mean gap between them, the minimum/mean/maximum spread, the bid price excursion (high minus low during the window), and the balance of up-ticks versus down-ticks. Everything is reported once the window closes, with the full tick-by-tick record available in the optional CSV export. A Script runs once and cannot pause for hours, so this deliberately refuses to run rather than block silently if the window has not started yet or has already finished for the day - it says exactly when the window is and asks you to re-attach then, rather than tying up a chart slot waiting. Notes and limitations - The script computes TODAY's session open from the hour/minute inputs. It is meant to be attached once per session, not left running across days. - If attached before the session opens, or after the window has already passed for the day, it refuses to run and states the actual window time rather than waiting or silently doing nothing. - Reported statistics reflect exactly one session's window on one attach - there is no averaging across multiple days built in. Run it on consecutive days and compare the Experts log entries (or the CSV files) by hand for a multi-day picture. - Tick timestamps use the terminal's local clock at millisecond resolution via GetTickCount(), not the broker's server clock, so the spacing between ticks is accurate even though the printed date/time is local.
Script · MT4 · v1.0 · Free
About Session Open Microscope
Session Open Microscope 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, Session start hour and Session start minute. MQL source code included.
Files in the download: SessionOpenMicroscope.mq4, SessionOpenMicroscope.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol | Symbol to sample, blank = this chart's symbol | |
| Session start hour | 8 | Session open hour, server time (0-23) |
| Session start minute | 0 | Session open minute, server time (0-59) |
| Window minutes | 15 | Minutes after the open to capture (max 120) |
| Poll interval ms | 20 | Poll interval while sampling, milliseconds |
| Save csv | true | Write every sampled tick to a CSV file |
| Delimiter | DelimiterComma | CSV column separator |
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