Skip to content
All library documents

Using Static News Data to Validate Economic Calendar Filters in Backtests

Article MQL5 articles

Summary

The article explains why MQL5 Strategy Tester runs may lack historical economic calendar events, leaving news filters inactive and making behavior around releases impossible to verify. Its solution is to load a curated CSV of event times, currencies, importance levels, and optional names when the EA runs in tester mode, while retaining the live calendar source for live trading.

It describes parsing the file at initialization, caching currencies relevant to the chart symbol, and searching the stored events to drive existing news-window logic. A companion exporter and dummy trade generator can help create test data and observe the EA’s responses. Suggested validation checks include repeatable event logs, blocked entries, stop suspension and restoration, configured position closures, and continuous handling of overlapping windows. The approach improves reproducibility and supports what-if tests, but results depend on the CSV’s coverage and accuracy; the article does not establish that its event data represents a complete historical calendar.

Key ideas

  • The Strategy Tester may not provide the historical calendar events needed to exercise a news filter.
  • A static CSV can supply deterministic event data in tester mode while live trading continues to use the terminal calendar.
  • Event records need a timestamp, currency, importance, and optionally an event name.
  • Validation should inspect logs and trade-management behavior, including overlapping news windows.
  • Backtest conclusions depend on the completeness and accuracy of the supplied event file.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.