WebCab Technical Analysis for COM v1.1

Momentum.TrendIntensityIndex Method 

Trend Intensity Index measures the strength of a trend by comparing the deviation of the price with its corresponding moving average.

public double TrendIntensityIndex(
   double[] prices,
   int lengthOfMA
);

Parameters

prices
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the price in the last trading period, the second term is the price in the previous trading period and so on.
lengthOfMA
The number of periods considered within the evaluation of the moving average of each of the periods on which it can be evaluated.

Return Value

An integer which represent the trend intensity index of the given period.

Remarks

Evaluation Procedure

If the price is greater than the moving average a positive deviation is recorded, and if price is less than the moving average a negative deviation is recorded. Where the size of the deviation in each case is simply the (absolute) difference between the price and the moving average. The indicator is given by the following formula:

TTI = 100 * ( Sum of Positive Deviations ) / ( ( Sum of Positive Deviations ) + ( Sum of Negative Deviations ) )

Exceptions

Exception TypeCondition
ArgumentExceptionThrown if prices array has strictly negative elements or if the lengthOfMA argument is greater then the length of prices array.

See Also

Momentum Class | WebCab.COM.Finance.Trading.Indicators Namespace