Trading Session Time for MT4 & MT5: Free Download
Free source ZIP · ForexBestRobots edition 1.06 · Compile in MetaEditor

Each platform ZIP contains the marked MQ4/MQ5 source, required icon in Files, the unchanged original source, Apache 2.0 license, author notices, changes, a patch, checksums and instructions in all 12 site languages. Keep upstream as a reference copy.

There is no ready EX4 or EX5 executable. We reviewed the source and checked extracted scheduling, parsing, window-selection and range helpers outside MetaTrader. We did not compile or run this derivative in native MT4/MT5. Compile in the matching MetaEditor, inspect the result and test on a demo chart.

1. Download and extract the ZIP for your desktop platform.
2. In MetaTrader open File → Open Data Folder, then MQL4 or MQL5.
3. Copy the ZIP’s Indicators and Files folders there. Keep upstream separately as the original reference.
4. Open Trading_Session_Time_ForexBestRobots.mq4 or .mq5 in the matching MetaEditor, press F7 and inspect errors or warnings.
5. Refresh Navigator → Indicators and attach the compiled program to an intraday demo Forex chart.
6. Set broker-clock hours, weekdays, display mode and a unique IndicatorName; start with a finite BarsToScan and notifications off.

No DLL imports or extra include files are required. A desktop custom indicator cannot be installed directly into the MetaTrader mobile app.

TimeLineStart and TimeLineEnd use the broker chart’s clock, not your computer timezone and not automatically UTC. If a broker is UTC+2 and your intended window is 08:00–17:00 UTC, enter 1000–1900. Update the inputs if the broker or desired local-session offset changes; there is no timezone converter or automatic daylight-saving calendar.

Accepted examples include 0830, 8:30, 13h50 and 22.15, with ordinary digits. Surrounding spaces are trimmed; a blank end is optional. Invalid times, 2400 and identical explicit start/end times are rejected. For a full broker day use 0000–2359; its final minute is included and its effective end is the next 00:00.

ShowMonday through ShowSunday filter the start date. Monday–Friday are enabled by default; Saturday and Sunday are off. An overnight session starting Sunday is therefore absent unless ShowSunday is enabled. For several schedules use unique independent names, such as ForexBestRobots-Session-A and ForexBestRobots-Session-B; empty, duplicate or nested object namespaces are rejected.

BarsToScan=1000 limits the chart history examined. Zero uses all available history and can be expensive. Sessions starting before the retained window are omitted to avoid a clipped range. No missing quotes are invented. A new chart candle or a history reset rebuilds the selected window; ticks update the active session.

A session box is an observation aid, not a buy/sell signal. Seeing a large range after a session ends does not show that it was predictable or profitable. The figures do not model spreads, commission, slippage, stops or order execution.

The active box can expand as new extremes arrive. Closed-session boxes can change after the broker corrects history. Whole-bar OHLC on a coarse or misaligned timeframe can include prices outside an exact minute boundary. Future lines are schedule markers, not price forecasts or an exchange holiday calendar.

This edition redraws the selected window on each new bar for consistent rolling limits. Use a finite scan window and a sensible number of instances on slower terminals. Desktop MetaTrader must remain running for drawing and notifications. C++ checks of extracted logic do not establish native MQL compilation, rendering, broker synchronization or actual notification delivery.
