The Trend Detection Index (TDI) attempts to identify starting and ending trends. Developed by M. H. Pee.
TDI(price, n = 20, multiple = 2)
Price series that is coercible to xts or matrix.
Number of periods to use.
Multiple used to calculate (2).
The TDI is the (1) absolute value of the
n-day momentum, minus the quantity of (2)
n-day sum of the absolute value of
n-day momentum, minus (3)
n-day sum of
the absolute value of the
I.e. TDI = (1) - [ (2) - (3) ]
The direction indicator is the sum of the
momentum over the last
See URL in references section for further details.
A object of the same class as
price or a matrix
try.xts fails) containing the columns:
The Trend Detection Index.
The Direction Indicator.
Positive/negative TDI values signal a trend/consolidation. A positive/ negative direction indicator signals a up/down trend. I.e. buy if the TDI and the direction indicator are positive, and sell if the TDI is positive while the direction indicator is negative.
The following site(s) were used to code/document this
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.