TL_GetValue (Reserved Word)

image\trumpet2.gif Disclaimer

This reserved word returns a numeric expression corresponding to the value of a trendline at a specific bar. It is important to remember that this reserved word returns a value even if the trendline is not shown on or projected through the bar specified. For example, if a trendline is drawn from December 1st to January 5th, and the following statement is used:

Value1 = TL_GetValue(10, 990203, 1400);

Even though the date specified is in February, the TL_GetValue reserved word will return the trendline value as if the trendline were extended to that particular bar (along the same slope).

Value1 = TL_GetValue(Tl_ID, TLDate, TLTime)

Tl_ID is a numeric expression representing the ID number of the trendline whose price value you want to obtain. TLDate and TLTime are the date and time, respectively, of the bar for which you want to obtain the trendline’s value.

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, the vertical axis (price) value 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.

  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

To obtain the price value returned by the reserved word, you need to assign the reserved word to a numeric variable. On January 7, 1999 at 4:00pm, the trendline referenced by Value99 intersects the price value of 53.350. The following returns 53.350.

Value1 = TL_GetValue(Value99, 990107, 1600);

Additional Example

The following statement triggers an alert when the close crosses over the trendline referenced by Value99:

If Close Crosses Over TL_GetValue(Value99, Date, Time) Then
 
Alert("Trendline is broken");

See Also

TL_Delete

TL_GetActive

TL_GetAlert

TL_GetBeginDate

TL_GetBeginTime

TL_GetBeginVal

TL_GetColor

TL_GetEndDate

TL_GetEndTime

TL_GetEndVal

TL_GetFirst

TL_GetNext

TL_New

TL_SetBegin

TL_SetEnd

Trendline (class)