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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 13 22:23:30 CET 2012


Author: opentrades
Date: 2012-11-13 22:23:30 +0100 (Tue, 13 Nov 2012)
New Revision: 1250

Modified:
   pkg/quantstrat/R/paramsets.R
Log:
- all order_books from slaves are now also assigned to master .strategy environment



Modified: pkg/quantstrat/R/paramsets.R
===================================================================
--- pkg/quantstrat/R/paramsets.R	2012-11-13 20:49:59 UTC (rev 1249)
+++ pkg/quantstrat/R/paramsets.R	2012-11-13 21:23:30 UTC (rev 1250)
@@ -382,6 +382,9 @@
             full.portfolio.st <- paste('portfolio', result$portfolio.st, sep='.')
             assign(full.portfolio.st, result$blotter[[full.portfolio.st]], envir=.blotter)
 
+            full.order_book.st <- paste('order_book', result$portfolio.st, sep='.')
+            assign(full.order_book.st, result$strategy[[full.order_book.st]], envir=.strategy)
+
             updatePortf(result$portfolio.st, Dates=paste('::',as.Date(Sys.time()),sep=''))
 
             result$tradeStats <- tradeStats(result$portfolio.st)
@@ -393,7 +396,8 @@
     }
 
     results <- foreach(param.combo=iter(param.combos,by='row'),
-        .verbose=verbose, .packages='quantstrat',
+        .verbose=verbose, .errorhandling='pass',
+        .packages='quantstrat',
         .combine=combine, .multicombine=TRUE, .maxcombine=100,
         .export=c(env.functions, 'env.blotter', 'env.instrument', 'env.strategy', 'symbol.list', symbol.names)) %dopar%
     {
@@ -426,6 +430,7 @@
         applyStrategy(strategy, portfolios=result$portfolio.st, verbose=verbose)
 
         result$blotter <- as.list(.blotter)
+        result$strategy <- as.list(.strategy)
 
         return(result)
     }



More information about the Blotter-commits mailing list