SCM

SCM Repository

[blotter] Diff of /pkg/quantstrat/demo/faber.R
ViewVC logotype

Diff of /pkg/quantstrat/demo/faber.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1376, Mon Jan 21 23:41:11 2013 UTC revision 1416, Fri Mar 29 15:40:50 2013 UTC
# Line 140  Line 140 
140  }  }
141    
142  ret1 <- PortfReturns('faber')  ret1 <- PortfReturns('faber')
143  ret1$total<-rowSums(ret1)  View(ret1)
 ret1  
144    
145  if("package:PerformanceAnalytics" %in% search() || require("PerformanceAnalytics",quietly=TRUE)){  if("package:PerformanceAnalytics" %in% search() || require("PerformanceAnalytics",quietly=TRUE)){
146          getSymbols("SPY", src='yahoo', index.class=c("POSIXt","POSIXct"), from='1999-01-01')          getSymbols("SPY", src='yahoo', index.class=c("POSIXt","POSIXct"), from='1999-01-01')
147          SPY<-to.monthly(SPY)          SPY<-to.monthly(SPY)
148          SPY.ret<-Return.calculate(SPY$SPY.Close)          SPY.ret<-Return.calculate(SPY$SPY.Close)
149          index(SPY.ret)<-index(ret1)          index(SPY.ret)<-c(as.Date('1999-01-01'),index(ret1))
150          dev.new()          dev.new()
151          charts.PerformanceSummary(cbind(ret1$total,SPY.ret), geometric=FALSE, wealth.index=TRUE)          charts.PerformanceSummary(cbind(ret1$total,SPY.ret), geometric=FALSE, wealth.index=TRUE)
152  }  }

Legend:
Removed from v.1376  
changed lines
  Added in v.1416

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge