Text_SetColor (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved word sets the color of the specified text object.

Value1 = Text_SetColor(Text_ID, Color)

Text_ID is a numeric expression representing the ID number of the text object, and Color is an EasyLanguage color or its numeric equivalent. See EasyLanguage Colors for a list of valid colors.

Value1 is any numeric variable or array. You must assign the text object reserved word to a numeric variable or array so that you can determine whether or not the reserved word performed its operation successfully.

  It is important to remember that if an invalid ID number is used, the reserved word will return a value of -2 and no additional operations will be performed on any text objects by the trading strategy, analysis technique, or function that generated the error. For a list of error codes, see EasyLanguage Drawing Object Error Codes.

Example

To set the text object with the identification number 1 to yellow, you would write either of the following:

Text_SetColor(1, 65535);

Text_SetColor(1, Yellow);

Additional Example

The following indicator displays the word "Key" wherever there is a key reversal pattern on the price chart, and sets the color of the text object to Red:

Variables: ID(-1);

If Low
< Low[1] AND Close > High[1] Then Begin
 ID = Text_New(Date, Time, Low, "Key");
 Value1 = Text_SetColor(ID, Red);
End
;