MT5TerminalInfo {MetaTrader}R Documentation

Get the state and parameters of the MetaTrader 5 terminal connection

Description

Gets the state and parameters of the MetaTrader 5 terminal connection to a broker's server (account number and server address).

Usage

  MT5TerminalInfo()

Details

You can proceed with requesting data from the MetaTrader 5 terminal only if the connection status is 2. Call MT5WaitForTerminal to wait for connection.

Value

Returns the state and parameters of the MetaTrader 5 terminal connection in the form of a R list.

integer status of connection to the broker's server: 0 - not connected, 1 - connected, but the enivronment is not syncrhonized yet, 2 - connected
string broker's server name
string account number (login)
    [[1]]
    [1] 2

    [[2]]
    [1] "MetaQuotes-Demo"

    [[3]]
    [1] "15185779"
  

Examples

  # start MetaTrader 5 Terminal (you should have it installed), call on first request only
  MT5Initialize()
  # wait for connection with broker server, call on first request only
  MT5WaitForTerminal()
  # get info
  MT5TerminalInfo()

[Package MetaTrader version 5.0.0 Index]