ATR: True Range / Average True Range

Description Usage Arguments Details Value Author(s) References See Also Examples

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

1
  ATR(HLC, n = 14, maType, ...)

Arguments

HLC

Object that is coercible to xts or matrix and contains High-Low-Close prices.

n

Number of periods for moving average.

maType

A function or a string naming the function to be called.

...

Other arguments to be passed to the maType function.

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 object of the same class as HLC or a matrix (if try.xts fails) containing the columns:

tr

The true range of the series.

atr

The average (as specified by ma) true range of the series.

trueHigh

The true high of the series.

trueLow

The true low of the series.

Author(s)

Joshua 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

1
2
data(ttrc)
atr <- ATR(ttrc[,c("High","Low","Close")], n=14)

Example output



TTR documentation built on April 15, 2017, 8:31 a.m.

Related to ATR in TTR...