MQL5 Programming for TradersAdvanced language toolsEconomic calendarGetting event descriptions by ID
- Basic concepts of the calendar
- Getting the list and descriptions of available countries
- Querying event types by country and currency
- Getting event descriptions by ID
- Getting event records by country or currency
- Getting event records of a specific type
- Reading event records by ID
- Tracking event changes by country or currency
- Tracking event changes by type
- Filtering events by multiple conditions
- Transferring calendar database to tester
- Calendar trading
Getting event descriptions by ID
Real MQL programs, as a rule, request current or upcoming calendar events, filtering by time range, countries, currencies, or other criteria. The API functions intended for this, which we have yet to consider, return MqlCalendarValue structures, which store only the event identifier instead of its description. Therefore, the CalendarEventById function can be useful if you need to extract complete information.
bool CalendarEventById(ulong id, MqlCalendarEvent &event)
The CalendarEventById function gets the description of the event by its ID. The function returns a success or error indication.
An example of how to use this function will be given in the next section.