ATR(HLC, n=14, maType, ...)
maType
function.HLC
or a matrix (if try.xts
fails) containing the columns:ma
) true range of the series. The ATR is a component of the Welles Wilder Directional Movement Index (DX
, ADX
).
EMA
, SMA
, etc. for moving average options; and note
Warning section. See DX
, which uses true range.
See chaikinVolatility
for another volatility measure.data(ttrc)
atr <- ATR(ttrc[,c("High","Low","Close")], n=14)
Run the code above in your browser using DataLab