Discussing the article: "Building a News Filter Engine in MQL5 Using a Local Economic Calendar File"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Building a News Filter Engine in MQL5 Using a Local Economic Calendar File.
A file-based news filter for MQL5 reads a pre-downloaded Forex Factory CSV from MQL5/Files, avoiding fragile web scraping and paid APIs. It provides a modular CNewsFilter with a quote-aware CSV parser, suffix-robust currency extraction, an inclusive time-window checker with clear block reasons, and chart zones for today's events. A demo EA and assertion tests help you integrate and verify offline filtering around scheduled releases.
Every developer who has run an Expert Advisor through a Nonfarm Payrolls release knows the pattern: the spread widens from one point to fifteen, the stop loss fills forty points away from where it was placed, and a strategy that backtested cleanly gives back a week of profit in ninety seconds. High-impact economic releases are the single most predictable source of execution damage in retail forex, and they are predictable precisely because their schedule is published days in advance. The engineering problem is not the event times; it is getting the schedule into the EA reliably.
The two common solutions both introduce fragility. Web scraping works until the site changes its HTML; then EAs depending on the scraper silently stop filtering and trade through the next release. Paid calendar APIs are more stable, but they add a subscription cost and a hard requirement for a live internet connection at the exact moment the EA needs the data. Neither approach has a reliable offline fallback, and an EA running on a VPS with a flaky outbound connection is exactly the environment where a fallback matters most.
This article builds the third option: a file-based news filter. The trader downloads the economic calendar once, in the standard Forex Factory CSV export format, and drops it into the terminal's MQL5/Files/ directory. At startup, the engine reads the file and parses each row into a structured event record. On demand, it answers one question: is the current server time inside a news window for this symbol? There is no network dependency at runtime, no HTML to break, and no subscription. The trade-off is that the file must be refreshed manually (or by a scheduled WebRequest(), which Section 10 covers), and that trade-off is examined honestly in the Limitations section.
By the end of the article you will have a complete, compilable engine. It includes a CNewsFilter class (CSV parser, time-window checker with a currency filter, and a chart drawer), plus a demo EA and a verification script that proves the boundary logic with assertions.
Author: Ushana Kevin Iorkumbul