Previous  Next

How to Start the Trading Platform

After installation, a group of programs of the trading platform is added to the Start menu, and the program shortcut is created on the desktop. Use them to run the platform.

Two copies of the platform cannot run from the same directory. If you need to run multiple copies at the same time, install the appropriate number of programs in different directories.

There are two main modes of trading platform start, as well as some additional methods.

Main Mode

Starting from MS Windows Vista, applications installed to Program Files are not allowed to store their data in the installation folder on default. All data should be stored in a separate Windows user directory.

Thus, if the platform is installed in the Program Files directory and user rights to write to that directory are limited, it is run in the main mode. The main mode is also used in the following situations:

In this mode, the editable files of the platform are stored in a specific Windows user directory, and the immutable files are stored in Program Files. Immutable files include executables of the platform, of MetaEditor, standard sounds, etc. Editable files are:

All the editable files of the platform are stored in the following directories (depending on the operating system used):

Microsoft Windows XP SP3:

Microsoft Windows Vista and higher:

Here 'C' is the logical drive letter on which Windows is installed, "username" is the account name in the operating system under which the platform has been installed, "instance_id" is a unique identifier generated based on the path to the directory where the platform is installed.

For quick access to these folders, use the command "Open data folder Open Data Folder" in the File menu. Each data folder contains a special text file origin.txt. This file contains the path to the platform installation folder, which corresponds to this data directory.

  • In the main mode, the catalog where editable files are stored is different for each Windows account.
  • A detailed description of the platform file structure and their purpose is given in the appropriate section.

Portable Mode

When installed to Program Files, the platform works in the main mode described above on default. All the platform data are stored in a special Windows user directory. However you can force the platform to store its data in the installation folder. To do it, run the platform in the portable mode. To use this mode, start the platform from the command line with the additional /portable key. For example, "C:\Program Files\MyTerminal\terminal.exe /portable".

To run the platform in the Portable mode, the following conditions must be met:

  • If the platform is installed in the Program Files folder, the user must have administrator rights on the computer. In addition, UAC (User Account Control) must be disabled in the operating system.
  • If the platform is installed in any other folder, the user must have permission to write data to that folder.

Running from the Command Line

The trading platform can be run manually with predefined parameters. This can be done by using different keys for starting from a command line and alternative configuration files.

The platform can be run with the keys from the command line. Specify there a path to the executable platform file (path to the file\terminal.exe) and after a space add one or several of the below keys:

If the key assignment is set incorrectly (invalid login, profile name or configuration file), the default value will be used.

Running with a Custom Configuration File

The trading platform can be run with a custom set of parameters. Create your own configuration file based on the default common.ini. To start the platform with a custom configuration file, run the following command in the command line:

path_to_platform\terminal64.exe /config:c:\myconfiguration.ini

where "c:\myconfiguration.ini" is the path to the custom configuration file.

Custom configuration files are used in the "read only" mode during the work of the platform. Changes in settings made from the platform interface are not written to the used custom configuration file.

The configuration file parameters are divided into several blocks and correspond to the settings on platform configuration window tabs. Below are the most important settings in the configuration file:

[Common]

Common platform settings similar to the Server tab:

[Charts]

Chart settings:

[Experts]

Expert Advisor settings:

[Objects]

Object settings:

[Email]

Email settings:

[StartUp]

Settings of Expert Advisors and scripts, that open automatically when you start the platform:

[Tester]

Parameters of testing that starts automatically when you run the platform:

  • Input parameters from the file specified in ExpertParameters are used for testing/optimization.
  • If the ExpertParameters setup is not available, parameters from the file Expert_name.set located in [platform_folder]\MQL5\Profiles\Tester are used. The last specified set of input parameters of an Expert Advisor is automatically saved in this file.
  • If there is no such file, then the default parameters specified in the Expert Advisor code are used for testing. Optimization is not possible.
  • To create or edit the set of parameters, select the Expert Advisor on the Settings tab of the strategy tester, and specify input parameters and their modification range on the corresponding tab.

Example of a Configuration File

[Common]

Login=1000575

ProxyEnable=0

ProxyType=0

ProxyAddress=192.168.0.1:3128

ProxyLogin=10

ProxyPassword=10

KeepPrivate=1

NewsEnable=1

CertInstall=1

 

[Charts]

ProfileLast=Euro

MaxBars=50000

PrintColor=0

SaveDeleted=1

 

[Experts]

AllowLiveTrading=0

AllowDllImport=0

Enabled=1

Account=0

Profile=0

 

[Objects]

ShowPropertiesOnCreate=0

SelectOneClick=0

MagnetSens=10

 

;+------------------------------------------------------------------------------+

;|  Running an EA and/or script on the specified chart at the platform start    |

;+------------------------------------------------------------------------------+

[StartUp]

;--- The Expert Advisor is located in platform_data_directory\MQL5\Experts\Examples\MACD\

Expert=Examples\MACD\MACD Sample

;--- EA start parameters are available in platform_data_directory\MQL5\Presets\

ExpertParameters=MACD Sample.set

;--- The script is located in platform_data_directory\MQL5\Scripts\Examples\ObjectSphere\

Script=Examples\ObjectSphere\SphereSample

;--- Symbol chart, which will be opened when you start the platform, and EA and/or script will run on it

Symbol=EURUSD

;--- Chart timeframe, which will be opened when you start the platform, and EA and/or script will run on it

Period=M1

;--- The template to apply to a chart is located in platform_installation_directory\Profiles\Templates

Template=macd.tpl

 

;+------------------------------------------------------------------------------+

;| Start Expert Advisor testing or optimization                                 |

;+------------------------------------------------------------------------------+

[Tester]

;--- The Expert Advisor is located in platform_data_directory\MQL5\Experts\Examples\MACD\

Expert=Examples\MACD\MACD Sample

;--- The Expert Advisor parameters are available in platform_installatoin_directory\MQL5\Profiles\Tester\

ExpertParameters=macd sample.set

;--- The symbol for testing/optimization

Symbol=EURUSD

;--- The timeframe for testing/optimization

Period=M1

;--- Emulated account number

Login=123456

;--- Initial deposit

Deposit=10000

;--- Leverage for testing

Leverage=1:100

;--- The "All Ticks" mode

Model=0

;--- Execution of trade orders with a random delay

ExecutionMode=1

;--- Genetic optimization

Optimization=2

;--- Optimization criterion - Maximum balance value

OptimizationCriterion=0

;--- Dates of beginning and end of the testing range

FromDate=2011.01.01

ToDate=2011.04.01

;--- Custom mode of forward testing

ForwardMode=4

;--- Start date of forward testing

ForwardDate=2011.03.01

;--- A file with a report will be saved to the folder platform_installation_directory

Report=test_macd

;--- If the specified report already exists, it will be overwritten

ReplaceReport=1

;--- Set automatic platform shutdown upon completion of testing/optimization

ShutdownTerminal=1