Trading Hours Filter for MT4: 386 of 1,360 Time Windows Made Money, 18 of 417 on EURUSD M5, and the Best Early Window Beat All-Day Trading in 6 of 12 Runs

Key takeaways
- MT4 has no trading hours switch for manual trading. A time filter is a pair of inputs in an Expert Advisor or indicator, a start hour and an end hour, and both are read in broker server time, not your local time.
- I tested 1,728 time windows: every start hour, six lengths from 2 to 12 hours, three entries, EURUSD and gold, M5 and M15. 386 of the 1,360 windows with enough trades made money after cost.
- On EURUSD M5 it was 18 of 417. On gold M5 169 of 405, on EURUSD M15 88 of 289, on gold M15 111 of 249. The chart decided far more than the window.
- The best window of the first half beat all-day trading in the second half in 6 of 12 runs, a coin flip, and made money in 4 of 12.
- What the hour does control is cost: a 1-pip spread is 49% of an M5 stop at 04:00 UTC and 22% at 14:00. It did not show up in the result: -1.07 pips a trade from 07:00 to 18:00 UTC, -1.06 in the other hours.
A trading hours filter is one of the first inputs people change on an Expert Advisor. Set the start hour, set the end hour, and the robot only works when the market is “good”. This guide shows how to set that filter correctly in MT4, where most mistakes are about time zones, and then what 1,728 tested windows say about which hours to put in it.
How do you set a trading hours filter in MT4?

There is no menu for it. MT4 will take a manual order at any hour the market is open, and standard indicators draw signals around the clock. A time filter exists in three forms:
- An input in an Expert Advisor. Open the EA’s properties (F7 on the chart), go to the Inputs tab and look for a pair such as StartHour and EndHour, or TradeFrom and TradeTo. Names differ, the idea is the same.
- An input in a custom indicator that only draws arrows or sends alerts inside the window.
- A session indicator that shades the hours on the chart, so you apply the filter by eye.
To see the day boundaries on any chart, press Ctrl+Y for period separators. The vertical lines sit at 00:00 server time.
What time does MT4 use: local, GMT or server?

Server time. Every bar on an MT4 chart is stamped with the broker’s clock, and an EA that reads the hour gets the server hour. Your computer’s time zone does not matter. This is where time filters go wrong: a window copied from an article in GMT is typed into an EA that counts in server time, and it ends up two or three hours off.
Find your offset first. The Market Watch window (Ctrl+M) shows the current server time in its header. Compare it with the current UTC time. Most forex brokers run GMT+2 in winter and GMT+3 in summer, so the daily candle closes at 5 p.m. New York all year.
| Window | UTC, summer | New York | Server GMT+3 (summer) | StartHour / EndHour |
|---|---|---|---|---|
| Asia | 00:00 to 07:00 | 8 p.m. to 3 a.m. | 03:00 to 10:00 | 3 / 10 |
| London morning | 07:00 to 12:00 | 3 a.m. to 8 a.m. | 10:00 to 15:00 | 10 / 15 |
| London and New York overlap | 12:00 to 16:00 | 8 a.m. to noon | 15:00 to 19:00 | 15 / 19 |
| New York afternoon | 16:00 to 21:00 | Noon to 5 p.m. | 19:00 to 24:00 | 19 / 24 |
| Rollover hour | 21:00 to 22:00 | 5 p.m. to 6 p.m. | 00:00 to 01:00 | 0 / 1 |
On a broker that follows New York daylight saving, the server is always 7 hours ahead of New York. So the server-time column holds all year, and the UTC column moves one hour later in winter. If your broker’s server is on plain GMT or another offset, shift the last two columns by the difference.
Two details to check on any EA: whether the end hour is included or excluded, and whether a window that crosses midnight (start 22, end 2) is handled. Run the EA in the Strategy Tester for one week and read the trade times in the Results tab before you trust it. The tester setup is in my EA backtest guide.
How were the windows tested?
- Windows: 24 start hours times 6 lengths (2, 3, 4, 6, 8 and 12 hours) = 144 windows, in UTC.
- Entries: EMA 9/21 cross; RSI 14 returning from 30 or 70; Stochastic 14, 3, 3 crossing below 20 or above 80. Signals outside the window are dropped before the run.
- Charts: EURUSD, June 3 to August 26, 2026, 16,926 M5 and 5,642 M15 bars; gold, June 16 to August 26, 13,736 M5 and 4,577 M15 bars.
- Exit and cost: stop 1.5 ATR, target 3 ATR, 48 bars at most, one trade at a time; 1 pip on EURUSD and $0.30 an ounce on gold, from my spread and swap measurement.
That is 144 windows on 12 entry-and-chart runs, 1,728 in total. 1,360 of them had at least 30 trades and are counted below.
How many time windows made money?
| Chart | Windows with 30+ trades | Made money after cost | Share | Made money in both halves | Entries profitable with no window |
|---|---|---|---|---|---|
| EURUSD M5 | 417 | 18 | 4% | 7 | 0 of 3 |
| Gold M5 | 405 | 169 | 42% | 88 | 1 of 3 |
| EURUSD M15 | 289 | 88 | 30% | 18 | 1 of 3 |
| Gold M15 | 249 | 111 | 45% | 64 | 2 of 3 |
| All | 1,360 | 386 | 28% | 177 | 4 of 12 |
Twenty-eight percent of windows made money. With no window at all, 4 of the 12 runs made money, which is 33%. So choosing hours did not raise the odds. It reshuffled them.
The split follows the chart, not the clock. On EURUSD M5 the EMA cross lost in all 144 windows, every start hour and every length, and the Stochastic made money in 4 of 144. On gold M5 the EMA cross was already profitable all day at +$1.20 an ounce a trade, and 72 of its 139 windows were profitable too. A window on a rule that works keeps part of what works. A window on a rule that loses keeps part of the loss.
Is a short window better than a long one?
| Window length | Windows with 30+ trades | Made money | Share |
|---|---|---|---|
| 2 hours | 135 | 29 | 21% |
| 3 hours | 190 | 47 | 25% |
| 4 hours | 220 | 63 | 29% |
| 6 hours | 253 | 82 | 32% |
| 8 hours | 274 | 81 | 30% |
| 12 hours | 288 | 84 | 29% |
No. Narrow windows were the least likely to make money, and they are also the ones that most often fail to reach 30 trades in 12 weeks: only 135 of 288 two-hour windows did. A tight window looks precise. In the data it is mostly a small sample.
Does the best window keep working?
This is the real question for anyone running an optimizer over StartHour and EndHour. For each of the 12 runs I picked the best window on the bars before July 15, then looked at that same window on the bars after it.
| Entry and chart | Best window before July 15 (UTC) | Before | Same window after | All day, after |
|---|---|---|---|---|
| EMA cross, EURUSD M5 | 22:00 to 24:00 | +0.16 | -2.42 | -1.59 |
| RSI, EURUSD M5 | 11:00 to 14:00 | +1.70 | -1.25 | -0.85 |
| Stochastic, EURUSD M5 | 12:00 to 14:00 | +1.16 | -0.09 | -1.03 |
| EMA cross, gold M5 | 13:00 to 16:00 | +6.02 | +4.06 | +1.45 |
| RSI, gold M5 | 23:00 to 01:00 | +5.63 | +1.59 | -1.05 |
| Stochastic, gold M5 | 14:00 to 16:00 | +5.64 | -2.08 | -0.85 |
| EMA cross, EURUSD M15 | 13:00 to 17:00 | +5.69 | -0.62 | +0.03 |
| RSI, EURUSD M15 | 11:00 to 15:00 | +7.09 | -2.19 | -0.84 |
| Stochastic, EURUSD M15 | 13:00 to 15:00 | +3.26 | -0.96 | -2.06 |
| EMA cross, gold M15 | 08:00 to 16:00 | +6.34 | -1.55 | +0.96 |
| RSI, gold M15 | 23:00 to 07:00 | -1.01 | +3.33 | -0.94 |
| Stochastic, gold M15 | 15:00 to 21:00 | +11.57 | +3.97 | -0.78 |
Per trade after cost: pips on EURUSD, dollars an ounce on gold. Windows needed at least 15 trades in each half to be ranked.
The optimized window beat plain all-day trading in 6 of the 12 runs and lost to it in the other 6. It made money in 4 of 12, all on gold, where the first half is short because the data starts on June 16. The EURUSD M15 RSI window fell from +7.09 pips a trade to -2.19.
Across every window, not just the winners: 422 windows made money before July 15, and 139 of them, 33%, made money after it. Of all 1,197 ranked windows, 308 made money after July 15, 26%. Across all charts 33% of the windows that made money before July 15 made money after it, against 26% of all windows. That lift is the chart, not the window: on gold M5 it was 42% against 47%, on EURUSD M15 17% against 22%, on gold M15 43% against 42%. Inside a chart, past profit told nothing.
The same thing happens with any optimized input. When I tuned indicator settings on one half of these bars and ran them on the other, the ranking carried over at 0.063, as shown in EA optimization in-sample vs out-of-sample. Hours are one more parameter to overfit, and the plain default often holds up as well as the tuned value, as in optimized vs default settings.
What does the hour really change?
The size of the bars, and with it the weight of the spread.
| Hour (UTC) | EURUSD M5: median ATR | Spread share of a 1.5 ATR stop | EURUSD M15: spread share | Gold M5: spread share |
|---|---|---|---|---|
| 04:00, Asia | 1.36 pips | 49% | 22% | 5.0% |
| 08:00, London | 2.29 pips | 29% | 17% | 4.5% |
| 14:00, overlap | 3.03 pips | 22% | 13% | 2.5% |
| 20:00, late New York | 1.48 pips | 45% | 18% | 5.7% |
This pattern is stable. Ranking the 24 hours by range before July 15 and after it gave almost the same order, a match of 0.98 on EURUSD M5, against 0.22 for the ranking by profit. The full hour-by-hour table is in the session time filter test.
So the hour reliably sets how big the spread is next to your stop. In this test that did not turn into a better trade: the wide hours lost as many pips per trade as the thin ones. And the hour cannot tell you when your entry will be right.
What to put in StartHour and EndHour
- Convert to server time first. Check Market Watch against UTC and write the offset down. On a GMT+3 summer server the overlap is 15 to 19.
- Use a window to match your own screen time, not to improve the signal. Thin hours cost more per unit of risk: with the lot sized from the stop, trades opened outside 07:00 to 18:00 UTC on EURUSD M5 lost 0.42 of a stop each against 0.31 inside it, a gap at the edge of sampling noise. Per trade in pips there was no difference: -1.07 inside, -1.06 outside. The hour-by-hour range is in best hours to trade EURUSD.
- Keep it wide. Six hours or more. Two-hour windows made money least often and gave too few trades to check.
- Skip the first server hour of the day. 21:00 UTC in summer, 00:00 on a GMT+3 server, cost the EMA cross 4.65 pips a trade on EURUSD M5 (41 trades, 3 winners), and broker spreads widen there.
- Do not optimize the hours. If the Strategy Tester’s best StartHour and EndHour look much better than their neighbors, treat that as a warning. The best window here was a coin flip afterwards.
- Fix the entry or the timeframe first. No window made the EMA cross profitable on EURUSD M5. How the time window compares with an ADX or trend filter is in time filter vs ADX filter.
Frequently asked questions
How do I set trading hours on an MT4 Expert Advisor?
Press F7 on the chart, open the Inputs tab and set the start and end hour inputs, in broker server time. MT4 itself has no trading hours setting, so the EA must have these inputs built in.
Is MT4 time GMT?
Usually not. Charts show the broker’s server time, most often GMT+2 in winter and GMT+3 in summer. Compare the time in the Market Watch header with UTC to find your offset.
What are the London and New York overlap hours in MT4 server time?
12:00 to 16:00 UTC in summer, which is 15:00 to 19:00 on a GMT+3 server and 8 a.m. to noon in New York. On a server that follows New York daylight saving, 15:00 to 19:00 holds all year.
What are the best trading hours for an EA?
No window was reliably best. Of 1,360 tested windows 386 made money, about the same rate as trading with no window. The best window before July 15 beat all-day trading afterwards in 6 of 12 runs.
Should I optimize StartHour and EndHour in the Strategy Tester?
I would not. Inside one chart, a window that had made money was no more likely to make it again: 42% against 47% for any window on gold M5. Choose hours for your own schedule.
Want a clean indicator to install right now?
It is my own enhanced DeMARK Trend Line indicator for MetaTrader 4 and 5. Non repaint, clean, and free.

