[R] quantmod ATR problem

Chris chris at chrisbird.com
Wed Nov 19 09:28:18 CET 2008


Trying to plot ATR of time series using SMA using quantmod, plots fine
with maType="EMA".
However, when I use maType="SMA" I get the following error:

Error in SMA(c(0, 0, 0, 0, 0, ... :
   unused arguments(s) (wilder = FALSE)
Calls: addATR -> ATR -> do.call -> SMA
Execution halted

The code I am using is:

addATR(n=20, wilder=FALSE, maType="SMA")       # does not work
addATR(n=20, maType="EMA")                              # works fine

Note, the problem still occurs if the wilder argument is modified or
completely removed.
This is probably quite simply, but I am very new to [R] - any help
would be appeciated.

Regards,

Chris.



More information about the R-help mailing list