<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi,</div>
<div> </div>
<div>here my code</div>
<div> </div>
<div>require(quantmod)<br/>
indexes<-c("XLB","XLE","XLF","XLI","XLK","XLP","XLU","XLV","XLY")<br/>
getSymbols(indexes)</div>
<div> </div>
<div>p=cbind(Ad(XLB),Ad(XLE),Ad(XLF),Ad(XLI),Ad(XLK),Ad(XLP),Ad(XLU),Ad(XLV),Ad(XLY))</div>
<div> </div>
<div>XLB.CCI=CCI(p[,1],10)<br/>
XLE.CCI=CCI(p[,2],15)<br/>
XLF.CCI=CCI(p[,3],16)<br/>
XLI.CCI=CCI(p[,4],22)<br/>
XLK.CCI=CCI(p[,5],28)<br/>
XLP.CCI=CCI(p[,6],32)<br/>
XLU.CCI=CCI(p[,7],9)<br/>
XLV.CCI=CCI(p[,8],6)<br/>
XLY.CCI=CCI(p[,9],10)</div>
<div> </div>
<div>p.CCI=cbind(XLB.CCI,XLE.CCI,XLF.CCI,XLI.CCI,XLK.CCI,XLP.CCI,XLU.CCI,XLV.CCI,XLY.CCI)</div>
<div> </div>
<div> </div>
<div>long=lag(p.CCI,k=1)*ROC(p,type="discrete",n=1)</div>
<div>charts.PerformanceSummary(long,ylog=TRUE,main="TEST")</div>
<div> </div>
<div>How can I now sum each column now in the object long, keeping the day and just addsum (p.CCI*ROC)</div>
<div> </div>
<div>Any idea ?</div>
<div> </div>
<div>Many thanks</div></div></body></html>