Displaying 1 result from an estimated 1 matches for "mo10".
Did you mean:
md10
2013 May 16
1
To List or Not To List
...ptm <- proc.time()
>
>
> ROCFunc<-function(DF){
+ if(nrow(DF)>129){DF$Mo129<-ROC(DF[,"Close"],n=129)}
+ if(nrow(DF)> 65){DF$Mo65 <-ROC(DF[,"Close"],n= 65)}
+ if(nrow(DF)> 21){DF$Mo21 <-ROC(DF[,"Close"],n= 21)}
+ if(nrow(DF)> 10){DF$Mo10 <-ROC(DF[,"Close"],n= 10)}
+ if(nrow(DF)> 5){DF$Mo5 <-ROC(DF[,"Close"],n= 5)}
+ return(DF)
+ }
> for(i in symbols) assign( i, ROCFunc(get(i)))
>
>
> time<-proc.time() - ptm
> time
user system elapsed
43.52 0.58 44.15
Using a list approa...