[R-SIG-Finance] quantmod bug ?

Olivier MARTIN Olivier.Martin at avignon.inra.fr
Wed Aug 8 17:05:11 CEST 2012


Hi all,

I recently posted a problem concerning shaded regions with quantmod 
package. More precisely,
I used the function addTA with a boolean vector: for example
addTA(vecB,col="green",border=NA,on=-1)
where vecB is the boolean vector.

In some cases, the shading result was not conform
with the boolean vector. I checked the R source  program, and more
precisely the function chartTA() in TA.R file. So in the function
chartTA, it seems that there is a mistake with the vector x.pos.
the vector is given by
  x.pos <- 1 + spacing * (1:length(x.range))
and it seems that this vector should be
x.pos <- 1:(spacing*x.range[2])

So I hope this indication would be  relevant for people who work on
the improvements of this package.

Best regards.
O.



More information about the R-SIG-Finance mailing list