I get different plots for ATR() when adding this indicator to my chart in two different ways (see last 2 lines of the code below):

> require(quantmod)
> getSymbols('GTAT')
> ticker <- last(GTAT,'5 years')
> barChart(ticker,TA=NULL,theme='white',major.ticks='months',minor.ticks=FALSE,show.grid=FALSE)
> plot(addATR(n=20))
> plot(addTA(ATR(ticker,n=20)$atr,col='blue',lwd=2))

Can someone help me understand what I am doing wrong, and which ATR values I should use?

Thanks,
Manojit
	[[alternative HTML version deleted]]

