ATR {TTR}R Documentation

True Range / Average True Range

Description

True range (TR) is a measure of volatility of a High-Low-Close series; average true range (ATR) is a Welles Wilder's style moving average of the TR. Developed by J. Welles Wilder in 1978.

Usage

  ATR(HLC, ma = list("EMA", n=14, wilder=TRUE))

Arguments

HLC Object able to be coerced to a matrix, which contains High-Low-Close prices.
ma A list whose first component is a string containing the moving average function name; additional parameters may also be specified as named components.

Details

TR incorporates yesterday's close in the calculation (high minus low). E.g. if yesterday's close was higher than today's high, then the TR would equal yesterday's close minus today's low.

The ATR is a component of the Welles Wilder Directional Movement Index (DX, ADX).

Value

A matrix containing the columns:

tr The true range of the series.
atr The average (as specified by ma) true range of the series.
true.high The true high of the series.
true.low The true low of the series.

Author(s)

Josh Ulrich

References

The following site(s) were used to code/document this indicator:
http://www.fmlabs.com/reference/TR.htm
http://www.fmlabs.com/reference/ATR.htm
http://www.equis.com/Customer/Resources/TAAZ/?c=3&p=35
http://www.linnsoft.com/tour/techind/trueRange.htm
http://stockcharts.com/education/IndicatorAnalysis/indic_ATR.html

See Also

See EMA, SMA, etc. for moving average options; and note Warning section. See DX, which uses true range. See chaikinVolatility for another volatility measure.

Examples

  data(ttrc)
  atr <- ATR(ttrc[,c("High","Low","Close")], ma = list("EMA", n=14, wilder=TRUE))

[Package TTR version 0.13-1 Index]