TDI {TTR}R Documentation

Trend Detection Index

Description

The Trend Detection Index (TDI) attempts to identify starting and ending trends. Developed by M. H. Pee.

Usage

  TDI(price, n=20)

Arguments

price Price series to use.
n Number of periods to use.

Details

The TDI is the (1) absolute value of the n-day sum of the n-day momentum, minus the quantity of (2) 2*n-day sum of the absolute value of the n-day momentum, minus (3) n-day sum of the absolute value of the n-day momentum.

I.e. TDI = (1) - [ (2) - (3) ]

The direction indicator is the sum of the n-day momentum over the last n days.

See URL in references section for further details.

Value

A matrix containing the columns:

tdi The Trend Detection Index.
di The Direction Indicator.

Note

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.

Author(s)

Josh Ulrich

References

The following site(s) were used to code/document this indicator:
http://www.linnsoft.com/tour/techind/tdi.htm

See Also

See aroon, CCI, ADX, VHF for other indicators that measure trend direction/strength.

Examples

  data(ttrc)
  tdi <- TDI(ttrc[,"Close"], n=30)

[Package TTR version 0.14-0 Index]