MQL4 Book  Standard Functions

Standard Functions

Al in all there are more than 220 standard functions in MQL4, this is apart from functions of technical indicators. It is impossible to include here descriptions and examples of all functions, because there are too many of them. Some functions that need to be described in details are included into previous sections. In this section we will dwell on other most widely used functions. At the end of each paragraph you will see the full list of functions of a certain category and their short description.

  • Common Functions.
    This group includes functions that are not included into any of specialized groups. These are the following functions: Print(), Alert(), Comment(), MarketInfo(), Sleep(), etc.

  • Graphical Objects.
    MetaTrader 4 Terminal allows the attachment of numerous graphical objects to a chart. This group includes functions that are used for programmed creation such objects as well as for changing their properties, moving them and deleting.
  • Operations with Charts.
    A group of functions that are used for getting different information about a current chart, to which a program in MQL4 (script, indicator or Expert Advisor) is attached.
  • String Functions.
    String functions are used for processing variables of string type: searching value, concatenation of lines, retrieval of sub-lines, etc. Conversion functions are used for converting a variable of one type into another type. NormalizeDouble() function rounds off values of double type to a certain accuracy.
  • Date and Time.
    This group of functions is used for getting time information in this or that form: LocalTime() shows the local time of a computer, TimeCurrent() shows server time of the last received quote. Besides, parameters like a weekday, month day, hour, minute, etc. can be obtained for an indicated time value.
  • File Operations.
    This group of functions is necessary for reading/recording data on a hard disk.
  • Account Information.
    Functions show information about a client terminal, account and check the current state of a client terminal (including the state of environment of MQL4-program being executed).

For getting a detailed description of any standard function refer to MQL4 Reference at, MetaQuotes Ltd. website or to "Help" in MetaEditor.