Skip to content
All library documents

Using MetaTrader Economic Calendar Data in Live Systems and Backtests

Article MQL5 code base

Summary

The document describes a MetaTrader library for retrieving historical and upcoming economic-calendar events and using them in indicators, expert advisors, and tester runs. It demonstrates filtering events by date, currency, importance, or event name, and shows how upcoming events can be selected for the currencies associated with a trading symbol. For historical testing, the workflow saves calendar data from the terminal to a file and loads it in the tester, where an example expert advisor checks actual versus forecast values for a payroll event and opens a position in one of two directions.

The examples illustrate event-driven strategy mechanics, but the document gives no performance results beyond identifying a six-year test at hourly opening prices; it reports no metrics or benchmark. The sample rule is deliberately simple and does not establish that forecast surprises predict profitable price moves. Users would need to assess event timing, data availability, execution assumptions, position sizing, and risk controls. The stated portability feature is file-based access in MT4, with no DLL requirement.

Key ideas

  • The library retrieves historical and upcoming economic-calendar events for use in MetaTrader systems.
  • Events can be filtered by currency, importance, date range, or name.
  • Historical calendar data can be saved from the terminal and loaded into the strategy tester.
  • The sample expert advisor trades according to whether an event’s actual value exceeds its forecast.
  • The example offers no reported performance metrics or evidence that the event rule is profitable.

Tags

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