如何在r中的多个时间序列数据中应用公式?

时间:2013-11-06 15:41:39

标签: r time-series

我下载了一些股票并向他们申请SMA功能(帽子提示Josh Ulrich)

library(quantmod)
e <- new.env()
getSymbols('GOOG;FB', from='2000-01-01', env=e)
close <- cbind(Cl(GOOG),Cl(FB))
smacheck <- do.call(merge, eapply(e, function(x) SMA(Cl(x), 50)))



sig1<-ifelse(close<smacheck,1,0)

   Error in .xts(e, .index(e1), .indexCLASS = indexClass(e1), .indexFORMAT = indexFormat(e1),  : 
  index is not in  increasing order

我想在两个时间序列中应用此公式,但我得到上一个错误

0 个答案:

没有答案