[Blotter-commits] r687 - pkg/quantstrat/demo
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jul 20 23:26:26 CEST 2011
Author: cyrforge
Date: 2011-07-20 23:26:22 +0200 (Wed, 20 Jul 2011)
New Revision: 687
Modified:
pkg/quantstrat/demo/parameterTestMACD.R
Log:
Add comments
Try to implement parallel execution in applyParameter , but still need to solve the error.
Modified: pkg/quantstrat/demo/parameterTestMACD.R
===================================================================
--- pkg/quantstrat/demo/parameterTestMACD.R 2011-07-20 20:30:17 UTC (rev 686)
+++ pkg/quantstrat/demo/parameterTestMACD.R 2011-07-20 21:26:22 UTC (rev 687)
@@ -3,8 +3,8 @@
# Author: CCD
###############################################################################
+source("D:\\Documents\\GoogleCode\\Workspace\\quantstrat\\R\\parameters.R")
-
#please run macd demo before all these...
paramStructure<-getParameterTable(stratMACD)
@@ -19,6 +19,24 @@
pConstraint2<-setParameterConstraint(constraintLabel='macdPC',paramList=c('nFast','nSlow'),relationship='lt')
-testPackList2<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=3,parameterConstrains=pConstraint2)
+#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
+#
+#stopWorkers(workers)
+#rmSessions(all=TRUE)
+
+
+
+
+
More information about the Blotter-commits
mailing list