TROUBLESHOOTING · METATRADER 5

MT5 market closed error

SYMPTOM

Orders are rejected with "Market closed" during hours you expected to be tradeable.

Causes, most likely first

1. You are inside the daily maintenance break

Spot gold closes for roughly an hour each day around the broker's rollover, typically late in the New York afternoon. The exact window is in Market Watch → Specification → Sessions, and it differs between brokers by up to an hour.

2. The symbol has its own session times, and you have not read them

Right-click the symbol in Market Watch and open Specification. Scroll to the trading sessions: every symbol carries its own, expressed in server time rather than yours. That panel is the authority, and it settles the common confusion directly — one symbol can be shut while the platform looks perfectly alive, because another is still quoting. The server rejects with retcode 10018, TRADE_RETCODE_MARKET_CLOSED, which means the EA behaved correctly and the market was simply not open to receive the order.

3. It is the weekend in server time

Gold closes Friday evening and reopens Sunday evening in server time. Because the server is frequently two or three hours offset from your clock, the close can arrive earlier on Friday and the open later on Sunday than you expect locally.

4. It is a holiday for the underlying market

Metals follow US market holidays, so trading may be closed or thinned on days that are ordinary working days elsewhere. Brokers publish these in advance but rarely prominently.

5. You are backtesting, and the Strategy Tester is enforcing session times

This is a different problem wearing the same words, and it is the one most forum threads are actually about. Recent MetaTester 5 builds respect the declared trading sessions for a symbol during a backtest rather than trading every bar in the file, which is more realistic but surprises anyone who assumed historical data is always tradeable. It bites hardest on custom symbols: import a CSV without defining sessions and the tester can treat the symbol as closed for the entire run, producing zero trades and a stream of market closed errors. The fix is in the symbol specification rather than the EA — open the custom symbol, define its sessions to match the data you imported, and re-run. If the strategy is genuinely meant to trade around the clock, the sessions must say so explicitly.

6. The symbol is disabled on your account type

Some account types offer a restricted symbol list, and the rejection can appear as market closed rather than as a permissions error. Check whether the symbol trades manually on the same account before blaming the EA.

Why this happens

The recurring theme in every one of these is server time. MetaTrader displays and evaluates sessions in the broker's time zone, which is usually not yours, and every session-related confusion traces back to that gap. See server time vs local time.

For an automated system, encountering market closed is not a fault — it is the platform correctly refusing an order. What matters is that the EA handles the rejection gracefully rather than retrying in a loop, which some do and which can trigger broker rate limits.

Our engine restricts trading to a defined session window well inside the tradeable hours, so it rarely meets this error at all. That window exists for liquidity reasons rather than platform ones, but it has this useful side effect.

Common questions

What time does the gold market close?

Spot gold closes Friday evening and reopens Sunday evening in broker server time, with a short daily maintenance break in between. Server time is commonly GMT+2 or GMT+3 and is usually not your local time. Exact times vary by broker — see gold trading hours.

Why do I get market closed when backtesting in MT5?

Because the Strategy Tester now enforces the trading sessions declared for that symbol instead of trading every bar in the history file. On a broker-supplied symbol that usually means the strategy is trying to trade outside the session, which is the tester being realistic. On a custom symbol it usually means sessions were never defined during import, so the tester treats the symbol as closed for the whole run and produces no trades at all. Fix it in the symbol specification, not in the expert advisor.

Is market closed an error I need to fix?

No. It is the platform correctly refusing an order that could not be executed, and an automated system meeting it is behaving properly. It only warrants attention when it appears during hours you expect to be open, which usually means a server-time offset mistake or a symbol your account type does not carry.

Related problems

Further reading

Gold trading hoursAll troubleshootingContact support

Educational information only, not financial advice. Trading leveraged products carries substantial risk of loss. Last updated 2026-09-04.