MQL4 Alert Function

Overview

  • Displays a message in a separate window.
  • Function signature: void Alert(argument, ...);
  • Parameters

  • argument: Any values separated by commas. Up to 64 parameters allowed.
  • Use "\r\n" for line breaks.
  • Return Value

  • None.
  • Notes

  • Arrays cannot be passed directly; output elementwise.
  • double type displayed with 8 decimal places.
  • float type displayed with 5 decimal places.
  • Use DoubleToString() for custom real number precision or scientific format.
  • bool type displayed as "true" or "false".
  • Dates displayed as YYYY.MM.DD HH:MI:SS.
  • Use TimeToString() for custom date formats.
  • Color types displayed as RGB string or color name.
  • **Limitation**: Alert() function does not work in the Strategy Tester.
  • Related Functions

  • Comment()
  • Print()