Trading hours filter
Also called Time filter, Session filter, Trading time filter, Trading window, Time-of-day filter
A trading hours filter is a setting in an Expert Advisor or strategy that only allows new trades inside a chosen time window. Signals outside that window are skipped, for example in thin late-night hours or around the daily rollover.
A filter does not change what your strategy looks for. It only decides when a signal is allowed to become an order. That matters because the same signal can cost noticeably more to trade in a thin hour, when few buyers and sellers are active, so spreads widen and fills get worse. The worked example below shows how, and an automated strategy will take that signal anyway unless you tell it not to.
What a trading hours filter blocks and what it leaves alone
An Expert Advisor (EA) is a program that places trades for you by fixed rules. A trading hours filter adds one more rule: check the clock before opening anything.
Inside the window, the EA behaves normally. Outside it, signals are ignored. They are not saved for later.
Many traders end the window before the daily rollover, the moment the broker's trading day ends, when spreads often widen briefly.
Most filters block new entries only. Trades that are already open keep running with their stop loss and take profit. Some EAs add a separate option that closes everything when the window ends. These are two different behaviours, so find out which one yours has.
The timeline below shows an illustrative window from 08:00 to 20:00 on the broker's clock. A signal at 21:30 falls in the blocked part and is skipped.
What skipping thin hours saves: a worked example
The figures here are an illustrative example, not real quotes. Your EA trades 0.10 lots on a USD-quoted pair, which is 10,000 units and $1 per pip. Assume the spread (the gap between the buy and sell price) is 1 pip in busy hours and 4 pips in the thin hours on the broker's clock. Assume the EA takes 10 trades a month in those thin hours.
That $30 is paid before any trade wins or loses. To redo this for your own account, use: (thin-hour spread − normal spread) × pip value × number of trades in those hours.
The filter has a cost too. Some of the blocked trades would have been winners. Backtest the EA once with the filter on and once with it off, then compare both the net result and the number of trades. Only that comparison tells you which side is bigger for your strategy.
Many backtests use a fixed spread, so the thin-hour cost never shows up and the filter looks useless. Test with variable (real) spreads, or subtract the extra spread by hand using the formula above.
A rule for deciding: if (thin-hour spread − normal spread) in pips is larger than your average profit per trade in those hours, block them. Use the average from trades taken in those hours only, not from all hours, because a backtest result already includes the normal spread. In the illustrative example, say the trades in the thin hours average 2 pips of profit each: an extra 3 pips against an average of 2 pips per thin-hour trade means block.
How to pick your trading hours window
Run the backtest with the filter off, then group the results by the hour each trade opened on the broker's clock. For each hour, work out the net profit per trade. Remove the hours where it is negative, or where the extra spread eats the edge by the rule above. The hours that are left form your window.
Keep the window to the hours when your pair's main markets are open, because that is when most buyers and sellers are active. If the backtest suggests a profitable hour outside those markets, treat it with caution rather than adding it straight away.
Where you set the window on your trading platform
The filter lives in the EA's input settings, the list of options you see when you attach it to a chart. It usually appears as a start hour and an end hour. Some EAs add minutes, days of the week, or an earlier stop on Friday.
The hours are almost always read from the broker's server clock, not from your phone or computer. This is the most common misread. Before typing anything, compare the time on the newest candle or newest quote with your own clock. The difference is the offset.
To convert, use: server hour = your local hour + (server offset − your offset). As an illustration, say you are at UTC+7, the server runs at UTC+2, and you want the EA to start at 14:00 your time. 14 + (2 − 7) = 9, so you enter 9 as the start hour.
If the result is below 0, add 24. If it is 24 or more, subtract 24. With the same offsets, 02:00 your time gives 2 + (2 − 7) = −3, and −3 + 24 = 21, so you enter 21, which falls on the previous server day.
Checks before you let a filtered EA trade
- Overnight windows. If the start hour is later than the end hour, such as 22 to 6, confirm the EA treats it as crossing midnight. Some read it as "never trade". Watch one evening on a demo account to be sure.
- Clock changes. If the broker's clock shifts for daylight saving and yours does not, your window moves by an hour. Recheck the conversion after each change.
- Pending orders. Check whether the filter cancels pending orders when the window ends, or leaves them to fill in blocked hours.
- Open trade management. If the EA trails stops or adds to positions, confirm that this logic still runs outside the window. A filter that freezes everything can leave a trade unmanaged.
- Prop firm rules. If your account bans holding trades over the weekend or trading at certain times, an entry-only filter is not enough. You need the close-at-window-end option too.
- First-day log check. Compare the open time of every trade with your window. One trade outside it means the clock or the setting is wrong.
FAQ
Why did my EA take a trade outside its trading hours?
First check whether the trade came from a pending order placed inside the window that filled later. Then check whether another EA or a manual order on the same account opened it, because a filter only controls the EA it belongs to.
Should I use a trading hours filter on a 1-hour or daily strategy?
On a 1-hour strategy it works well, as long as the window edges sit on full hours so a signal at the candle close is not cut off. On a daily strategy the signal arrives once a day at the candle close, so a window that excludes that moment blocks every trade. Leave the filter off there, or make sure the window includes the daily close.
Does a trading hours filter also block news releases?
No. The filter follows a fixed clock window and does not know the economic calendar. A release is only avoided if it happens to fall in your blocked hours, so news needs its own separate setting or a manual pause.









