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

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

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