A trader contacted us last month. His EA lost 12% of his account on NFP night.
He'd left the EA running and gone to bed. The second the data dropped, EURUSD tanked 87 pips in 30 seconds, then bounced 65 pips. His trend EA shorted the crash, got stopped on the bounce, shorted again, stopped again. Four trades in a row, all losers.
The irony: half an hour after NFP, price was back where it started. If the EA had done nothing, the account would have been untouched.
This happens every month. The EA's strategy isn't wrong. The EA just doesn't know when to sit out.
Why news events destroy EAs
EAs trade on technical rules. During major data releases, the market ignores technicals completely and runs on reaction speed and emotion. Your EA encounters four problems simultaneously:
Spreads spike. EURUSD normally trades at 1.2 pips. During NFP, it can widen to 8–15 pips. The EA enters at what it thinks is a normal cost, but it just paid 10x the usual fee.
Slippage explodes. The EA sends an order at 1.0850. It fills at 1.0840. Ten pips of slippage on top of the widened spread.
Whipsaw price action. Price rockets one direction, then reverses violently. Trend following EAs get stopped on both sides. The signal was technically correct each time, but the market conditions made it impossible to profit.
Liquidity gaps. In extreme cases, there's no continuous pricing. Your stop loss gets jumped entirely, filling at a much worse level than intended.
None of this is the EA's fault. The solution is simple: don't trade during these minutes.
Which events matter
Not every economic release needs a trading pause. Focus on high and medium impact events.
High impact — must pause
| Event | Currencies affected | Frequency | Typical move |
|---|---|---|---|
| Non-Farm Payrolls (NFP) | USD and all USD pairs | 1st Friday monthly | 50–150 pips |
| Fed rate decision (FOMC) | USD and all USD pairs | 8x per year | 30–100 pips |
| ECB rate decision | EUR and all EUR pairs | Every 6 weeks | 30–80 pips |
| CPI (inflation) | Corresponding currency | Monthly | 30–80 pips |
| GDP | Corresponding currency | Quarterly | 20–60 pips |
Medium impact — recommended to pause
| Event | Typical move |
|---|---|
| Retail sales | 20–50 pips |
| PMI (Purchasing Managers Index) | 15–40 pips |
| Employment data (non-US) | 15–40 pips |
| Central bank officials speaking | 10–30 pips |
Actual impact depends on how much the data surprises versus expectations. A CPI print that matches forecasts might move 10 pips. A shock reading can move 80+.
Three ways to implement a news filter
Method 1: MT5's built-in economic calendar
MT5 (Build 2085+) includes a native economic calendar accessible through the CalendarValueHistory() function. The EA queries upcoming events, filters by impact level, and checks whether the current time falls within a news window.
Advantages: no external dependencies, MetaQuotes maintains the data, and accuracy is high. Disadvantage: MT4 doesn't have this feature. If you're running MT4, you need another method. This is one of several reasons we recommend MT5 for EA development.
Method 2: External data source (CSV or web)
Many EAs pull data from ForexFactory's calendar or similar sources. Two approaches:
CSV file: download the weekly calendar, save as CSV, place it in the EA's data directory. The EA loads it on startup and parses event times, impact levels, and affected currencies. Stable and reliable, but you need to update the file weekly (manually or via script).
Web request: the EA uses WebRequest() to fetch calendar data directly from a website. No manual updates needed, but if the site redesigns or your VPS loses internet, the filter silently stops working. Always have a fallback.
Method 3: Manual time parameters
The simplest option. You know NFP is the first Friday of every month at 12:30 UTC. You know the FOMC dates in advance. Hard-code these times into the EA's input parameters.
Zero dependencies, 100% reliable. The downside: you need to update it monthly. Forget to update and you have no protection. For traders running one or two EAs, this method takes two minutes per week and works fine.
How long to pause
The two key parameters are "minutes before event" and "minutes after event."
For high impact events (NFP, FOMC, central bank rate decisions): pause 30 minutes before, resume 30 minutes after. Total window: 60 minutes.
Why 30 minutes before? The market gets nervous ahead of major data. Spreads start widening, liquidity thins, and institutional players pull their limit orders. Your EA enters a degraded execution environment even before the data drops.
Why 30 minutes after? The first reaction to data is often a fake-out. Price spikes one direction, then reverses. The true direction typically takes 15–20 minutes to establish. Waiting 30 minutes lets the market digest the data and lets spreads normalize.
For medium impact events (CPI, GDP, retail sales): 15 minutes before, 15 minutes after. Total window: 30 minutes.
If multiple events cluster on the same day (CPI in the morning, FOMC in the afternoon), don't resume between them and then pause again. Keep the EA paused from the start of the first event's window to the end of the last.
The GMT offset trap
This is where most news filters break.
ForexFactory shows times in one timezone. Your MT4/MT5 server runs in another. Your local computer is in a third. Mix them up and your filter pauses at the wrong times.
Step 1: determine your broker's server timezone. In MQL, call TimeCurrent() and compare it to the actual GMT time. Most brokers run GMT+2 (winter) or GMT+3 (daylight saving).
Step 2: convert event times to server time. If NFP releases at 12:30 GMT and your server is GMT+2, the server time is 14:30. Your pause window is 14:00–15:00.
Step 3: add a GMTOffset parameter to the EA. Default it to 2. Users adjust based on their broker. Never use TimeLocal() for this calculation. That's your computer's clock, which might be hours different from the server.
Daylight saving time changes this offset twice per year (US: second Sunday of March and first Sunday of November; Europe: different dates). Your EA should either detect DST automatically or you need to manually update the offset four times per year. We've seen traders lose money because their news filter was an hour off after a DST change.
What to do with open positions during the pause
Three approaches, depending on your strategy and risk tolerance.
Pause new entries only, keep existing positions. The most common approach. The EA stops opening new trades but manages existing ones normally (stop loss and take profit stay active). Works well if your stop loss is wide enough to handle news volatility. A 50-pip stop loss on EURUSD will usually survive an NFP move. A 15-pip stop might not.
Pause new entries and move existing positions to breakeven. While pausing, move the stop loss of any profitable position to the entry price. If news causes a violent reversal, you don't lose money on those positions. Only works if the position is already in profit and has enough buffer that the breakeven stop won't get hit by normal pre-news noise.
Close everything. The most protective option. Close all positions at the start of the news window, and let the EA look for fresh setups afterward. Best for scalping EAs where positions have tiny floating profits that wouldn't survive a news spike. The tradeoff is that forced closures disrupt the EA's trading rhythm and might reduce overall returns.
We typically use the first or second approach. The third seems safest but can actually hurt performance over time by interrupting valid trades.
One thing most people miss: pending orders. If your EA placed a Buy Stop at a key level, and news causes a price spike that triggers it, the pending order fills at the worst possible moment. During the pause window, delete all pending orders and recalculate them after trading resumes.
Common setup mistakes
Wrong timezone conversion. The event time you copied from ForexFactory is in EST. You entered it directly into the EA parameters, but the EA uses GMT+2 server time. The filter is off by 7 hours. Always convert to a single timezone before comparing.
Forgetting pending orders. The filter stops new market orders but leaves pending orders active. News spikes trigger the pending order, and you lose money despite the "filter." Delete pending orders when pausing.
Ignoring DST switches. Your GMT offset is correct for 6 months, then DST changes and it's wrong by an hour. The filter pauses too early or too late. Check your offset at every DST transition.
Filtering irrelevant currencies. If your EA trades EURUSD, Japan's GDP data doesn't affect you. But US CPI affects every USD pair. The filter should only respond to events relevant to the EA's trading symbol. Over-filtering means the EA is idle too often.
Never verifying the filter works. After setup, manually monitor the EA during at least one NFP release. Confirm it actually paused at the right time, didn't open positions during the window, and resumed correctly afterward.
FAQ
My EA doesn't have a news filter. What can I do?
Two options. Ask the developer to add one. Most will, since it's a common request. Or install a standalone news filter EA that runs alongside your trading EA. It doesn't trade itself; it just disables auto-trading permissions during news windows. Search "news filter" on MQL5 Market for free and paid options.
I only trade during the Asian session. Do I still need a filter?
Yes, but simpler. US and European data releases rarely fall during Asian hours, but Japanese and Australian data do. Bank of Japan rate decisions and Australian employment data can move USDJPY and AUDUSD significantly. Also check whether any US data releases in the early UTC morning overlap with your trading window.
Does the news filter work during backtesting?
Depends on the data source. Web-scraped data doesn't work in backtesting because there's no internet connection. CSV files can work if you prepare historical news data in advance. MT5's built-in calendar has partial support in the strategy tester. In practice, most traders don't enable news filtering during backtests and instead verify the filter's behavior on demo. This means your backtest results don't reflect the filter's impact, so live performance should theoretically be slightly better than the backtest.
Wouldn't a longer pause be safer? Like 2 hours before?
Safer in theory, but the cost is severe. If there are three high-impact events in a day and each pauses for 4 hours, your EA is idle most of the day. For short-term and scalping EAs, trading opportunities are already limited. The 30-minute window is a tested balance between protection and opportunity. We've used it across dozens of EAs at FXTool and it handles the vast majority of news volatility without over-filtering.
About the author: The FXTool team builds and tests MetaTrader trading tools daily. We run every EA we sell on live accounts and publish the results. This guide reflects what we've learned from building 50+ EAs and working with thousands of retail traders.
Forex trading involves significant risk and may result in total loss of capital. This article is for educational purposes only and is not investment advice. Understand the risks and consider your financial situation before trading.