User Tools

Site Tools


Customising MT4 Export Settings

As previously noted in the section on the MT4 database, the contains important information in order to accurately and fully evaluate a back-test. This information includes broker-specific information that define valid lot sizes, commissions, account leverage and so forth. Tickstory allows you to define all these details during the MT4 Export process and these details are subsequently embedded in your MT4 back-test database.

The broker-specific “Metratrader information” can be stored in a “MT4 Config” (.mt4config) file for later use or shared amongst traders who would like to compare their results. By doing so, traders can ensure consistency and focus on optimising their settings or the EA itself, rather than trying to track down why their results are constantly changing despite no code and/or parameter changes. Given the fact that this information is key to an EA's back-test evaluation, you may wish to customise various settings to take full control over what is exported within the MT4 data file. The “Metatrader Info” tab is designed specifically for this purpose and is shown below.

As you can see from the screen-shot, there is some detailed information that is used to produce the MT4 exported database. By default, Tickstory provides a “Generic Broker” configuration that allows users to use relatively standard settings to produce their exports. Of course, this information may not necessarily match your brokers, so it makes sense to review this information.

For example, if you wish to view the properties used for a EURUSD export, select the Symbol “EURUSD” in the 'Symbol properties' box as shown below.

When you do, the system will display all the settings for EURUSD, including the standard lotsize, tick value and so on. When performing a back-test, it will be these values that are used to determine profit, maximum lot sizes and so forth. As an exercise, let's set the spread for EURUSD to 3 pips by changing the value in the 'Spread' field. You will note that the equivalent in pips will display to the right of the text-box as shown below:

Fields of particular note are:

  • Map to - This allows you to map this particular symbol (eg. EURUSD) to the equivalent symbol in MT4 (eg. EURUSDm). If you have generated your custom broker settings, this field will automatically be populated. Leave blank if the symbol is the same on your MT4 platform.
  • Min lot/Lot step - These values have bearing on many EAs that incrementally change lot sizes. If these values are not set correctly, you can receive “Order Send 131” errors when running your EA. Consult the MQL documentation for further information.
NOTE: The 'Spread' field was used in earlier Metatrader versions (circa pre-2015) and has now been obsolesced in favour of a “Spread” field on the Strategy Tester's parameter screen. This new spread field in the Strategy Tester allows you to change the spread easily between back-tests. Therefore, setting the Spread field within Tickstory no longer has any effect for the latest Metatrader versions and can be ignored. It remains available in Tickstory for backward compatibility with earlier versions of Metatrader only.

Advanced user note: MQL developers will recognise each of the properties map one-to-one with information available in MQL. For example, when you call the function:


in your EA during the back-test, it will yield the value that is displayed in the “Digits” field for EURUSD. Similarly, invoking:


will yield the value in the 'Account Currency' field.

Generating settings from your own broker

As you can appreciate, it would be difficult to craft an entire broker configuration by hand. You would need to somehow find out all the details about each of the settings from your broker and input them into the Tickstory configuration. Fortunately, however, there is a way of automatically generating these settings. This is done by running a special Tickstory Expert Advisor on your system that will generate the settings for you. In order to perform this task, follow the steps below:

1. Click on the “Help” tab within the Tickstory MT4 export dialog. This will give you the same instructions as described here about how to deploy the Tickstory EA to your MT4 installation.

2. Click on the Deploy MQ4 button. This will automatically deploy the EA to your MT4 Installation if you have already configured it. If not, it will prompt you for the correct folder location which should be something like:

C:\Program Files\Metatrader Broker\experts

3. Restart your MT4 terminal and go to the MT4 Navigator→Expert Advisor tree. You should see the Tickstory EA appear in the list. Double-click on it to apply it on any LIVE chart or drag the icon onto a chart window.

4. A prompt will come up to configure the EA. Configure the Tickstory EA with the “Input” settings:

  • Config File Name - This is the name of the config file that will be generated. Leave this blank for Tickstory EA to automatically generate a file like Mt4.<ServerName>.Broker.config.
  • Symbol Suffix - For micro accounts, you will need to enter a “Symbol Suffix” so the system can map each symbol (eg. EURUSD) to the equivalent symbol on your micro account. For example, entering a suffix of 'm' will resolve to 'EURUSDm'.
  • Allow When Not Connected - You should ensure that you are connected to your broker before running the EA. This will ensure that the script gets the latest information from your broker. If you cannot connect to your broker for some reason, you will need to select the Allow When Not Connected property (in Expert Properties) is set to 'true'.

An example settings screen showing a un-connected micro account are shown below.

Press the OK button once to are done to accept the settings.

5. The EA will start running and you will be able to see its progress in the “Experts” tab. If there are any errors, they will appear in this screen. Likewise, if the system can't find information on a particular instrument, it will tell you in this screen along with what defaults it has assumed. Once the script has successfully completed, a config file with all the details will be placed in your Metatrader's “experts\files” directory named Mt4.<BrokerName>.Servername.mt4config. For example:

<MT4 Data Folder>\experts\files\Mt4.Broker.Servername.mt4config

6. Back in the Tickstory app, click on the 'Metatrader Info' tab within the MT4 export settings and load the config file from the MT4 experts\files directory. (as described in the section on “Loading settings”).

7. You can now view, edit and save your broker settings in Tickstory.

Saving Settings

The MT4 'Metatrader Info' tab allows you to save the current displayed settings to a config file. This config file can then be used later or shared amongst the trader community to ensure you can generate consistent data exports and compare your back-tests. To save your settings, you can either choose “Save as default” which will automatically save your config as the default one. This means whenever you open the MT4 Export dialog, it is these settings that will be used. Alternatively, you can save the config to a specifically named file so that it can be manually loaded (using the “Load settings” button) for the next time you do an export.

Loading Settings

The 'Load settings' function allows you to load a config file that contains all the information required by the MT4 Exporter. This config file could have been:

  • A file that you previously customised and saved.
  • A file that was sent to you by a trading colleague.
  • A file that was generated as part of the process to 'generate settings from your broker'.

To load the config file, simply click on the 'Load settings' button and then browse to the directory location where the file resides. Config files that are bundled with Tickstory are stored in the Application directory. In the case of files that were generated by the Tickstory EA, these will reside in your Metatrader installation's expert/files directory.

customising_mt4_export_settings.txt · Last modified: 2016/12/12 13:04 by tickstory