Skip to content
All library documents

Using the MQL5 Economic Calendar for Event Data and Time Series

Article MQL5 articles

Summary

This programming guide explains how to retrieve economic calendar metadata and historical or latest event values through MQL5. It outlines the relationships among country, event, and value records, and describes fields for actual, forecast, previous, and revised figures. A key data-handling detail is that numeric values are stored scaled by one million; missing fields use a sentinel value, while accessor methods return NaN and presence-check methods indicate whether a value exists.

The article presents an object-oriented calendar wrapper and a time-series structure for selecting an event, requesting its history, and updating an indicator when a new value arrives. Examples use a central-bank rate event to demonstrate missing-value checks and a futures-positioning release to illustrate indicator output. Calendar requests can fail because of insufficient array capacity, timeouts, or unavailable data. The article focuses on accessing and organizing calendar data; it does not evaluate an event-driven trading strategy or establish that releases predict price moves.

Key ideas

  • MQL5 calendar functions retrieve country, event, and value records, including historical releases.
  • Calendar values are scaled, and missing values should be checked before they are used.
  • Country records link to events, and events link to their individual values through identifiers.
  • A wrapper can select an event, build its historical series, and update an indicator as new values arrive.
  • Calendar requests may fail because of capacity limits, timeouts, or missing data.

Tags

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