Server Time Offset Reporter
Half of session-timing questions - when is the daily candle cut, when does London open on my charts, why is my EA's news filter an hour off - reduce to one number: the broker's offset from GMT. This script derives it directly, printing TimeCurrent, TimeLocal and TimeGMT as ISO timestamps, the broker offset and your PC offset rounded to the nearest half hour (half, because +05:30 brokers exist), and the difference to add to your own clock to get broker time. The honest caveat, and the reason the script warns instead of just printing: TimeCurrent() is not a clock. It is the timestamp of the last tick the terminal received. During an active market that is within a second or two of true server time; on a quiet weekend it can lag by minutes to hours, and the derived offset inherits that lag in full. The script measures the residue between the raw difference and the rounded offset - a residue of a few seconds means the tick is fresh and the number can be trusted; a residue of minutes, a weekend on the server calendar, or a disconnected terminal each produce an explicit warning to rerun during active hours. It also addresses the question people actually have in March and October: does my broker move with daylight saving? One reading cannot prove that, and the script does not pretend it can. It computes whether European DST is currently in effect (last Sunday of March to last Sunday of October), states what a broker on the dominant EET convention (GMT+2 winter, GMT+3 summer) would show right now, and phrases the conclusion with exactly the certainty one reading supports - including telling you plainly when only a summer-plus-winter comparison would settle it. The script only reads. No inputs, nothing to configure. Notes and limitations - TimeCurrent() is last-tick time. Every warning in the output exists because of this one fact; a weekend reading can be wrong by hours and the script says so rather than rounding the error away silently. - TimeGMT() is computed from your PC clock and its Windows time zone settings. If your PC clock is wrong, GMT is wrong, and both derived offsets are wrong by the same amount. Keep Windows time synchronisation on. - The DST assessment is phrased around the European switch window because the dominant broker convention (EET) follows it. A broker following US or no DST rules gets the honest "cannot be told from one reading" wording, not a guess. - The offset is a property of the broker's server clock, not of your account, and brokers occasionally move their server time zone. A stored value is a snapshot, not a constant.
Script · MT5 · v1.0 · Free
About Server Time Offset Reporter
Server Time Offset Reporter is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. MQL source code included.
Files in the download: ServerTimeOffset.ex5, ServerTimeOffset.mq5, ServerTimeOffset.txt.
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 → Scripts.
- 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 script onto a chart to run it once.
Tags: Trading Sessions · News Trading · Alerts · MT5 Script · MQL5 Source Code