- 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
Overview of functions for getting account properties
The full set of account properties is logically divided into three groups depending on their type. String properties are summarized in the ENUM_ACCOUNT_INFO_STRING enumeration and are queried by the AccountInfoString function. Real-type properties are combined in the ENUM_ACCOUNT_INFO_DOUBLE enumeration, and the function that works for them is AccountInfoDouble. The ENUM_ACCOUNT_INFO_INTEGER enumeration used in the AccountInfoInteger function contains identifiers of integer and boolean properties (flags), as well as several applied ENUM_ACCOUNT_INFO enumerations.
double AccountInfoDouble(ENUM_ACCOUNT_INFO_DOUBLE property)
long AccountInfoInteger(ENUM_ACCOUNT_INFO_INTEGER property)
string AccountInfoString(ENUM_ACCOUNT_INFO_STRING property)
We have created the AccountMonitor class (AccountMonitor.mqh) to simplify the reading of properties. By overloading get methods, the class provides the automatic call of the required API function depending on the element of a specific enumeration passed in the parameter.
class AccountMonitor
|
In addition, it has several overloads of the stringify method, which form a user-friendly string representation of property values (in particular, it is useful for applied enumerations, which would otherwise be displayed as uninformative numbers). The features of each property will be discussed in the following sections.
static string boolean(const long v)
|
Finally, there is a template method list2log that allows getting comprehensive information about the account.
// list of names and values of all properties of enum type E
|
We'll test the new class in action in the next section.