Economic news filter for MetaTrader 4 and 5
Put scheduled economic releases into your Expert Advisor’s entry rules. Match both currencies in a symbol, choose a window before and after each release, and handle missing data explicitly.
MT5 verified. Native parser, timer and public HTTPS checks pass. MT4 source preview. It compiles and passes native parser checks; timer callbacks and HTTPS still need verification in a working demo terminal.
Source package for MT4 and MT5. Your Expert Advisor remains in charge of orders; the filter supplies schedule context.
Check before a new entry
#include "FinanceCalendarNews.mqh"
string reason;
int state = FcNewsState(_Symbol, 30, 30, reason);
if(state != FC_NEWS_CLEAR)
return; // quiet window or unknown schedule
// Your own entry logicInitialize the filter and refresh it on a timer as shown below. FC_NEWS_CLEAR describes the recorded schedule, not market safety.
Three states, with a reason.
Quiet · 1
A relevant scheduled release falls inside your configured before/after window.
Clear · 0
The usable recorded schedule has no matching release inside that window.
Unknown · -1
A schedule is unavailable, stale, incomplete, or has uncertain timing. Your code can stand aside until usable data is available.
FcNewsBlocked() returns true for both quiet and unknown states. Use FcNewsState() when your tool needs to show the difference. The example EA displays the state and explanation on the chart.
MT5 passed native runtime and public HTTPS checks. MT4 source preview passed compiler and parser checks; connected-demo timer and HTTPS verification remain pending. See the release verification receipt. Test the setup and your own entry rules on a demo account before connecting them to your workflow.
Install and connect.
Download and extract the source package
The ZIP includes separate
MQL4/ExpertsandMQL5/Expertsfolders, a setup guide and file checksums. Copy the matching folder’sFinanceCalendarNews.mqhandFinanceCalendarNewsFilter.mq4or.mq5into your terminal’s data folder underMQL4/ExpertsorMQL5/Experts. Open and compile the example in MetaEditor.Create a private paid API key
Confirm your account, complete secure payment and create an API key. Keep it out of shared presets, screenshots and source control.
Billed monthly. Renews monthly until cancelled. Applicable tax included.
Allow the calendar connection
In MetaTrader, open Tools → Options → Expert Advisors, enable WebRequest for listed URLs and add
https://www.financecalendar.com. Attach the example EA to a demo chart and enter your key inInpApiKey.Check the chart and your own rules
Check that the expected symbol and next release appear. Verify quiet, clear and unknown handling before adding the filter to an existing EA. Another EA can read the terminal global
FC_NEWS_BLOCK_<symbol>:1quiet,0clear,-1unknown. A missing global must also be treated as unknown.
Use it in your own Expert Advisor.
Initialize once, refresh from a timer and inspect the state before your own entry logic. The filter never opens, changes or closes an order.
#include "FinanceCalendarNews.mqh"
input string InpApiKey = "";
int OnInit()
{
FcNewsInit(InpApiKey);
EventSetTimer(30);
return INIT_SUCCEEDED;
}
void OnTimer() { FcNewsRefresh(); }
void OnDeinit(const int reason) { EventKillTimer(); }
void OnTick()
{
string reason;
int state = FcNewsState(_Symbol, 30, 30, reason);
if(state != FC_NEWS_CLEAR) return;
// Your own entry logic
}FcNewsNext(_Symbol, when, name) returns the next known release in UTC when available. Preserve UTC for comparisons; broker time and daylight saving time require deliberate conversion in any chart display.
Requests, coverage and setup checks.
The default refresh is every 180 minutes. Charts in one terminal share a schedule cache. The paid request includes two days ago through the following six UTC dates, so windows can extend across midnight. Pagination, extra terminals, refresh changes and other integrations consume additional requests from the same account allowance.
The example uses high-impact releases by default. EURUSD matches euro area, German and US events; GBPJPY matches UK and Japanese events; XAUUSD matches US events. This is selected economic-release coverage, not every news headline or market condition. Check the sources and releases you need.
Why does the example say unknown?
Read the chart reason first. Check the API key, confirmed paid access, WebRequest allowlist and connection. Incomplete responses, stale source evidence, unavailable schedules and relevant releases with unknown timing must not silently appear clear. Once the underlying issue is fixed, let the next permitted refresh complete.
What do HTTP errors mean?
401 means credentials need checking; 402 or 403 can indicate an account or access issue. Fix the account or configuration before restarting requests. For 429, respect Retry-After and check shared usage. API key setup and usage.
Does it run in Strategy Tester or indicators?
MetaTrader WebRequest is available to EAs and scripts. It does not run in indicators or Strategy Tester. This package loads online schedules; it does not provide a historical Strategy Tester replay.
Can I use Free Developer?
The packaged filter requests paid routes and date scope so it can check complete schedules across midnight. Choose paid access for this package. Free Developer remains a separate, bounded schedule-only option for its documented routes and filters. Compare response models.
Can it guarantee compliance with a prop firm’s rules?
The filter supplies configurable schedule windows. Each firm’s selected releases, account exceptions, instruments and execution rules can differ. Check those rules and your own EA’s behaviour, including pending orders and open positions, before relying on a filter.
Retain Finance Calendar attribution and the publisher credits, source licences and rights notices in the data. API service terms · Pair-filter API examples · Python and Node examples