Every symbol in MetaTrader 5 has a weekly trade-session schedule set by the broker (Symbol specification, "Sessions"). This indicator reads that schedule and shows one status line on the chart, for example "EURUSD: trade session OPEN, closes Sat 00:00 in 1d 04:23:01" or "EURUSD: trade session CLOSED, opens Mon 00:05 in 1d 02:00:10". A symbol that trades all week shows "no scheduled close".

All times are broker server time, the same time as the bars, so no time zone setting is needed. The indicator also marks with a small dot every bar whose whole period lies outside the trade sessions. These are bars where the broker sent quotes while its schedule says trading is closed, for example pre-market and after-hours quotes on stocks.
How the schedule is read
Use in an Expert Advisor
Buffer 0 ("Outside trade session") holds the bar low for bars outside the trade sessions and is empty otherwise; it is the dot on the chart. Buffer 1 ("In trade session") is 1 when the bar overlaps a trade session and 0 otherwise. Read it with iCustom(_Symbol, _Period, "SymbolTradingHours") and CopyBuffer(handle, 1, ...). A bar's value depends only on its open time, the timeframe and the schedule, so it does not change after it is written.
Inputs
The colour and the visibility of the dots are set on the standard Colors and Visualization tabs.
Behaviour worth knowing
Known limits
Backtest Data Preflight: check broker bar and tick history
Check the first and last available bars, gaps between bars, and available MT5 tick history for a date range before a backtest.
TradeGateway: Fake Broker for Trade Management Tests
A library for MetaTrader 5 that puts trade management code behind an interface and tests it against a fake broker, without a trade server. The fake checks stops level, freeze level, tick grid and volume step, answers with retcodes chosen by the test and logs every request. An example break-even rule and 26 test cases come with it.
Range Expansion Clock: When the Day's Range Actually Gets Made.
A per-hour profile of when the day's range actually gets built, plus a live readout of whether today is running ahead of or behind its usual pace
Round Number Reaction Map: Touch, Reject or Break at 00 and 50 Levels
Tracks every touch of a round "00" or "50" level and keeps a running scorecard of how often price rejects versus breaks through — then maps that history onto the levels nearest to current price.