Live Session Stats Card
Most "today vs average" panels compare the current day against a plain all-day average, which blends together sessions that behave nothing alike - London's range norm is not Asia's, and comparing this morning's move to a 24-hour blended figure tells you less than comparing it to what this same session has typically done. This card defines a session as a fixed daily window (a start hour and a length in hours, re-anchored every day) and builds its norms by walking back through past occurrences of that same window. Crucially, the historical range and volume figures are measured over the SAME elapsed bar count the live session has covered so far, not each past session's full length - comparing an hour into today against an hour into past sessions, rather than against their eventual totals, which would understate how the live reading compares partway through. Spread has no historical per-bar record in MT4, so its "norm" is a different kind of figure: a running mean and standard deviation sampled live since the current session began, reset at every new session start. The card grades the live spread as TIGHT, NORMAL or WIDE against that running baseline once enough samples exist. Notes and limitations Session start detection resolves to the chosen work timeframe's bar resolution and requires the bar's minute to be exactly 0, which holds for every standard MT4 timeframe but means the session boundary is only as precise as that timeframe's bar spacing. If fewer than InpNormSessions past sessions can be found in the loaded history (e.g. right after attaching on a symbol with short history), the norm is built from whatever is available and the row states how many sessions it used - it never silently pretends to have a full sample. The spread state needs a handful of live samples before it classifies as anything other than "WARMING UP", so it reads as unavailable for the first few seconds after each new session begins.
Indicator · MT5 · v1.0 · Free
About Live Session Stats Card
Live Session Stats Card is an indicator for MetaTrader 5. It has 10 settings, such as Session start hour, Session length hrs and Work timeframe. MQL source code included.
Files in the download: LiveSessionStatsCard.ex5, LiveSessionStatsCard.mq5, LiveSessionStatsCard.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Session start hour | 8 | Session start hour (server time, 0-23) |
| Session length hrs | 8 | Session length in hours |
| Work timeframe | PERIOD_M15 | Timeframe the session is measured on (must divide the hour evenly) |
| Norm sessions | 20 | Number of past sessions averaged into the norm |
| Spread band stdev | 1.0 | Spread more than this many stdevs from the session mean is WIDE/TIGHT |
| Refresh secs | 2 | Panel refresh interval, seconds |
| Corner | CORNER_LEFT_UPPER | Panel corner |
| X offset | 10 | Horizontal offset, pixels |
| Y offset | 20 | Vertical offset, pixels |
| Font size | 9 | Panel font size |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 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: Volume · Trading Sessions · MT5 Indicator · MQL5 Source Code