DataFeed from Metatrader

written by Ramil Khalokoff

 

Timing Solution software is able to work with many different data format. One of possible data sources is client's terminal MetaTrader4; it provides real-time data stream. FOREX traders are especially interested in Currency Loader advisor written for MT4. This advisor has just one purpose: to download quotes from MT4 in real-time format. It can be used by different software programs, including Timing Solution (TS). 

Settings

ÌÒ4 advisor "Currency Loader" provides historical data for any chosen financial instrument. It downloads the data into "*.csv" files. These files are updated in real time; the frequency of the updates is defined in seconds, as a parameter FrequencyUpdate (by default, its value is 60, i.e. the data are updated every minute). BarsMin parameter shows the minimum amount of price bars available on the diagram before any update is possible. By default it is 100 (i.e. there will be no downloading data if the data file contains less than 100 bars). There is another parameter there, MaxBarsInFile. It defines the maximum amount of price bars that can be loaded into the file. The default value is 20,000. Remember this number; you will have to change it depending on the history data available and properties of your computer. For example, if you need the minute data for some instrument that has 800,000 price bar history and your computer is rather old, your computer might be frozen.

Default settings:

LoadM1 = false;
LoadM5 = false;
LoadM15 = false;
LoadM30 = false;
LoadH1 = True;
LoadH4 = True;
LoadD1 = True;
LoadW1 = True;
LoadMN = True;

(Comment by Robert Rundle I only build data files in the timeframes that you will use in TS. There is no point in creating data files (timeframes) that you will not use in your live research. Here I use 1, 5 & 60 minute, & Daily only for TS. And because - I can delete it before I start TS so that data is fresh and seamless just in case there are gaps or overlaps of data. Fault of ‘currency converter’. This configuration can then be saved by name, and later these parameters can be applied to a different currency.)




These parameters allow/forbid data downloading. If the parameter is set as True, the data downloading is allowed. If it is set as False, no dowloading. You can change the settings any time.

Also, these commands are useful:

AllowInfo - the information re Advisor;
AllowLogFile - recording of the information into log-file.

How to work with Currency Loader for ÌÒ4

Before doing anything with Currency Loader, download it first and put into ÌÒ4 folder called "expert" (as an example, it might be  C:\Program Files\MetaTrader - Alpari\experts). Then run ÌÒ4. It will be shown in the left column, Advisors. Using the mouse, simply drag it to the diagram: 

 

Enable ‘Experts” Tab

It starts working very soon, you should wait only about a minute after the download. The delay is related to the connection between the terminal and the server and the necessity to update all already opened diagrams. IF YOU USE THE LOADER FOR TOO MANY INSTRUMENTS AT THE SAME TIME, YOUR TERMINAL MIGHT BE FROZEN.
The data files are kept in "Metatrader4" catalogue. This is a sample: C:\Program files\ MetaTrader - Alpari \experts\files\Export_History\

(Comment by Robert Rundle I do a shortcut from desktop to this folder so I can delete it before I start TS so that data is fresh and seamless just in case. RR)


 Working with Timing Solution
and Currency Loader

When you run Timing Solution software, open Data Feeding:

 

Set as From File and define the file folder:  ….\experts\files\Export_History\, there find your data:

(Comment by Robert Rundle SET INTERVAL EVERY 60 SECONDS, AS TS GETS A LITTLE FREEZY FOR A FEW SECONDS)


Then download the data as usual:


 

Switch to real-time regime (click or double-click on this symbol, it must be green):

 

Your settings are done. Now you will have your Metatrader data in Timing Solution in real time.