Learn R Programming

TTR (version 0.13-1)

DX: Welles Wilder's Directional Movement Index

Description

Directional Movement Index; developed by J. Welles Wilder.

Usage

DX(HLC, n=14, ma.adx=list("EMA", n=n, wilder=TRUE))

Arguments

HLC
Object able to be coerced to a matrix, which contains High-Low-Close prices.
n
Number of periods to use for DX calculation (not ADX calculation).
ma.adx
A list whose first component is a string containing the ADX moving average function name; additional parameters may also be specified as named components.

Value

  • A matrix containing the columns:
  • DIpThe positive Direction Index.
  • DInThe negative Direction Index.
  • DXThe Direction Index.
  • ADXThe Average Direction Index (trend strength).

concept

DMI

Details

The DIp/DIn (positive/negative) is the percentage of the true range that is up/down.

References

The following site(s) were used to code/document this indicator: http://www.fmlabs.com/reference/DI.htm http://www.fmlabs.com/reference/DX.htm http://www.fmlabs.com/reference/ADX.htm http://www.fmlabs.com/reference/ADXR.htm http://www.equis.com/Customer/Resources/TAAZ/Default.aspx?c=3&p=49 http://linnsoft.com/tour/techind/dirInd.htm http://linnsoft.com/tour/techind/adx.htm http://linnsoft.com/tour/techind/adxr.htm http://stockcharts.com/education/IndicatorAnalysis/indic_ADX.html

See Also

See EMA, SMA, etc. for moving average options; and note Warning section. The DX calculation uses ATR. See aroon, CCI, TDI, VHF for other indicators that measure trend direction/strength.

Examples

Run this code
data(ttrc)
  dmi.adx <- DX(ttrc[,c("High","Low","Close")])

Run the code above in your browser using DataLab