Skip to content

addATR() and addTA(ATR()) generate different plots

2 messages · manojit_roy at comcast.net, Joshua Ulrich

#
On Thu, Nov 28, 2013 at 9:33 AM, <manojit_roy at comcast.net> wrote:
ATR requires a HLC object.  You're passing an OHLCV object to it.  Try:
plot(addTA(ATR(HLC(ticker),n=20)$atr,col='blue',lwd=2))

TTR can't use the HLC function because HLC is in quantmod and quantmod
depends on TTR.  So, for the time being, you have to be thoughtful
about the columns in the object you pass to TTR functions.

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com