Homeใ€€>ใ€€EA & MT5 Knowledge Baseใ€€>ใ€€Economic News Filter Setup

Economic NewsRisk ManagementIntermediate

Setting Up the Economic News Filter โ€” Protecting Your Account from Volatile Moves

Last updated: 2026-05-20 | Estimated reading time: 13 min

Around the release of major economic data โ€” such as NFP or FOMC decisions โ€” markets can move sharply within seconds and spreads can spike dramatically. Even a well-performing EA can suffer a significant loss from a single violent move during these windows. The economic news filter automatically pauses trading during these high-risk periods.

Why trading around news releases is dangerous

When major economic data is released, market participants react simultaneously, driving price sharply in one direction within seconds. Trying to predict the outcome is essentially impossible โ€” it is closer to gambling than trading.

A further problem is the deterioration in execution quality. At the moment of a release, spreads can expand to 5โ€“10 times their normal level and slippage increases significantly. Stop-loss orders may be filled at prices far worse than expected โ€” an effect known as "gapping" โ€” which breaks the EA's risk calculations.

The purpose of the economic news filter is not to profit from news releases. It is to avoid time windows where price action is unpredictable and execution quality is poor. Think of it as a defensive tool.

Economic events that demand the most caution

The following events have the largest market impact and should be avoided around their release times.

US Non-Farm Payrolls (NFP)

Released on the first Friday of each month. US non-farm employment change. The single most market-moving release for the dollar, GOLD, and equity indices.

FOMC (US Monetary Policy)

Policy rate decision and press conference. Eight times per year. Changes in the rate outlook move all major currency pairs.

CPI (Consumer Price Index)

The key inflation indicator. Directly tied to monetary policy expectations, with a large impact on the dollar and GOLD.

Central bank policy rate decisions

ECB, Bank of Japan, Bank of England, and others. Causes sharp moves in the relevant currency pairs.

Economic calendars rate events by impact level โ€” typically low, medium, or high. As a minimum, avoid "High" impact events; avoiding "Medium" and above is safer still.

How the economic news filter works

The economic news filter monitors the economic calendar and automatically stops new entries as an upcoming event approaches. Once a set amount of time has passed after the release, trading resumes.

The EAs on this site implement this feature through a shared module called EconomicFilter.mqh. Place this file in MQL5/Include alongside your EA to activate parameters such as UseEconomicFilter.

Because the filter relies on the economic calendar, MT5 must have news reception enabled. Go to Tools โ†’ Options โ†’ Server and confirm that "Enable news" is checked.

Configuring the filter parameters

The main parameters for the economic news filter and their recommended values are listed below.

ParameterDefaultDescription
UseEconomicFiltertrueEnables the economic news filter
NewsAvoidMinutesBefore30How many minutes before a release to suspend trading
NewsAvoidMinutesAfter30How many minutes after a release to keep trading suspended
NewsImpactLevel2Minimum impact level to filter. 1 = Low and above / 2 = Medium and above / 3 = High only
NewsTargetCurrenciesUSD,EUR,JPYCurrencies to filter (comma-separated). Leave blank to filter all currencies
CloseBeforeNewsfalseWhether to close open positions before a news event
30 minutes before and after is a reasonable starting point. For longer-term EAs, extending to 60 minutes is prudent; for shorter-term EAs, a tighter window may be appropriate. Adjust to match your strategy. Use CloseBeforeNews=true if you do not want to hold positions through a news release.

When to use the filter โ€” and when you don't need it

The economic news filter is not a universal solution. Its value depends on the nature of the EA.

EA typeFilter recommendation
Short-term / scalpingStrongly recommended. Most exposed to sharp moves and spread spikes
Day trading (H1โ€“H4)Recommended. Avoids unfavorable fills around news releases
Long-term trend followingOptional. Closing positions is rarely necessary, but pausing new entries is worthwhile
Martingale / grid (averaging down)Managing position size before a release matters more than simply pausing new entries
Over-filtering reduces trading opportunities. Compare backtest results with and without the filter to see how your metrics change, then make an informed decision about the settings.

๐Ÿ“‰ Strengthen your defenses against sharp moves

The economic news filter is just one layer of protection. Review how to handle losing streaks and drawdown as well.

Read the drawdown guide โ†’

Frequently Asked Questions

Q: Should I always use the economic news filter?

It is strongly recommended for short-term and scalping EAs, which are most exposed to sharp moves and spread spikes. For long-term trend-following EAs the impact is smaller, so it is optional โ€” but at a minimum, pausing new entries around high-impact events is worthwhile.

Q: How wide a window should I set around a release?

30 minutes before and after is a sensible starting point. For longer-term EAs or high-impact releases such as NFP and FOMC, extending to 60 minutes on each side adds an extra margin of safety. For short-term EAs a narrower window may work. Compare backtest results to find the right balance.

Q: Will using the filter improve my EA's performance?

Not necessarily. It reduces dangerous trades but also reduces trading opportunities. Compare backtest results with and without the filter, paying attention to how net profit and drawdown change. In many cases, net profit dips slightly but drawdown shrinks and overall consistency improves.

Q: How do I confirm the filter is working?

Check the EA's Expert tab log. When the filter activates and suspends trading, it outputs a message to that effect. Also confirm that news reception is enabled in MT5 (Tools โ†’ Options โ†’ Server).

Q: What happens to positions I'm already holding when a news event is approaching?

By default, the filter only stops new entries โ€” existing positions remain open. If you do not want to hold positions through a news release, set CloseBeforeNews=true to close them beforehand. Keep in mind that doing so may mean exiting a position before a favorable move, so choose based on your strategy.