Running MQL4 Program Properties
Running MQL4 Program Properties
Running MQL4 Program Properties
To obtain information about the currently running mql4 program, constants from ENUM_MQL_INFO_INTEGER and ENUM_MQL_INFO_STRING are used.
For function MQLInfoInteger
ENUM_MQL_INFO_INTEGER
| Identifier | Description | Type |
|---|---|---|
| MQL_CODEPAGE | Codepage used by an MQL4 program to output and convert strings (Print, PrintFormat, Alert, MessageBox, SendFTP, SendMail, SendNotification, etc.) | Codepage constant |
| MQL_PROGRAM_TYPE | Type of the MQL4 program | ENUM_PROGRAM_TYPE |
| MQL_DLLS_ALLOWED | The permission to use DLL for the given executed program | bool |
| MQL_TRADE_ALLOWED | The permission to tradefor the given executed program | bool |
| MQL_SIGNALS_ALLOWED | The permission to modify the Signals for the given executed program | bool |
| MQL_DEBUG | The flag, that indicates the debug mode | bool |
| MQL_PROFILER | The flag, that indicates the program operating in the code profiling mode | bool |
| MQL_TESTER | The flag, that indicates the tester process | bool |
| MQL_OPTIMIZATION | The flag, that indicates the optimization process | bool |
| MQL_VISUAL_MODE | The flag, that indicates the visual tester process | bool |
| MQL_FRAME_MODE | The flag, that indicates the Expert Advisor operating in gathering optimization result frames mode | bool |
| MQL_LICENSE_TYPE | Type of license of the EX4 module. The license refers to the EX4 module, from which a request is made using MQLInfoInteger(MQL_LICENSE_TYPE). | ENUM_LICENSE_TYPE |
For function MQLInfoString
ENUM_MQL_INFO_STRING
| Identifier | Description | Type |
|---|---|---|
| MQL_PROGRAM_NAME | Name of the MQL4-program executed | string |
| MQL_PROGRAM_PATH | Path for the given executed program | string |
For information about the type of the running program, values of ENUM_PROGRAM_TYPE are used.
ENUM_PROGRAM_TYPE
| Identifier | Description |
|---|---|
| PROGRAM_SCRIPT | Script |
| PROGRAM_EXPERT | Expert |
| PROGRAM_INDICATOR | Indicator |
ENUM_LICENSE_TYPE
| Identifier | Description |
|---|---|
| LICENSE_FREE | A free unlimited version |
| LICENSE_DEMO | A trial version of a paid product from the Market. It works only in the strategy tester |
| LICENSE_FULL | A purchased licensed version allows at least 5 activations. The number of activations is specified by seller. Seller may increase the allowed number of activations |
| LICENSE_TIME | A version with limited term liсense |
Example:
ENUM_PROGRAM_TYPE mql_program=(ENUM_PROGRAM_TYPE)MQLInfoInteger(MQL_PROGRAM_TYPE);
switch(mql_program)
{
case PROGRAM_SCRIPT:
{
Print(__FILE__+" is script");
break;
}
case PROGRAM_EXPERT:
{
Print(__FILE__+" is Expert Advisor");
break;
}
case PROGRAM_INDICATOR:
{
Print(__FILE__+" is custom indicator");
break;
}
default:Print("MQL4 program type value is ",mql_program);
}Last updated on