SCM

SCM Repository

[blotter] Diff of /pkg/quantstrat/demo/macdParameters.R
ViewVC logotype

Diff of /pkg/quantstrat/demo/macdParameters.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 686, Wed Jul 20 20:30:17 2011 UTC revision 687, Wed Jul 20 21:26:22 2011 UTC
# Line 3  Line 3 
3  # Author: CCD  # Author: CCD
4  ###############################################################################  ###############################################################################
5    
6    source("D:\\Documents\\GoogleCode\\Workspace\\quantstrat\\R\\parameters.R")
7    
8  #please run macd demo before all these...  #please run macd demo before all these...
9  paramStructure<-getParameterTable(stratMACD)  paramStructure<-getParameterTable(stratMACD)
# Line 19  Line 19 
19    
20  pConstraint2<-setParameterConstraint(constraintLabel='macdPC',paramList=c('nFast','nSlow'),relationship='lt')  pConstraint2<-setParameterConstraint(constraintLabel='macdPC',paramList=c('nFast','nSlow'),relationship='lt')
21    
22  testPackList2<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=3,parameterConstrains=pConstraint2)  
23    
24    #testPackList2<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=3,parameterConstrains=pConstraint2)
25    #system.time(testPackList2<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=3,parameterConstrains=pConstraint2))
26    
27    require(foreach)
28    require(doSMP)
29    #
30    #workers <- startWorkers(2) # My computer has 2 cores
31    #registerDoSMP(workers)
32    
33    laststpar<-system.time(testPackList3<-applyParameter(strategy=stratMACD,portfolios=portfolio.st,parameterPool=tPD2,method='random',sampleSize=2,parameterConstrains=pConstraint2))
34    laststpar
35    #
36    #stopWorkers(workers)
37    #rmSessions(all=TRUE)
38    
39    
40    
41    
42    

Legend:
Removed from v.686  
changed lines
  Added in v.687

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge