Text_New (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved word adds the specified text string to a price chart, at the specified bar and price value. It returns a numeric expression corresponding to the ID number of the text object added to the chart. If you want to modify the text object in any way, it is very important that you capture and keep this number; the ID number is the only way of referencing a specific text object.

Value1 = Text_New(BarDate, BarTime, Price, "MyText")

BarDate and BarTime are numeric expression corresponding to the date and time, respectively, for the bar on which you want to anchor the text object. Price is a numeric expression representing the price value at which to anchor the text object and MyText is the text string expression to add to the price chart.

All text objects are anchored at a specific bar and price value on the price chart. You need to provide this information to the Text_New reserved word in order for the trading strategy, analysis technique, or function to add a text object to the chart.

Value1 is any numeric variable or array, and holds the ID number for the new text object.

Text objects are added to the chart using the default color, and vertical and horizontal alignment of the charting application. Any of these properties can be changed using other Text-related reserved words.

Remarks

When the reserved word performs its operation successfully, the reserved word returns the ID number for the new text object. When the reserved word cannot perform its operation, it returns an error code. For a list of error codes, see EasyLanguage Drawing Object Error Codes.

  When any drawing object error occurs, no additional operations will be performed on any drawing objects by the trading strategy, analysis technique, or function that generated the error.

Example

For example, the following statements add a text string "Key" to a price chart every time there is a key reversal pattern:

Variable: ID(-1);

If Low < Low[1] AND Close > Close[1] Then

   ID = Text_New(Date, Time, Low, "Key");