MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Automated Trading Language Documentation

Amazing RainbowAmazing Rainbow Try product
Amazing Rainbow
Author: achidayat
MQL for "Dummies": How to Design and Construct Object Classes MQL for "Dummies": How to Design and Construct Object... Screenshot
NZDUSD, H4
Demo
Subscribe to signal
Aniashvili Roboforex
26.54%, 12 515.45 USD
The class for drawing the ATR using the ring buffer Indicator
The class for drawing the ATR using the ring buffer
Author: Lizar

Running MQL Program Properties

To obtain information about the currently running mql5 program, constants from ENUM_MQL5_INFO_INTEGER and ENUM_MQL5_INFO_STRING are used.

For function MQL5InfoInteger

ENUM_MQL5_INFO_INTEGER

Identifier

Description

Type

MQL5_PROGRAM_TYPE

Type of the mql5 program

ENUM_PROGRAM_TYPE

MQL5_DLLS_ALLOWED

The permission to use DLL for the given executed program

bool

MQL5_TRADE_ALLOWED

The permission to trade for the given executed program

bool

MQL5_DEBUG

The flag, that indicates the debug mode

bool

MQL5_PROFILER

The flag, that indicates the program operating in the code profiling mode

bool

MQL5_TESTER

The flag, that indicates the tester process

bool

MQL5_OPTIMIZATION

The flag, that indicates the optimization process

bool

MQL5_VISUAL_MODE

The flag, that indicates the visual tester process

bool

MQL5_FRAME_MODE

The flag, that indicates the Expert Advisor operating in gathering optimization result frames mode

bool

MQL5_LICENSE_TYPE

Type of license of the EX5 module. The license refers to the EX5 module, from which a request is made using Mql5InfoInteger(MQL5_LICENSE_TYPE).

ENUM_LICENSE_TYPE

For function MQL5InfoString

ENUM_MQL5_INFO_STRING

Identifier

Description

Type

MQL5_PROGRAM_NAME

Name of the mql5-program executed

string

MQL5_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 license version allows no more than three activations

LICENSE_TIME

License expiration time

Example:

   ENUM_PROGRAM_TYPE mql_program=(ENUM_PROGRAM_TYPE)MQL5InfoInteger(MQL5_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("MQL5 type value is ",mql_program);
     }


Updated: 2013.02.19