Skip to content
AlgoVerdict

News Filter Foghorn: A Free Economic Calendar Guard for MetaTrader 5 – Every Setting Explained

Last updated: 09 October 2026

High-impact news such as Non-Farm Payrolls, a CPI release or a central bank rate decision can move a market in seconds. Spreads widen, prices gap, and a pending order fills far from where you placed it. Many EAs have no news filter of their own, and the ones that do each use their own source and their own rules. Why news hits automated strategies so hard is covered in the guide News filters for EAs.

The News Filter Foghorn works at the level of the account, not of a single EA. It reads the economic calendar built into MetaTrader 5, shows the next events, and alerts you before a news window starts. If you switch it on, it also deletes pending orders, closes positions, closes trades opened during the news, and publishes a pause flag that your own EAs can read. It never opens a trade.

Status 9 October 2026: Foghorn 1.0 is finished (test status below) but not yet released on the MQL5 Market. It is planned as a free product. There are no user reviews yet.

Foghorn panel with the amber status NEWS IN 22:48 (window in 07:48), only the ALERT action tag lit, watching EUR and USD (auto). Below it the next eight events in server time, led by US Nonfarm Payrolls on Friday at 15:30, nothing affected right now, and the note Panel/alert mode - enable actions in the inputs. Next to it a EURUSD chart with dashed red and amber vertical lines at the upcoming events
Panel layout 1:1 from Foghorn v1.0 with default inputs: alert only, AUTO currencies, high impact, 15/15 minutes. Events and chart are an illustration in server time.

What a news window is

For every event that counts, Foghorn builds a window from a number of minutes before to a number of minutes after the event time, by default 15 and 15. With an event at 15:30, the window runs from 15:15:00 to 15:44:59. Overlapping windows, such as an ECB decision at 15:15 and US retail sales at 15:30, merge into one.

Which events count:

  • Impact filter: high impact only (default), or high and medium.
  • Keywords that also count at medium impact (default Non-Farm,FOMC,CPI,Interest Rate): a medium-impact event whose title contains one of them counts even with the high-only filter. The panel marks it with *. Matching ignores case, spaces and punctuation, so "Non-Farm" also finds "Nonfarm Payrolls".
  • Exclude list (default Speaks,Speech): drops medium- and low-impact events with these words in the title, for example routine speeches of central bank members. A high-impact event always counts, even if it matches.
  • Ignored: events without an exact time (date only, no time, tentative), holidays and worldwide events. Low-impact events never count.

Which currencies count:

  • AUTO (default): the currencies of the chart symbol and of every symbol with an open position or pending order. The list follows new trades immediately. Forex pairs use base and quote (EURUSD → EUR and USD). Metals, indices and crypto use the profit currency, the base if it is a real currency, and USD (XAUUSD → XAU and USD, GER40 → EUR and USD, BTCUSD → USD). Exception: if the broker gives such a symbol two real currencies, it is treated like a forex pair and USD is not added automatically. If you need USD anyway, add it under AUTO: always watch these too.
  • AUTO: always watch these too adds currencies, for example USD,JPY for an EA that has no trade open yet.
  • Manual list: only the currencies you enter, for example USD,EUR,GBP.

A symbol is affected while one of its currencies has an active window.

The five actions

Each action is a switch. Out of the box only the alert is on: you see the panel and get alerts, and nothing is deleted or closed until you decide otherwise.

ActionDefaultWhat it does
AlertonBefore the window (default 30 minutes ahead), at its start and at its end. Popup on; push to the MetaTrader mobile app and sound optional.
Delete pending ordersoffAt window start, deletes pending orders on affected symbols that were placed before the window.
Close positionsoffAt window start, closes positions on affected symbols: all of them, or only those in loss at that moment.
Close / delete trades opened inside the windowoffA position opened or a pending order placed during the window on an affected symbol is closed or deleted right away.
Publish the pause flagoffWrites terminal variables that your own EAs can read before they trade (see below).

When actions run, you get one popup or push message per window; further actions in the same window go to the journal only.

Foghorn panel in red status NEWS WINDOW until 11:45 server, with the German Flash Manufacturing PMI row at 10:30 outlined in red and marked LIVE, watching EUR, USD, GBP and XAU, affected symbol EURUSD. Next to it five cards for the actions Alert (default on), Delete pending, Close positions, Block new and EA flag (each default off), and a red card stating that MT5 lets no program stop another one from sending orders
Panel layout 1:1 from Foghorn v1.0: merged window around the flash PMIs at 10:30, 11:00 and 11:30, all five actions switched on for the example.

How closing works

Close and delete requests go through a queue: pending orders first, then positions, the largest loser first. A failed request is retried after 2 seconds, 10 seconds and then every 60 seconds. After 10 failures Foghorn gives up on that position or order for the rest of the window.

  • No requests into a closed market. Foghorn checks the symbol's trade mode and session first. The item waits, and the panel shows "Market closed on …".
  • Nothing after the news. If the window ends before a queued item could be sent, the item is dropped. Foghorn never closes anything after the window.
  • Daily request budget. At most 100 close and delete requests per server day (adjustable). This protects you from an endless loop when another EA keeps reopening trades.
  • Netting accounts: there is one position per symbol, shared by every EA and by manual trading. Closing it affects all of them, and volume added during the window keeps the original open time, so it is not caught as a new trade. If several EAs trade the same symbol, a hedging account is the better choice.

A pending order placed before the window that fills during it becomes a new position, and the "opened inside the window" action closes it. If you want to avoid that, also switch on Delete pending orders.

The pause flag for your own EAs

This is the part that can actually keep an EA out of the news before it trades, but only an EA whose code you can change. With Publish the pause flag on, Foghorn writes terminal GlobalVariables (F3 in MetaTrader shows them), where <login> is your account number:

  • FOGHORN_<login>_PAUSE: end of the active window, 0 when clear
  • FOGHORN_<login>_PAUSE_<CCY>, for example ..._PAUSE_USD: the same per currency
  • FOGHORN_<login>_NEXT: time of the next watched event
  • FOGHORN_<login>_CALOK: 1 if the calendar data is current and the terminal is connected, otherwise 0
  • FOGHORN_<login>_HEARTBEAT: refreshed every 10 seconds, but only while CALOK is 1

A flag is valid only while the current time is before its value, CALOK is 1 and the heartbeat is younger than 120 seconds. A crashed or removed Foghorn, or one without reliable calendar data, therefore never reports "clear" by mistake. Your EA sees "no Foghorn" instead and decides for itself: trade normally (fail-open) or pause (fail-safe). The manual contains a ready MQL5 function of about ten lines for this.

MQL5 code of the function FoghornPause from the Foghorn manual, which checks heartbeat, CALOK and the PAUSE variable before an EA trades. Next to it the five GlobalVariables PAUSE, PAUSE_USD, NEXT, CALOK and HEARTBEAT with their meaning, and the notes Never a false clear and Same terminal only
The pause flag only works in EAs whose code you can change. Other EAs keep trading; Foghorn can only act afterwards, if you switch that on.

GlobalVariables belong to one terminal. An EA running in another terminal or on another server sees no heartbeat, which means "no Foghorn".

The panel

The status box shows:

  • CLEAR (green): no window close, calendar up to date, terminal connected.
  • NEWS IN mm:ss (window in mm:ss) (amber): a window is closer than the alert lead time. The first countdown runs to the event, the second to the start of the window.
  • NEWS WINDOW until hh:mm server (red): a window is active.
  • CALENDAR UNAVAILABLE (amber): no calendar data since the start.
  • CALENDAR STALE – last update hh:mm (amber): the last refresh failed or was incomplete, or the last good data is older than 60 minutes. Foghorn keeps using the last good data.
  • NOT CONNECTED (amber): the terminal has been offline for more than 5 minutes.
  • NO CALENDAR IN STRATEGY TESTER (grey) and DISPLAY ONLY (another chart in the same terminal runs Foghorn for this account).

Foghorn never shows CLEAR while the calendar is unavailable or stale or the terminal has been offline for more than 5 minutes. In those states the pause flag reports CALOK = 0, so an EA that reads it never gets a false "clear". Below the status: which actions are on, which currencies are watched, the next 8 events with day, time, countdown, currency, impact and title (titles longer than 34 characters are cut and end in "…"; hover the chart line for more), the symbols affected right now, the time of the last calendar update and the number of requests sent today. REFRESH reloads the calendar; it also reloads every 15 minutes, or every minute after a failure. Optional dashed vertical lines on the chart mark the upcoming events. The panel has no destructive buttons.

Every setting

GroupSettingDefault
CalendarImpact filterHigh impact only
CurrenciesAUTO
Manual list (used with "Manual list")USD,EUR,GBP
AUTO: always watch these tooempty
Keywords that also count at medium impactNon-Farm,FOMC,CPI,Interest Rate
Exclude events containing (below high impact only)Speaks,Speech
WindowWindow starts X minutes before the event15
Window ends X minutes after the event (at least 1)15
ActionsAlert before the window, at start and at endon
Alert lead time in minutes30
Delete pending orders on affected symbolsoff
Close positions on affected symbolsoff
Which positions to closeAll (or only losing)
Close / delete trades opened inside the windowoff
Publish the pause flagoff
ScopeMagic numbers to act onempty = all trades; 0 = manual trades only; 12345,777 = only these EAs
Never touch these symbolsempty, e.g. BTCUSD,ETHUSD
Max close/delete requests per day100
NotificationsPopup / push / soundon / off / off
PanelX / Y offset12 / 24
Vertical lines for upcoming eventson

Trades outside the scope are never deleted or closed, and in AUTO mode their currencies are not watched. Changing an input or the timeframe starts Foghorn fresh: nothing queued before is executed, and the calendar is reloaded.

Setting up

  1. Make sure the calendar is on: Tools → Options → Server → Enable news.
  2. Open one chart (any symbol, any timeframe) and drag Foghorn onto it. One Foghorn per account is enough.
  3. If Foghorn should delete or close anything, switch on Algo Trading in the toolbar and allow algo trading in the EA's Common tab.
  4. Start with the alert only and watch a few news days. Then switch on the actions you want.
  5. Keep the terminal running. Deleting and closing only happen while it is connected; a VPS helps.

Status and testing

Status 09.10.2026, tested in the Strategy Tester on a RoboForex demo account, with the final build after an external code review by three AI models from other providers (GPT, Gemini, DeepSeek), whose valid findings were fixed:

  • Self-test: 162 of 162 checks passed.
  • Validator-style run: the Market build on EURUSD H1 with real ticks from 01.01. to 08.10.2026 – 0 error lines. An earlier version also ran on XAUUSD D1 and USDJPY M30, likewise with 0 error lines.
  • Live on the demo account: the economic calendar loads and the panel lists the next events. A second copy shows DISPLAY ONLY.
  • What the tester cannot show: the economic calendar does not exist in the Strategy Tester, so the self-test checks the calendar logic with synthetic events.
  • Still open: the official check by the MQL5 validator and the release on the MQL5 Market (planned free).

Foghorn gets no AlgoVerdict grade: our methodology rates brokers, prop firms and Expert Advisors with their own strategy, and Foghorn has no strategy.

Honest limits

  • It cannot block other programs. MetaTrader 5 does not let one program stop another from sending orders. Foghorn acts afterwards, unless your EA reads the pause flag.
  • It depends on the MT5 calendar. If your broker's terminal has no news feed, there is no data; the panel says so. A changed event time is seen at the next refresh (at most 15 minutes, or REFRESH).
  • Worldwide events (currency "ALL") are ignored.
  • No partial closes: positions are closed in full.
  • Prop firms with news rules: a news filter is not a rule monitor. Which firms count a news trade as a breach, and how a guard handles that, is covered on the page about the Prop Firm Guard Plimsoll.
  • It only acts while the terminal runs and is connected.

Risk warning

Trading forex and CFDs on margin carries a high risk of loss. Foghorn reduces exposure to news only as far as the actions you switch on allow. It cannot remove the risk and guarantees no result.

Where to get Foghorn

Foghorn is to be released free of charge on the MQL5 Market in the Utilities category for MT5. As soon as it is live, the link to the product page will be here. An overview of all three free tools is on the page Free MT5 tools.

Read on: News filters for EAs · Prop Firm Guard Plimsoll · Daily Loss Guard Plimsoll Lite · VPS for EAs

Frequently asked questions

Can Foghorn stop my EA from trading during the news?

Not before the order is sent. MetaTrader 5 does not let one program block another program, the mobile app or a manual click. Foghorn can alert you, delete pending orders and close positions afterwards, and it can publish a pause flag. An EA whose code you can change reads that flag and does not trade; every other EA keeps trading, and Foghorn can only close what it opens if you switch that action on.

Does Foghorn open trades?

No. Foghorn never opens a trade. Its only trading actions are deleting pending orders and closing positions, and only the ones you switch on. By default only the alert is on, so nothing is deleted or closed.

Where does Foghorn get its news from?

From the economic calendar that is built into MetaTrader 5. It needs no internet function of its own. In the terminal, Tools → Options → Server → Enable news must be ticked, because the calendar comes with the news feed. If your broker's terminal provides no calendar data, the panel shows CALENDAR UNAVAILABLE.

Which time zone are the event times in?

In your broker's server time, the time of the chart and the Market Watch. Every time on the panel is server time. The MT5 calendar itself works in trade-server time, so there is no conversion from your PC clock.

Does Foghorn work in the Strategy Tester?

It runs without errors there, but it does nothing: the MT5 economic calendar does not exist in the Strategy Tester. The panel shows NO CALENDAR IN STRATEGY TESTER. To test your own EA's news logic, set the pause-flag variables yourself in the tester.

Do I need one Foghorn per chart?

No, one per account. A single Foghorn on any chart watches all symbols. A second copy on another chart of the same terminal shows DISPLAY ONLY and does nothing; it takes over within about 10 seconds if the first one stops. This only works within one terminal: copies in two terminals do not see each other.

Is Foghorn really free?

Yes. It is planned as a free product on the MQL5 Market: fully working, no time limit, no nag screens and no upgrade prompts inside the program.