MT4Account.ConnectByHostPortAsync method
Connects to the MT4 terminal using credentials provided in the constructor.
public Task ConnectByHostPortAsync(string host, int port = 443, string baseChartSymbol = "EURUSD",
bool waitForTerminalIsAlive = true, int timeoutSeconds = 30, DateTime? deadline = default,
CancellationToken cancellationToken = default)
| parameter | description |
|---|---|
| host | The IP address or domain of the MT4 server. |
| port | The port on which the MT4 server listens (default is 443). |
| baseChartSymbol | The base chart symbol to use (e.g., "EURUSD"). |
| waitForTerminalIsAlive | Whether to wait for terminal readiness before returning. |
| timeoutSeconds | How long to wait for terminal readiness before timing out. |
Return Value
A task representing the asynchronous connection operation.
Exceptions
| exception | condition |
|---|---|
| ApiExceptionMT4 | Thrown if the server returns an error response. |
| RpcException | Thrown if the gRPC connection fails. |
See Also
- class MT4Account
- namespace mt4_term_api