Text_SetLocation (Reserved Word)
All text objects are anchored at a specific bar and price value on the price chart. This reserved word modifies the point at which the specified text object is anchored.
Value1 = Text_SetLocation(Text_ID, BarDate, BarTime, Price)
Text_ID is a numeric expression representing the ID number of the text object to modify; BarDate and BarTime are numeric expressions representing the new EasyLanguage date and time, respectively, at which to anchor the text object; and Price is the new price value at which to anchor the text object.
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.
We recommend that you change the location of the text object rather than delete the text object and draw a new one. Relocating an existing object is faster and generates fewer ID numbers to keep track of.
Example
The following moves the text object with the identification number 2 to January 14, 1999, 3:00pm, at a price location of 150.
Text_SetLocation(2, 990114, 1500, 150.00) ;
Additional Example
The first statement is done only once, on the first bar after MaxBarsBack. This statement creates a new text object containing the symbol and places it above the first
bar after Max BarsBack. The second statement is done on every bar (or tick) and changes the location of the text so that it always displays above the last visible bar of the chart:
If BarNumber = 1 Then Value1 = Text_New(Date, Time, High + Range*.25, GetSymbolName);
Value2 = Text_SetLocation(Value1, Date, Time, High + Range*.25);