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 1594, Sat Mar 29 20:39:45 2014 UTC revision 1632, Tue Sep 16 14:00:04 2014 UTC
# Line 146  Line 146 
146  }  }
147    
148  ret1 <- PortfReturns('faber')  ret1 <- PortfReturns('faber')
 ret1 <- to.monthly(ret1)  
149  ret1$total <- rowSums(ret1)  ret1$total <- rowSums(ret1)
150    
151  View(ret1)  View(ret1)
152    
153  if("package:PerformanceAnalytics" %in% search() || require("PerformanceAnalytics",quietly=TRUE)){  if("package:PerformanceAnalytics" %in% search() || require("PerformanceAnalytics",quietly=TRUE)){
154          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')
155          SPY<-to.monthly(SPY)          SPY<-to.monthly(SPY, indexAt='lastof')
156          SPY.ret<-Return.calculate(SPY$SPY.Close)          SPY.ret<-Return.calculate(SPY$SPY.Close)
157          dev.new()          dev.new()
158          charts.PerformanceSummary(cbind(ret1$total,SPY.ret), geometric=FALSE, wealth.index=TRUE)          charts.PerformanceSummary(cbind(ret1$total,SPY.ret), geometric=FALSE, wealth.index=TRUE)

Legend:
Removed from v.1594  
changed lines
  Added in v.1632

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