← News & Events

Trading Around News Automatically: Building a News Filter

13 Nov 2026 · 2 min read

BullsEdges algo trading guide: A news filter pauses an EA around high-impact releases. Here is how to design one: data source, importance, currencies, time windows and common bugs.

A news filter is one of the simplest and most effective additions to an automated strategy. It stops the EA opening new trades during the few minutes each week when spreads, slippage and price spikes are worst.

BullsEdges algo trading application: Specify how the news filter handles unavailable calendar data and whether it blocks new entries while continuing to manage existing trades.

Where the event data comes from

  • MT5 economic calendar: built into MetaTrader 5 and readable from MQL5 with the Calendar functions. It covers most major countries with importance levels.
  • External calendars: downloaded from a website or API. More flexible, but needs maintenance and can break.
  • Manual lists: typed-in dates and times. Simple, but easy to forget and error-prone.

For an EA running on MT5, the built-in calendar is usually the most reliable choice.

Design decisions

1. Which currencies

Filter by the currencies your symbol actually reacts to. For gold: USD first, and often EUR, GBP and CHF for big releases. For EURUSD: USD and EUR.

2. Which importance

MT5 labels events as low, medium or high importance. Many traders block medium and high, and ignore low. Check what is in each category for your currencies before deciding.

3. The time window

How long before and after an event to pause. Common choices:

  • 15-30 minutes before, 15-30 minutes after for medium events.
  • 30-60 minutes before and after for high-impact events like NFP, CPI and FOMC.

Longer windows are safer but cost trading time - on busy days, overlapping windows can pause the strategy for hours.

4. What the pause does

  • Block new entries only (most common), or
  • also close or protect open positions, or
  • stop adding to grids and baskets.

5. When to resume

Resuming exactly at the end of the window or on the next bar both work. Resuming on a new bar avoids starting in the middle of a messy candle.

The most common bug: time zones

MT5 calendar event times are in the trade server's time, not GMT. If the EA compares them with TimeGMT() on a GMT+3 server, every pause happens three hours late - after the spike, not before it. Always compare calendar times with the server clock (TimeTradeServer or TimeCurrent), and print the event and its time when the pause starts so you can check.

Testing a news filter

The MT5 calendar is not available in the Strategy Tester, so news filters cannot be backtested directly there. Options:

  • Export historical event times and replay them in a custom backtest.
  • Forward test and confirm in the Experts log that pauses start and end at the expected times.

BullsEdges takeaway for algo trading

A good news filter is short to write and saves a lot of avoidable losses. Choose currencies and importance carefully, use the right clock, and log every pause so you know it is working.

Trading forex and gold carries a high level of risk and may not be suitable for every investor. Past performance and backtests do not guarantee future results. This article is education, not financial advice.

Start your 1 month free trial

Full access to the Finoways Forex & XAUUSD algo, setup support included.