Broker Session Watch
- Indicators
-
Denis Makarov
MQL4/MQL5 developer. I build and improve trading tools for MetaTrader 4 and 5.
What I do:
• Expert Advisors, custom indicators and scripts, from your idea or spec to tested code
• Modification and bug fixing of existing EAs and indicators - Version: 1.0
Broker Session Watch — an indicator that shows your broker’s trading schedule for all instruments from Market Watch in one compact chart panel.
Why it is needed
Each broker has its own trading schedule, and it does not coincide with the “generally accepted” London and New York hours. Indices, metals, cryptocurrencies and oil often have internal breaks, shortened Fridays and overnight sessions that cross midnight. Because of this, a trader finds out that an instrument is closed only after an order has not been executed, or waits for a market to open that has actually been trading for a long time.
Broker Session Watch reads the schedule directly from the terminal (SymbolInfoSessionTrade ) and displays it in real time: which session is running right now, when it will close, when the next one will open, and whether the broker allows trading in that instrument.
The indicator only informs. It does not open, modify or close positions and does not send trade requests.
What the indicator shows
One row per symbol, four columns:
-
SYMBOL — the instrument name exactly as the broker calls it, including prefixes and suffixes (EURUSD.m , XAUUSD# , etc.);
-
STATUS — session state and trading permission;
-
NEXT EVENT — the nearest event: “Opens Mon 00:00” or “Closes 18:00”;
-
COUNTDOWN — time until that event in HH:MM:SS format.
Statuses:
-
OPEN — the session is active, trading is allowed;
-
CLOSED — there is no session: night break, weekend or end of week;
-
BREAK — between two sessions of the same trading day;
-
DISABLED — the broker has disabled trading for the symbol;
-
CLOSE ONLY — only closing positions is allowed;
-
LONG ONLY — only purchases are allowed;
-
SHORT ONLY — only sales are allowed;
-
NO SCHEDULE — the terminal does not publish a schedule for this symbol.
If a session is active but the broker has restricted trading, the STATUS column shows the restriction, while COUNTDOWN continues counting down to the end of the session — so you can immediately see both that the market is open and that trading on it is restricted.
The panel header shows the broker’s trading server time and a summary: the number of symbols, open, closed and restricted ones, as well as the number of breaks, symbols without a schedule and hidden rows.
Interface
The entire panel is built from native chart objects and does not interfere with trading:
-
the “–” button collapses the panel to the header; pressing it again expands it;
-
“A” toggles sorting: alphabetical (A–Z / Z–A) and by time of the nearest event (nearest first / latest first);
-
“F” toggles the filter: all / only open / only closed / only breaks / only restricted;
-
“Q” opens a search field by symbol name;
-
“+” and “–” change the font size;
-
“^” and “v” scroll the list; the mouse wheel over the panel also works;
-
the panel title can be dragged to any place on the chart;
-
clicking a symbol row opens its chart on the current timeframe.
The panel adapts to the chart size: on a narrow chart, secondary columns are removed instead of overlapping; on a short chart, the number of rows is reduced, the remaining ones are available by scrolling, and a hint such as “1-12/14” appears in the status line. The panel position, font, collapsed state, sorting and filter are remembered between terminal launches.
How to use
-
Open Market Watch and select the instruments you want to monitor.
-
Drag Broker Session Watch onto any chart.
-
The panel will immediately show all selected symbols; instruments added to and removed from Market Watch are picked up automatically, without restarting.
-
Row decoding: “XAUUSD | BREAK | Opens 18:30 | 00:47:12” — gold is currently in a break, the next session will open at 18:30 server time, and there are 47 minutes 12 seconds left until then.
-
For instruments with continuous trading, “CONTINUOUS” is displayed instead of a countdown — this is determined by the actual weekly schedule, not by the proximity of sessions.
Example status line:
Server 14:32:10 24 sym | 12 open | 9 closed | 2 restr. 1-12/24
(server time, 24 symbols, of which 12 are open, 9 closed, 2 restricted; rows 1 to 12 out of 24 are shown)
Settings
General:
-
Symbol source — source of the list: Market Watch (default) or a custom list;
-
Custom symbol list — your symbols separated by comma, semicolon or space: "EURUSD,XAUUSD,BTCUSD" ;
-
Maximum monitored symbols — up to 200 symbols (default 100);
-
Schedule refresh interval — how often to reread the schedule, seconds (default 60, minimum 5);
-
Countdown update interval — countdown refresh period (default 1 sec);
-
Show broker server time — show server time in the header;
-
Show summary statistics — show summary by statuses.
Display:
-
Panel corner — panel anchor corner before the first drag;
-
Initial X / Y offset — initial offset in pixels;
-
Font size — font size 7–16 (default 9);
-
Font name — font (default Consolas);
-
Row height — row height 12–40 pixels;
-
Panel width — panel width 260–1000 pixels;
-
Visible rows — visible rows 3–40, the rest by scrolling;
-
Theme — dark or light theme;
-
Show session status column / Show next event column / Show countdown column — enable individual columns.
Behavior:
-
Enable symbol search — search button;
-
Enable status filters — filter button;
-
Enable sorting — sorting button;
-
Click on symbol opens chart — open the chart by clicking on a row;
-
Remember panel position — remember position and settings;
-
Show symbols with trading disabled — show symbols disabled by the broker.
Alerts (disabled by default):
-
Enable alerts — enable notifications;
-
Alert before session close / Minutes before close ;
-
Alert before session open / Minutes before open .
The notification is displayed in the standard Alert window the specified number of minutes before the session closes or opens, once per symbol per event.
How the schedule is calculated
The indicator contains no hard-coded Forex, London or New York hours. For each symbol, it iterates through all trading sessions published by the terminal and lays them out on a single weekly scale starting from Sunday 00:00:
-
multiple sessions within one day and breaks between them are supported;
-
sessions crossing midnight are handled as one continuous session;
-
the transition from Sunday to Monday and the end of the week are handled correctly: a session that started on Friday evening and ended on Saturday does not “close” on Sunday at midnight;
-
when searching for the next event, the current and next weekly intervals are scanned, so the “next opening” is not tied to the same day of the week;
-
zero and service schedule records are ignored and are not turned into round-the-clock trading.
The reference time is the broker’s trading server time (TimeTradeServer ), so countdowns do not depend on your computer’s clock and continue even when no quotes arrive on the chart. The schedule is cached and reread by timer, not on every tick.
If the broker does not publish a trading schedule for a symbol, the indicator shows NO SCHEDULE and, when such data is available, a hint about quote sessions such as “Quotes 09:00-23:00”.
Limitations and important warning
-
The indicator shows the schedule that your broker publishes in the terminal. It is not a source of trading hours and cannot know about unscheduled trading halts, holidays or changes not entered by the broker into the symbol specification.
-
OPEN status means that according to the schedule the session is active and the broker has not disabled trading. This is not a guarantee that a specific order will be accepted or executed: execution depends on liquidity, slippage, margin and the broker’s rules.
-
For symbols not in Market Watch, use a custom symbol list. Unavailable symbols are not replaced by similar ones — they are shown as NO SCHEDULE .
-
The indicator is informational: it does not perform trading operations.
Compatibility and requirements
-
MetaTrader 5, current builds (tested on build 6230).
-
One .mq5 file, no DLL, no WebRequest, no network calls, no external libraries and no additional software installation.
-
Works on any timeframe and any symbol: the panel does not depend on the chart’s price data.
-
The number of chart objects is proportional to the number of visible rows. All objects have a unique prefix BSW_<chart id>_<number>_ and do not affect objects of other indicators, templates or your own objects.
FAQ
Why do some symbols show NO SCHEDULE?
The terminal has not received a trading schedule for them from the broker. Usually these are symbols without a server connection, custom symbols, or instruments for which the broker publishes only quote sessions.
Why does the time in the panel not match my clock?
The panel shows the broker’s trading server time, not the computer’s local time. Sessions operate and orders are executed by server time.
Why is the status OPEN but an order does not open?
OPEN is a schedule state. Also check the STATUS column for restrictions (CLOSE ONLY , LONG ONLY , SHORT ONLY , DISABLED ) and check margin, volume and stop levels.
Why has the NEXT EVENT column disappeared?
The chart is too narrow for four columns. The indicator removes secondary columns instead of overlapping text. Widen the chart or reduce the font.
Can I monitor more than 100 symbols?
Yes, up to 200 — the Maximum monitored symbols parameter.
How many copies can be placed on one chart?
The indicator supports several independent instances on one chart, each with its own set of objects and its own panel position.
Support
Questions and suggestions about the indicator — via messages on MQL5.com.
