[Blotter-commits] r692 - pkg/quantstrat/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jul 22 01:00:07 CEST 2011


Author: cyrforge
Date: 2011-07-22 01:00:07 +0200 (Fri, 22 Jul 2011)
New Revision: 692

Modified:
   pkg/quantstrat/demo/parameterTestMACD.R
Log:
Miner changes for running parallel, example use doSMP.

Modified: pkg/quantstrat/demo/parameterTestMACD.R
===================================================================
--- pkg/quantstrat/demo/parameterTestMACD.R	2011-07-21 22:58:38 UTC (rev 691)
+++ pkg/quantstrat/demo/parameterTestMACD.R	2011-07-21 23:00:07 UTC (rev 692)
@@ -3,6 +3,12 @@
 # Author: CCD
 ###############################################################################
 
+require(foreach)
+require(doSMP)
+workers <- startWorkers(2)
+registerDoSMP(workers)
+
+
 source("D:\\Documents\\GoogleCode\\Workspace\\quantstrat\\R\\parameters.R")
 
 #please run macd demo before all these...
@@ -24,13 +30,10 @@
 #testPackList2<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=3,parameterConstrains=pConstraint2)
 #system.time(testPackList2<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=3,parameterConstrains=pConstraint2))
 
-require(foreach)
-require(doSMP)
-#
-#workers <- startWorkers(2) # My computer has 2 cores
-#registerDoSMP(workers)
 
-laststpar<-system.time(testPackList3<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=2,parameterConstrains=pConstraint2))
+laststpar<-system.time(
+		testPackListPL<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=10,parameterConstrains=pConstraint2)
+)
 laststpar
 #
 #stopWorkers(workers)



More information about the Blotter-commits mailing list