• Overview
  • Reviews
  • Comments (27)
  • What's new

Download news file

The script allows you to download news starting from 2007 and to save the data to a text file named Calendar.txt.

The news data are downloaded from Forexfactory.com.

Calendar.txt can be later applied in Expert Advisors that use the news in their strategies, for testing or optimization.

To download the news it is necessary to run the script on any chart of any currency.

The download process will be displayed on the chart.


Settings

  • Start_Year = 2007 - from what year you want to download news
  • End_Year = 2017 - till what year inclusive
  • GMT_News = 0 - GMT offset of news time
  • Use_External_Files_Htm = true - Use .htm files downloaded using FF_htm. This option should be used if an error occurs while downloading pages from the site. The FF_htm script can be downloaded here: https://www.mql5.com/ru/blogs/post/703340

The file is saved to \MQL4\files\Calendar.txt

It is also copied to the common folder for all terminals, for example C:\Users\admin\AppData\Roaming\MetaQuotes\Terminal\Common (for the strategy tester)

It is necessary to add the link https://www.forexfactory.com in the terminal settings. An example is shown in the figure.


A sample of the Calendar.txt file format

This is the news history with GMT 0, it can serve as an example for determining the correctness of the GMT of your file.

2007.01.01 22:30;AUD;L;AIG Manufacturing Index

2007.01.02 02:30;CNY;M;Caixin Manufacturing PMI

2007.01.02 05:30;AUD;M;Commodity Prices y/y

2007.01.02 08:15;EUR;L;Spanish Manufacturing PMI

2007.01.02 08:45;EUR;L;Italian Manufacturing PMI

2007.01.02 09:00;EUR;M;Final Manufacturing PMI

No reviews
Version 1.52 - 2017.08.23
In version 1.52, parsing is corrected for the new html code of the forexfactory.com page
Version 1.50 - 2017.07.27
New version "1.50".

Added possibility to use .htm files, downloaded using another script (https://www.mql5.com/ru/blogs/post/703340)

The possibility was added due to often complaints of users who were unable to download pages from forexfactory.com using the built-in Webrequest function.
Version 1.32 - 2017.04.27
Version 1.32 of the script has been fixed for the new site address.

Old address
http://www.forexfactory.com/

New address
https://www.forexfactory.com/
Version 1.27 - 2016.04.07
The forexfactory.com site has changed the html code of its web pages. Because of that the script version 1.26 stopped working.
The new script version 1.27 is redesigned for the new format of the site.