TL_SetEnd (Reserved Word)
This reserved word changes the end point of the specified trendline; the end point has a later date and time. If the trendline is vertical, the point with the higher price value is considered the ending point.
If the ending point of a trendline is changed (by EasyLanguage or by using the drawing tool) such that it has an earlier date than the starting point, the ending point then becomes the original starting point of the trendline.
Value1 = TL_SetEnd(Tl_ID, eDate, eTime, eVal)
Tl_ID is a numeric expression representing the identification number of the trendline, and eDate, eTime, and eVal are numeric expressions representing the trendline’s new ending point date, time, and price value, respectively. Dates and times use YYMMDD / YYYMMDD and 24-hour format, HHMM, respectively.
Value1 is any numeric variable or array. You must assign the trendline reserved word to a numeric variable or array so that you can determine whether or not the reserved word performed its operation successfully.
Remarks
When the reserved word performs its operation successfully, a 0 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.
This reserved word returns zero (0) when it successfully changes the end point of a trendline, and one of the EasyLanguage drawing object errors when it fails. For example, if the end point of the trendline is set to exactly the same value of the start point, the reserved word will return an error -5. Also, 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
The following sets the end point of the trendline referenced by Value99 to a value of 207.125 on February 21, 1999 at 3:15pm.
Value1 = TL_SetEnd(Value99, 990221, 1515, 207.125);
Additional Example
The following statement sets the end point of the trendline referenced by Value99 to the current bar’s high price:
Value1 = TL_SetEnd(Value99, Date, Time, High);