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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to