- Overview of functions for getting account properties
- Identifying the account, client, server, and broker
- Account type: real, demo or contest
- Account currency
- Account type: netting or hedging
- Restrictions and permissions for account operations
- Account margin settings
- Current financial performance of the account
Identifying the account, client, server, and broker
Perhaps the most important properties of an account are its number and identification data: the name of the server and the broker's company, as well as the name of the client. All of these properties, except for the number, are string properties.
Identifier |
Description |
---|---|
ACCOUNT_LOGIN |
Account number (long) |
ACCOUNT_NAME |
Client name |
ACCOUNT_SERVER |
Trade server name |
ACCOUNT_COMPANY |
Name of the company servicing the account |
Let's use the AccountMonitor class from the previous section to log these and many other properties that will be discussed in a moment. Let's create the corresponding object and call its properties in the script AccountInfo.mq5.
#include <MQL5Book/AccountMonitor.mqh>
|
Here is an example of a possible result of the script.
ENUM_ACCOUNT_INFO_INTEGER Count=10
|
Pay attention to the properties of this section (ACCOUNT_LOGIN, ACCOUNT_NAME, ACCOUNT_COMPANY, ACCOUNT_SERVER). In this case, the script was executed on the account of the demo server "MetaQuotes-Demo". Obviously, this should be a demo account, and this is indicated not only by the name of the server but also by another property, ACCOUNT_TRADE_MODE, which will be discussed in the next section.
Account identifiers are usually used to link MQL programs to a specific trading environment. An example of such an algorithm was presented in the Services section.