Establish a connection with the MetaTrader 5 terminal. There are three call options.
Call without parameters. The terminal for connection is found automatically.
Call specifying the path to the MetaTrader 5 terminal we want to connect to.
Call specifying the trading account path and parameters.
[in] Path to the metatrader.exe or metatrader64.exe file. Optional unnamed parameter. It is indicated first without a parameter name. If the path is not specified, the module attempts to find the executable file on its own.
[in] Connection timeout in milliseconds. Optional named parameter. If not specified, the value of 60 000 (60 seconds) is applied. If the connection is not established within the specified time, the call is forcibly terminated and the exception is generated.
[in] Trading account number. Optional named parameter. If not specified, the last trading account is used.
[in] Trading account password. Optional named parameter. If the password is not set, the password saved in the terminal database is applied automatically.
[in] Trade server name. Optional named parameter. If no server is set, the last used server is applied automatically.
Returns True in case of successful connection to the MetaTrader 5 terminal, otherwise - False.
If required, the MetaTrader 5 terminal is launched to establish connection when executing the initialize() call.