Loading…

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

SettingDefaultWhat it does
Session start hour8Session start hour (server time, 0-23)
Session length hrs8Session length in hours
Work timeframePERIOD_M15Timeframe the session is measured on (must divide the hour evenly)
Norm sessions20Number of past sessions averaged into the norm
Spread band stdev1.0Spread more than this many stdevs from the session mean is WIDE/TIGHT
Refresh secs2Panel refresh interval, seconds
CornerCORNER_LEFT_UPPERPanel corner
X offset10Horizontal offset, pixels
Y offset20Vertical offset, pixels
Font size9Panel font size

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Volume · Trading Sessions · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria