TL_GetFirst (Reserved Word)
EasyLanguage enables you to search for trendlines based on how and in what order they were created. The charting application stores the chronological order of all trendlines added to a chart, and this information is made available to EasyLanguage. This reserved word returns the ID number of the first trendline added to the price chart (by a trading strategy, analysis technique, or function, or by a drawing tool, or by either).
Value1 = TL_GetFirst(Pref)
Value1 is any numeric variable or array that holds the ID number of the desired trendline. Pref is a numeric expression representing the origin type of the trendline. Refer to EasyLanguage Trendline and Text Object Parameters for a list of possible values.
Remarks
When the reserved word performs its operation successfully, the identification number is returned. When a reserved word cannot perform its operation, it returns an error code. For a list of error codes, see EasyLanguage Drawing Object Error Codes.
When the oldest (first) trendline is deleted, the next oldest (second) trendline becomes the first drawn on the price chart, and so on.
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 trendlines by the trading strategy, analysis technique, or function that generated the error.
Example
You must assign the reserved word to a numeric variable to obtain the identification number (or error code) returned by the reserved word. The following returns the identification number of the first trendline drawn on the chart, regardless of how it was drawn.
Value1 = TL_GetFirst(3) ;
Additional Example
The following statements delete the oldest trendline on a price chart drawn by a trading strategy, analysis technique, or function:
Value1 = TL_GetFirst(1);
Value2 = TL_Delete(Value1);