MQL4 Reference Object Functions ObjectSetText

ObjectSetText

The function changes the object description.

bool  ObjectSetText(
   string   object_name,         // object name
   string   text,                // description
   int      font_size=0,         // font size
   string   font_name=NULL,      // font name
   color    text_color=clrNONE   // text color
   );

Parameters

object_name

[in]  Object name.

text

[in]  A text describing the object.

font_size=0

[in]  Font size in points.

font_name=NULL

[in]  Font name.

text_color=clrNONE

[in]  Font color.

Returned value

Changes the object description.  If the function succeeds, the returned value will be true, otherwise false. To get the detailed error information, one has to call the GetLastError() function.

Note

For objects of OBJ_TEXT and OBJ_LABEL, this description is shown as a text line in the chart. Parameters of font_size, font_name and text_color are used for objects of OBJ_TEXT and OBJ_LABEL only. For objects of other types, these parameters are ignored.

Example:

  ObjectSetText("text_object","Hello world!",10,"Times New Roman",Green);

See also

ObjectDescription()