Economic Calendar CSV – script MetaTrader 5

This is an extended version of the script CalendarForDates.mq5 presented in the algotrading book.

Input variables allows you to specify a country code, a currenty code, and a time range to filter required records. If the inputs are left empty, a complete calendar can be requested (if the calendar is requested first time after the terminal started, it can take a while for downloading its base or even time out and produce no results – then please run the script once again).

As a result, you’ll get a CSV-file with calendar records with most important fields (not all fields are exported – feel free to adjust the source code according to your needs).

Optionally, one can input a *.cal-file (archived complete copy of the calendar for specific time) created by the indicator CalendarMonitorCached.mq5 also introduced in the book.

Alternative:  StoDiv - indicator MetaTrader 5

MetaTrader's Economic Calendar in CSV


The attached mqh-files (CalendarFilter.mqh, CalendarCache.mqh, QuickSortStructT(Ref).mqh) contain bugfixes and improvements compared to their original versions from the book.


📈 ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks