[Blotter-commits] r1270 - pkg/quantstrat/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 28 19:25:57 CET 2012


Author: braverock
Date: 2012-11-28 19:25:56 +0100 (Wed, 28 Nov 2012)
New Revision: 1270

Modified:
   pkg/quantstrat/R/applyStrategy.rebalancing.R
Log:
- revert to r1268 approach of single symbols loop in rules application section

Modified: pkg/quantstrat/R/applyStrategy.rebalancing.R
===================================================================
--- pkg/quantstrat/R/applyStrategy.rebalancing.R	2012-11-28 18:23:30 UTC (rev 1269)
+++ pkg/quantstrat/R/applyStrategy.rebalancing.R	2012-11-28 18:25:56 UTC (rev 1270)
@@ -144,19 +144,17 @@
                     applyRules(portfolio=portfolio, symbol=symbol, strategy=s, mktdata=md_subset, Dates=NULL, indicators=sret$indicators, signals=sret$signals, parameters=parameters,  ..., path.dep=TRUE)
                     #)
                 }
-            } #end loop over symbols for this sub-period
-            
+                
                 #ret[[portfolio]][[symbol]]<-sret
                 
-            #now call the rebalancing rules
-            #to nest different rebalancing periods, we need to check if the pindex 'i' is in specific rebalance_on periods
-            # specifically, we need to check if *this* index is in st$plist$period
-            for(period in names(st$plist)){
-                if(pindex[i] %in% st$plist[[period]]){
-                    #this index is a rebalancing index for period
-                    #call the rebalance rules for this period
-                    #still need to separate the rules by rebalancing period, this will call them all
-                    for (symbol in symbols){
+                #now call the rebalancing rules
+                #to nest different rebalancing periods, we need to check if the pindex 'i' is in specific rebalance_on periods
+                # specifically, we need to check if *this* index is in st$plist$period
+                for(period in names(st$plist)){
+                    if(pindex[i] %in% st$plist[[period]]){
+                        #this index is a rebalancing index for period
+                        #call the rebalance rules for this period
+                        #still need to separate the rules by rebalancing period, this will call them all
                         ruleProc(s$rules$rebalance,
                                 timestamp=pindex[i], 
                                 path.dep=TRUE, 
@@ -168,7 +166,7 @@
                                 symbol=symbol)
                     }
                 }
-            }
+            } #end loop over symbols for this sub-period
         }
         
         # updateStrat



More information about the Blotter-commits mailing list