MQL4 Reference Common Functions Alert

MQL4 Help as One File:


Displays a message in a separate window.

void  Alert(
   argument,     // first value
   ...           // other values



[in]  Any values separated by commas. To split the information output in several lines you can use the line feed characters "\r\n". The number of parameters can not exceed 64.

Return Value

No return value.


Arrays can't be passed to the Alert() function. Arrays should be output elementwise. Data of the double type are output with 8 digits after the decimal point, data of the float type are displayed with 5 digits after the decimal point. To output the real numbers with a different precision or in a scientific format, use the DoubleToString() function.

Data of the bool type is output as "true" or "false" strings. Dates are output as YYYY.MM.DD HH:MI:SS. To display a date in another format use the TimeToString() function. Data of the color type are output either as an R,G,B string or as a color name, if the color is present in a color set.

Alert() function does not work in the Strategy Tester.

See also

Comment(), Print()