TLValue (Function)

image\trumpet2.gif Disclaimer

The TLValue function returns the value of a trendline at specified point.

Syntax

TLValue(StartPrice, StartBar, EndPrice, EndBar, TgtBar)

Parameters

Name

Type

Description

StartPrice

Numeric

Sets the price of the trendline start point.

StartBar

Numeric

Sets the bar number (bars ago) of the trendline start point.

EndPrice

Numeric

Sets the price of the trendline end point.

EndBar 

Numeric

Sets the bar number (bars ago) of the trendline end point.

TgtBar 

Numeric

Set the number of bars to extend trendline (positive number = backwards in time & negative number = forward in time).

Returns (Double)

A numeric value containing the specified trendline at point TgtBar.

Remarks

The two points allow us to calculate the slope of the line; by extending that line, the TLValue function is able to calculate the Price of the target bar in the future.

To calculate the value the function will need the bar numbers and prices for the two endpoints of the trendline as well as the target bar out in the future or back in the past. The input StartPrice and EndPrice are the starting point and ending points of the trendline respectively. They are usually replaced by values such as Close, High, Low, and so on or replaced with numeric series type inputs.

The inputs StartBar and EndBar refer to the bar numbers of the starting and ending points of the trendline. These inputs must be replaced by valid numbers or replaced with numeric simple type inputs.

  You must offset the price by its corresponding bar number. For example, if you wanted the trendline angle for a line drawn from the Close of ten bars ago to the Close of the current bar, replace the inputs StartPrice, StartBar, EndPrice, and EndBar would be replaced with the values Close[0], 0, Close[10], and 10 respectively.

The input TgtBar must be replaced by either a positive or negative number that represents the number of bars back in the past or out in the future that the trendline is to be extended. Negative values of TgtBar project the trendline into the future, while; positive values of TgtBar project the trendline back into the past

The inputs EndBar and StartBar refer to the number of bars ago (from the current bar) of the starting and ending points of the trendline. These inputs can be replaced by whole numbers or with numeric simple type inputs that return positive whole numbers when using their default values.

The formula used to calculate the slope is a simple rise over run calculation.

Example

Plot1(TLValue(High,1,High,9,1));

See Also

TLValueEasy