[R-SIG-Finance] Can't addMACD(). Is it a bug?

R. Michael Weylandt michael.weylandt at gmail.com
Wed May 23 05:15:15 CEST 2012


Not runnable exactly as is.... where does the for loop have its close brace?

This works fine for me:

getSymbols("SPY", from = "1990-01-01")
y <- to.weekly(SPY)
chartSeries(y, type = "candlesticks", multi.col = TRUE, theme =
"white", subset = 'last 54 months', name = "SPY")
addMACD(fast = 12, slow = 26, signal = 9, type = "EMA", histogram = TRUE)
saveChart('pdf',width=25,height=13)

so try it for you.

Your data seems to work for me if I close the loop after MACD. Can you
display the error message or say more about why you think it doesn't
work?

Michael

On Tue, May 22, 2012 at 10:58 PM, Sávio M. Ramos <savio.debian at gmail.com> wrote:
> Hi,
>
> addMACD don't work. I am doing something wrong or it is a bug.
>
> The code:
>
> require(quantmod)
> lista <- c("PETR4.csv", "VALE3.csv")
> for (i in lista){
> x <- as.xts(read.zoo(i, sep=",", format="%Y-%m-%d", header=TRUE))
> y <- to.weekly(x)
> chartSeries(y, type="candlesticks", multi.col=TRUE, theme="white", subset='last 54 months', name=i)
> addMACD(fast = 12, slow = 26, signal = 9, type = "EMA", histogram = TRUE)
> saveChart('pdf',width=25,height=13)
>
>
> The two files is attached.
>
> []'s
> --
> Sávio M Ramos
> Arquiteto, Rio, RJ
> Só uso Linux desde 2000
> www.debian.org
>
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list