Skip to content

Common Functions

Common Functions

General-purpose functions not included into any specialized group are listed here.

FunctionAction
AlertDisplays a message in a separate window
CheckPointerReturns the type of the object pointer
CommentOutputs a comment in the left top corner of the chart
CryptEncodeTransforms the data from array with the specified method
CryptDecodePerforms the inverse transformation of the data from array
DebugBreakProgram breakpoint in debugging
ExpertRemoveStops Expert Advisor and unloads it from the chart
GetPointerReturns the object pointer
GetTickCountReturns the number of milliseconds that have elapsed since the system was started
GetMicrosecondCountReturns the number of microseconds that have elapsed since the start of MQL4-program
MessageBoxCreates, displays a message box and manages it
PeriodSecondsReturns the number of seconds in the period
PlaySoundPlays a sound file
PrintDisplays a message in the log
PrintFormatFormats and prints the sets of symbols and values in a log file in accordance with a preset format
ResetLastErrorSets the value of a predetermined variable _LastError to zero
ResourceCreateCreates an image resource based on a data set
ResourceFreeDeletes dynamically created resource (freeing the memory allocated for it)
ResourceReadImageReads data from the graphical resource created by ResourceCreate() function or saved in EX4 file during compilation
ResourceSaveSaves a resource into the specified file
SendFTPSends a file at the address specified in the settings window of the “FTP” tab
SendMailSends an email at the address specified in the settings window of the “Email” tab
SendNotificationSends push notifications to mobile terminals, whose MetaQuotes ID are specified in the “Notifications” tab
SleepSuspends execution of the current Expert Advisor or script within a specified interval
TerminalCloseCommands the terminal to complete operation
TesterStatisticsIt returns the value of a specified statistic calculated based on testing results
TranslateKeyReturns a Unicode character by a virtual key code
WebRequestSends HTTP request to the specified server
ZeroMemoryResets a variable passed to it by reference. The variable can be of any type, except for classes and structures that have constructors.

What’s new in MQL5

In MQL5, the SendFTP, SendMail and SendNotification functions are moved to the new extended Network functions section. Now programs can exchange data with remote servers included in the list of allowed IP addresses. This means that MQL5 EAs are able to establish secure connections between processes using the TCP/IP protocol without using third-party DLLs.

Last updated on