A client terminal can be started with a custom set of parameters. To do it, create a custom file of settings on the basis of the original common.ini file. To start the terminal with this file of settings, execute the following command in the command line:
where "c:\myconfiguration.ini" — is the path to the custom configuration file.
Parameters of the configuration file are divided into several blocks and correspond to setting in the window of the client terminal settings. Below are the most important settings in a configuration file:
Common terminal settings, analogous to the "Server" tab:
•Login — number of account for connection. When connecting the client terminal tries to read the additional authorization details from the configuration file (server, password and certificate password specified in parameters described below). If the authorization details are not specified then the terminal tries to read it from its own database of accounts;
•Server — address and port number of a trade server for connection separated with a colon;
•Password — password to the account specified in the Login parameter;
•CertPassword — password to the certificate. This parameter is required if the extended authorization mode is enabled for the account. If the certificate for the account is not installed in the storage of the operating system then its file must be located in the terminal_folder/config/certificates/ directory;
•ProxyEnable — allow (1) or prohibit (0) connection via a proxy server;
•ProxyType — type of a proxy server: 0 (SOCKS4), 1 (SOCKS5), 2 (HTTP);
•ProxyAddress — IP address and port of the proxy server, separated by a colon;
•ProxyLogin — login for authorizing on a proxy server;
•ProxyPassword — password for authorizing on a proxy server;
•KeepPrivate — indication for saving the password between connections: 1 — to save, 0 — not to save.
•NewsEnable — enable (1) or disable (0) receipt of news;
•CertInstall — install (1) or not (0) new certificates in the system storage (during extended authorization).
Settings of charts:
•ProfileLast — name of the current profile;
•MaxBars — maximal number of bars in a chart;
•PrintColor — chart printing mode: 1 — color printing, 0 — black-and-white printing;
•SaveDeleted — save (1) or not (0) deleted charts for re-opening.
Settings of Expert Advisors:
•AllowLiveTrading — allow (1) or prohibit (0) trading by Expert Advisors.
•AllowDllImport — allow (1) or prohibit (0) DLL import;
•Enabled — enable or disable use of Expert Advisors;
•Account — allow (1) or not (0) Expert Advisors when an account is changed;
•Profile — allow (1) or not (0) Expert Advisors when a profile is changed.
Settings of objects:
•ShowPropertiesOnCreate — show (1) or not (0) object properties during creation;
•SelectOneClick — select (1) or not (0) objects by a single click;
•MagnetSens — object magnet sensibility;
Settings of Email:
•Enable — enable (1) or disable (0) use of email;
•Server — address of the SMTP server;
•Auth — encrypted information for authorizing on the mail server;
•Login — login for authorizing on the SMTP server;
•Password — password for authorizing on the SMTP server;
•From — sender's name and address;
•To — recipient's name and address.
•Expert — name of file of an Expert Advisor that should be launched when the client terminal is started. The Expert Advisor is launched on the chart that is opened in accordance with the "Symbol" and "Period" parameters. If the "Symbol" parameter is not specified, then an additional chart will not be opened, and the Expert Advisor will be launched on the first chart of the current profile. If the current profile does not contain a chart, the Expert Advisor will not be launched. If the "Expert" parameter is absent, then no Expert Advisors will be launched.
•Symbol — name of a symbol which chart will be opened right after the terminal start. This chart will be used for applying an Expert Advisor or script to it. No information about this additional chart will be saved as the terminal is closed. During the next start of the client terminal without the configuration file, this chart will not be opened. If this parameter is absent, then no additional chart will be opened.
•Period — period of a chart that is used for applying an Expert Advisor or script (any period from 21 available in the terminal). If this parameter is absent, the H1 period will be used.
•Template — name of a template that will be applied to the chart.
•ExpertParameters — name of a file containing parameters of an Expert Advisor. This file must be in the MQL5\presets directory of the terminal data folder. If this parameter is absent, the default parameters will be used.
•Script — name of a script that should be launched during the terminal start. Scripts are launched according to the same rules as Expert Advisors.
•ScriptParameters — name of a file containing parameters of a script. This file must be in the MQL5\presets directory of the terminal data folder. If this parameter is absent, the default parameters will be used.
Settings of the testing that is launched when the terminal is started:
•Expert — name of file of an Expert Advisor that should be started for testing (optimization) when the terminal is started. If this parameter is absent the testing will not be launched.
•ExpertParameters — name of a file containing input parameters of an Expert Advisor. This file must be in the \tester folder of the terminal installation directory.
•Symbol — name of a symbol that will be used as a main symbol of testing. If this parameter is absent, the last selected symbols in the tester will be used.
•Period — period of a chart for testing (any period from 21 available in the terminal). If this parameter is absent, the H1 period will be used.
•Login — using this parameter, you can pass an account number that is allegedly used for testing to an Expert Advisor. The necessity of this parameter is built into an Expert Advisor in its source MQL5 code (using the AccountInfoInteger function).
•Model — mode of tick generation (0 — "Every tick", 1 — "1 minute OHLC", 2 — "Open prices only", 3 — "Math calculations"). If this parameter is not specified, the mode of generation of every tick will be used.
•ExecutionMode — the mode of trading emulated by the Strategy Tester (0 — common mode, 1 — random delay of execution of trade orders is enabled).
•Optimization — enabling/disabling optimization and specification of its type (0 — optimization disabled, 1 — "Slow complete algorithm", 2 — "Fast genetic based algorithm", 3 — "All symbols selected in Market Watch").
•OptimizationCriterion — optimization criterion for finding optimal parameters: (0 — the maximum balance value, 1 — the maximum value of product of the balance and profitability, 2 — the product of the balance and expected payoff, 3 — the maximum value of the expression (100% - Drawdown)*Balance, 4 — the product of the balance and the recovery factor, 5 — the product of the balance and the Sharpe Ratio, 6 — a custom optimization criterion obtained from the OnTester() function in an Expert Advisor).
•FromDate — date of the beginning of the testing range in the YYYY.MM.DD format. If this parameter is absent, the last specified date in the corresponding field of the strategy tester will be used.
•ToDate — date of the end of the testing range in the YYYY.MM.DD format. If this parameter is absent, the last specified date in the corresponding field of the strategy tester will be used.
•ForwardMode — mode of forward testing (0 — disabled, 1 — 1/2 of the test period, 2 — 1/3 of the test period, 3 — 1/4 of the test period, 4 — custom period, specified via the ForwardDate parameter).
•ForwardDate — start date of forward testing in the YYYY.MM.DD format. The parameter is active only if ForwardMode=4.
•Report — name of a file the testing or optimization report will be saved to. The file will be created in the client terminal directory. You can specify a path to save the file relatively to this directory, for example, \reports\tester.htm. If an extension is not specified in a file name, the ".htm" extension is automatically used for testing reports, and ".xml" is used for optimization reports. If this parameter is absent, the testing report will not be saved as a file. When enabling the mode of forward testing, its result will be saved in a separate file with the ".forward" suffix. For example, tester.forward.htm.
•ReplaceReport — enabling/disabling the rewriting of the report file (0 — disabled, 1 — enabled). If the rewriting is disabled and a file with the same name already exists then the index number in square brackets will be added to the name of the file. For example, tester.htm. If this parameter is absent then "0" value will be used (rewriting disabled).
•ShutdownTerminal — enabling/disabling shutting down of the client terminal at the end of testing (0 — disabled, 1 — enabled). If this parameter is absent, the "0" value is used (shutting down disabled). If the testing/optimization process is manually stopped by user, the value of this parameter is automatically reset to "0".
•Deposit — amount of initial deposit for testing/optimization. The amount is specified in the deposit currency of the account. If this parameter is absent, the amount specified in the corresponding field of the strategy tester is used.
•Leverage — leverage for testing/optimization. For example, 1:100. If this parameter is absent, the leverage specified in the corresponding field of the strategy tester is used.
•UseLocal — enable/disable use of local agents for testing and optimization (0 — disable, 1 — enable). If this parameter is absent, current settings of the client terminal are used.
•UseRemote — enable/disable use of remote agents for testing and optimization (0 — disable, 1 — enable). If this parameter is absent, current settings of the client terminal are used.
•UseCloud — enable/disable use of agents of the MQL5 Cloud Network for testing and optimization (0 — disable, 1 — enable). If this parameter is absent, current settings of the client terminal are used.
Example of a Configuration File
MetaTrader 5 — a complex trading platform for providing brokerage services on the retail Forex market.
Copyright 2000-2013, MetaQuotes Software Corp.