[Blotter-commits] r662 - pkg/quantstrat/demo
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jul 8 03:00:35 CEST 2011
Author: cyrforge
Date: 2011-07-08 03:00:35 +0200 (Fri, 08 Jul 2011)
New Revision: 662
Modified:
pkg/quantstrat/demo/parameterTest.R
Log:
add parameter sample uniqueness check.
add parameter constraint functionality and check.
add regenerate sample to total sample size as some samples will be filtered out.
Modified: pkg/quantstrat/demo/parameterTest.R
===================================================================
--- pkg/quantstrat/demo/parameterTest.R 2011-07-06 18:42:19 UTC (rev 661)
+++ pkg/quantstrat/demo/parameterTest.R 2011-07-08 01:00:35 UTC (rev 662)
@@ -6,6 +6,7 @@
#please run bbands demo before all these...
+paramStructure<-getParameterTable(stratBBands)
tPD<-setParameterDistribution()
@@ -27,10 +28,14 @@
# Just provide leagal values and use random sampling.
-tPD<-setParameterDistribution(tPD,'indicator',indexnum=1,distribution=list(sd=(1:3)),weight=c(.25,.25,.5))
-tPD<-setParameterDistribution(tPD,'signal',indexnum=2,distribution=list(sd=1:10),weight=1:10)
-tPD<-setParameterDistribution(tPD,'signal',indexnum=3,distribution=list(n=20:30))
+tPD<-setParameterDistribution(tPD,'indicator',indexnum=1,distribution=list(sd=(1:3)),weight=c(.25,.25,.5),label='sd')
+tPD<-setParameterDistribution(tPD,'signal',indexnum=2,distribution=list(relationship=c("lt","lte")),label='rel')
+#tPD<-setParameterDistribution(tPD,'signal',indexnum=2,distribution=list(relationship=c("lte")))
+tPD<-setParameterDistribution(tPD,'indicator',indexnum=1,distribution=list(n=20:30),label='n')
-testPackList<-applyParameter(strategy=stratBBands,portfolios='bbands',parameterPool=tPD,method='random',sampleSize=5)
+#pConstr<-setParameterConstraint()
+pConstraint<-setParameterConstraint(constraintLabel='PC1',paramList=c('sd','n'),relationship='gt')
+testPackList<-applyParameter(strategy=stratBBands,portfolios='bbands',parameterPool=tPD,method='random',sampleSize=2,parameterConstrains=pConstraint)
+
More information about the Blotter-commits
mailing list