Skip to content

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

IdentifierDescriptionType
MQL_CODEPAGECodepage used by an MQL4 program to output and convert strings (Print, PrintFormat, Alert, MessageBox, SendFTP, SendMail, SendNotification, etc.)Codepage constant
MQL_PROGRAM_TYPEType of the MQL4 programENUM_PROGRAM_TYPE
MQL_DLLS_ALLOWEDThe permission to use DLL for the given executed programbool
MQL_TRADE_ALLOWEDThe permission to tradefor the given executed programbool
MQL_SIGNALS_ALLOWEDThe permission to modify the Signals for the given executed programbool
MQL_DEBUGThe flag, that indicates the debug modebool
MQL_PROFILERThe flag, that indicates the program operating in the code profiling modebool
MQL_TESTERThe flag, that indicates the tester processbool
MQL_OPTIMIZATIONThe flag, that indicates the optimization processbool
MQL_VISUAL_MODEThe flag, that indicates the visual tester processbool
MQL_FRAME_MODEThe flag, that indicates the Expert Advisor operating in gathering optimization result frames modebool
MQL_LICENSE_TYPEType 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

IdentifierDescriptionType
MQL_PROGRAM_NAMEName of the MQL4-program executedstring
MQL_PROGRAM_PATHPath for the given executed programstring

For information about the type of the running program, values of ENUM_PROGRAM_TYPE are used.

ENUM_PROGRAM_TYPE

IdentifierDescription
PROGRAM_SCRIPTScript
PROGRAM_EXPERTExpert
PROGRAM_INDICATORIndicator

ENUM_LICENSE_TYPE

IdentifierDescription
LICENSE_FREEA free unlimited version
LICENSE_DEMOA trial version of a paid product from the Market. It works only in the strategy tester
LICENSE_FULLA 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_TIMEA 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