That's potentially great news, thanks for this much longed for feature!
However, the Economic Calendar as accessible by MQL5 seems to be still empty, or why else does...
MqlCalendarValue value[];
ulong changeID;
CalendarValueLastByEvent(840040003,changeID,value);
ArrayPrint(value);
...only return 0-values for datetime 1970 01 01?
Any solutions?
By the way I would suggest to please update the new related online documentation with tables which event ID (e.g. "840040003" in my example code) stands for which event name etc., so that the users don't have to do this detective work everytime themselves.
Many thanks!

- www.metatrader5.com
Thanks for the new Calendar functions! -- I had a few questions and comments...
CalendarValueLastByEvent and CalendarValueLast function descriptions
I found the following descriptions a little confusing:- 'Get the array of event values by its ID since the Calendar database status with a specified change_id.' and 'Get the array of values for all events with the ability to sort by country and/or currency since the calendar database status with a specified change_id.' respectively.
My understanding is these functions return the latest value of an event or events when the change_ID change from specified one. However I find the wording 'since the calendar database status with a specified change_id.' unclear. It would help to clarify the process for how the calendar is updated and specify what conditions need to be met for the the change_ID to change? -- In particular are updates to the calendar batched and if so by what criteria are they batched and is there one change_id per batch?
Speed of update
I'd be interested to know how quickly (qualitatively) the calendar is updated after the source site is updated. -- does your system check the source sites for updates every x milliseconds or something? - if so how frequently? -- Can I expect Reuters terminal speed or more Tradingview/dailyfx/fxstreet etc type speed? -- I've found that there is often considerable (well a number of seconds) between the former and the latter...
Backtesting
I don't seem to be able to access the calendar when backtesting using strategy tester. For instance I tried running code based on examples in the reference doc to print country IDs and Event IDs. It works as expected when I drop it in an EA or Scrip and run live in the terminal but CalendarCountries returned nothing when I ran it the strategy tester (by the way the example code assumes CalendarCountries returns 0 when no countryID are found by I got a -1)
Is there a way to use the calendar when backtesting?
Service
You mention this new datafeed service being used for alternative pricing data feeds. Let say I wanted to compliment the calendar updates with data release info from other sources, perhaps to cross reference the data or get faster access, could one use this new datafeed functionality to achieve this?
Thanks again.Forum on trading, automated trading systems and testing trading strategies
MetaQuotes Software Corp. 201.04.04.12 15:28
Beta 2025 build from Help menu -> Liveupdate is available.Forum on trading, automated trading systems and testing trading strategies
MetaQuotes Software Corp. 201.04.04.12 15:28
Beta 2025 build from Help menu -> Liveupdate is available.I think there is a typo in the calendar impact enumeration
IMPACRT should that be IMPACT ?
enum ENUM_CALENDAR_EVENT_IMPACRT { CALENDAR_IMPACT_NA =0, // not available CALENDAR_IMPACT_POSITIVE =1, // positive CALENDAR_IMPACT_NEGATIVE =2, // negative };
I think there is a typo in the calendar impact enumeration
IMPACRT should that be IMPACT ?
...
Backtesting
I don't seem to be able to access the calendar when backtesting using strategy tester. For instance I tried running code based on examples in the reference doc to print country IDs and Event IDs. It works as expected when I drop it in an EA or Scrip and run live in the terminal but CalendarCountries returned nothing when I ran it the strategy tester (by the way the example code assumes CalendarCountries returns 0 when no countryID are found by I got a -1)
Is there a way to use the calendar when backtesting?
...
Hello, I'm also interested in this. Any updates? Would be great if there was a way to backtest, even if it involves exporting the calendar from the terminal or from a script.
As for feedback, most functions are straightforward enough to use, and a welcomed addition. I did struggle a bit with CalendarValueHistory(), because it seems to me like it sets the time (datetime) member of the MqlCalendarValue struct to GMT time, while in the terminal's calendar they show up as the broker's time. Considering news come from the broker's server (from my understanding), it would be nice to have consistency and not have to manipulate TimeCurrent() to fit a time range.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The MetaTrader 5 platform update will be released on February 21, 2019. The new version features the following changes:
The Economic Calendar is our proprietary solution. Therein you will find over 600 financial news and indicators related to the 13 largest global economies: USA, European Union, Japan, UK, Canada, Australia, China among others. Relevant data is collected from open sources in real time.
The new version features updated contents and advanced event filters: by time, priority, currencies and countries.
The calendar data can now be accessed from MQL5 programs. Please see below for details.
Unlike Expert Advisors, indicators and scripts, services are not linked to a specific chart. Such applications run in the background and are launched automatically when the terminal is started (unless such an app was forcibly stopped).
Services can be managed from a new section within the Navigator window:
How to create services
To create a service template, use the corresponding MQL5 Wizard option. Services have one OnStart entry point, similar to scripts. At this point, you can implement an endless data receiving and handling cycle using network functions.
How to launch services
To run multiple Expert Advisor or indicator copies with different parameters, you should launch them on different charts. In this case different program instances are created, which then operate independently. Services are not linked to charts, therefore a special mechanism has been implemented for the creation of service instances.
Select a service from the Navigator and click "Add service" in its context menu. This will open a standard MQL5 program dialog, in which you can enable/disable trading and access to signal settings, as well as set various parameters.

A service instance can be launched and stopped using the appropriate instance menu. To manage all instances, use the service menu.The new feature will help beginners in learning how to interact with the platform. We have added over 100 interactive tips concerning the main platform features.
New functions
CalendarCountryById — gets country description by identifier.
CalendarEventById — gets event description by identifier.
CalendarValueById — gets event value description by identifier.
CalendarEventByCountry — gets the array of available events for the country.
CalendarEventByCurrency — gets the array of available events for the affected currency.
CalendarValueHistoryByEvent — gets the array of values for the specified time period, by event identifier.
CalendarValueHistory — gets the array of values for the specified time period for all events, filtered by country and/or currency.
CalendarValueLastByEvent — gets an array of last event values by identifier. This function enables the request of the values which have appeared since the previous request. The in/out parameter "change_id" is additionally used for this operation.
Every time the calendar database changes, the "change_id" property (the last change identifier) is updated. During data request, you specify "change_id" and the terminal returns events which appeared after that time, as well as the current "change_id" value, which can be used for the next request. During the first function call, specify the zero "change_id": the function will not return any events, but will return the current "change_id" for further requests.
CalendarValueLast — gets the array of last values for all events, filtered by country and/or currency. This function enables the request of the values which have appeared since the previous request. Similarly to CalendarValueLastByEvent, the "change_id" property is used for the request.
New structures
MqlCalendarCountry — country description.
MqlCalendarEvent — event description.
MqlCalendarValue — event value description.
New enumerations
New error codes
CharArrayToStruct copies a uchar array to a POD structure.
StructToCharArray copies a POD structure to a uchar array.
New error codes have been added for operations with network functions:
StringReserve reserves for a string the memory buffer of the specified size.
StringSetLength sets the specified string length in characters.
ArrayRemove removes from an array the specified number of elements starting with the specified index.
ArrayInsert inserts to a receiver array the specified number of elements from the source array, starting with the specified index.
ArrayReverse reverses in an array the specified number of elements starting with the specified index.
The name of the symbol, from which the properties of for the custom symbol should be copied, is specified in the "symbol_origin" parameter.
Testing completed using this function is considered successful. After the function call, the trading history obtained during testing and all trade statistics are passed to the terminal.