If you see "market closed" at the open, check your clock before you blame the broker.
Every time this has happened to me, the cause was on my side. Once it was the VPS clock drifting four minutes after a Windows update disabled time sync. Once it was a session template in my EA that still used summer time in November. Once it was me trying to trade a symbol whose trading session on that broker started an hour later than I assumed.
My checklist when it happens:
- Compare the VPS clock with an internet time server.
- Open the symbol specification and read the actual trading sessions for that day.
- Check if a holiday schedule applies; brokers publish these and they change.
- If an EA is involved, print the time it thinks it is to the log.
Only after that do I message support, and when I do, I include the server time from the platform, not my own.
The DST weeks in March and October are the worst, because the UK, US and broker server all change on different dates. I mark those weeks on my calendar and double-check every time-based rule before the first session.
Market closed errors at open: clock and session mismatches
-
LondonScalper
- Posts: 965
- Joined: Sat Sep 05, 2026 7:54 am
-
Shadow Trader
- Posts: 974
- Joined: Wed Sep 09, 2026 5:19 pm
Re: Market closed errors at open: clock and session mismatches
One more cause for your list: the first quote of the session arriving later than the session start on the spec sheet. My broker lists the Sunday open at the server's midnight, but on a quiet week the first EURUSD tick has landed two or three minutes after that, and every order sent before the tick came back as market closed.
So my EA no longer trusts the clock alone. It waits for a fresh tick with a timestamp inside the session, then adds a further two minutes before it is allowed to send anything.
The other one that looks identical is a symbol switched to close only. After an account migration I had a gold symbol that still showed prices but rejected new orders, and the journal message looked so similar that I lost twenty minutes chasing the clock.
On the DST point, servers that run on New York close time move with the US date rather than the UK one. The two or three week gap in March and the one week gap in autumn are when a session template written in London time is most likely to be an hour out.
Do you log the server time of the first tick each Sunday? It is a cheap way to spot drift before the Monday open.
So my EA no longer trusts the clock alone. It waits for a fresh tick with a timestamp inside the session, then adds a further two minutes before it is allowed to send anything.
The other one that looks identical is a symbol switched to close only. After an account migration I had a gold symbol that still showed prices but rejected new orders, and the journal message looked so similar that I lost twenty minutes chasing the clock.
On the DST point, servers that run on New York close time move with the US date rather than the UK one. The two or three week gap in March and the one week gap in autumn are when a session template written in London time is most likely to be an hour out.
Do you log the server time of the first tick each Sunday? It is a cheap way to spot drift before the Monday open.
-
Shadow Trader
- Posts: 974
- Joined: Wed Sep 09, 2026 5:19 pm
Re: Market closed errors at open: clock and session mismatches
LondonScalper, one small disagreement on the first item of your checklist. On MT4 and MT5 the session check happens on the broker server, so a drifting VPS clock only bites when the EA reads local time instead of server time.
In my own code that meant swapping every TimeLocal call for TimeCurrent. The drift problem went away even before I fixed time sync on the machine.
The other window that throws market closed for me is the daily break around rollover. On my broker the indices pause from 23:59 to 00:05 server time, and an EA trying to trail a stop during those six minutes gets the same rejection a new order would.
Retry logic is worth a look while you are in there. My old EA resent every second, which meant around 360 rejected requests across one of those breaks, and the broker emailed to ask what was hammering the server.
Now it backs off to one attempt every 30 seconds after the second rejection, and writes the error code plus server time to the log. That single line has told me more than any support ticket.
Does your EA treat a rejected stop modification differently from a rejected entry? I think the stop case deserves a loud alert, since the position is still open.
In my own code that meant swapping every TimeLocal call for TimeCurrent. The drift problem went away even before I fixed time sync on the machine.
The other window that throws market closed for me is the daily break around rollover. On my broker the indices pause from 23:59 to 00:05 server time, and an EA trying to trail a stop during those six minutes gets the same rejection a new order would.
Retry logic is worth a look while you are in there. My old EA resent every second, which meant around 360 rejected requests across one of those breaks, and the broker emailed to ask what was hammering the server.
Now it backs off to one attempt every 30 seconds after the second rejection, and writes the error code plus server time to the log. That single line has told me more than any support ticket.
Does your EA treat a rejected stop modification differently from a rejected entry? I think the stop case deserves a loud alert, since the position is still open.