The available data in Dukascopy is raw in the form of files spanning only one hour, so it's obvious that tools will be needed to download and parse it. Before other methods to get the data were available, a series of scripts were useful to download Dukascopy free tick data, and they are still valid till now. PHP scripts are so simple, with non-commercial quality code, but working well.

A script to download the Dukascopy data called "download_dukascopy_data.php". If you have files already downloaded on the hard disk, the script does not attempt to them, while it just requests the files not existing, to make this work successfully, dates in the $currencies array at the beginning of the script should be set to the date of the last download; as the standard Unix timestamps are used by Dukascopy (epoch date, which equals the number of seconds since 01.01.1970). To convert from a regular date to such a Unix timestamp with ease, Epoch Converter could help, a very easy to use online tool.

A script to process the downloaded data, assuming that it is present in the same directory as the last script where the data was downloaded too (process_dukascopy_data.php); this script needs some parameters, it doesn't need to be described or you can revise the next script.

A small shell script to process all the downloaded data with .bat extension for windows and .sh extension for Linux.

How to download and convert to CSV in windows

First you need to go to windows PHP download part and get the latest binary version zip file, then decompress it to c:\php\, then decompress other scripts downloaded from same directory too.

Rename c:\php\php.ini-development to c:\php\php.ini. If there is no file named php.ini-development in the folder, use php.ini-dist or any other php.ini-something file there.

Edit c:\php\php.ini;

Search for: ;extension=php_curl.dll

Remove the semicolon in front of the line

Add an "ext/" in front of "php_curl.dll"

Then, it should look like: extension=ext/php_curl.dll

Save the file and quit.

If a zip error occurred and an ext/php_zip.dll is in the PHP installation, repeat the last steps too for extension=ext/php_zip.dll.

Go to the 7-Zip download page, download the command line version, unpack it and put 7za.exe in the same directory (c:\php\).

Relax, then wait, don't rush at all, this will take ages. The progress can be checked by exploring the currency pair directories till get filled. If any abnormal error occurs, repeat the process again after it's finished, it will just download missed files in the last run due to connection errors.

If just some of the available currency pairs are needed, the array present at the beginning of "download_dukascopy_data.php" file can be edited. The order currency pair download can be switched, or even a complete removal of the unwanted pairs is possible. The time to start to download of each pair is present next to it in the form of a Unix timestamp number, it's set to the earliest available date by default, it can be postponed to a later date by editing this number by the help of Epoch Converter.

After the download has completed, if the EURUSD data up to 01.01.2012 for instance are needed:

Type: php process_dukascopy_data.php EURUSD 200702 201201 EURUSD.csv

The output will be found in EURUSD.csv

Alternatively, you can type: process.bat

The later will batch process all the currency data. The error spam at this step can be safely ignored. Note: if process.bat or process.sh is involved, the ending dates in them may need to be updated first to get the full data range.

Information, charts or examples contained in this post are for illustration and educational purposes only. It should not be considered as an advice or endorsement to purchase or sell any security or financial instrument. We do not and cannot give any kind of financial advice. No employee or persons associated with us are registered or authorized to give financial advice. We do not trade on anyone's behalf, and we do not recommend any broker. On certain occasions, we have a material link to the product or service mentioned in the post. This may be in the form of compensation or remuneration.

Partners

Risk

Forex trading can involve the risk of loss beyond your initial deposit. It is not suitable for all investors and you should make sure you understand the risks involved, seeking independent advice if necessary.

Forex accounts typically offer various degrees of leverage and their elevated profit potential is counterbalanced by an equally high level of risk. You should never risk more than you are prepared to lose and you should carefully take into consideration your trading experience.

Past performance and simulated results are not necessarily indicative of future performance. All the content on this site represents the sole opinion of the author and does not constitute an express recommendation to purchase any of the products described in its pages.