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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 7 00:08:27 CET 2015


Author: bodanker
Date: 2015-12-07 00:08:26 +0100 (Mon, 07 Dec 2015)
New Revision: 1721

Modified:
   pkg/quantstrat/demo/luxor.2.add.paramsets.R
Log:
Corrections to luxor.4

Give each distribution separate labels (add.distribution over-writes
existing parameter distributions without warning).

Add distribution contraints so all combinations of entry/exit and
long/short rules have the same timespan.


Modified: pkg/quantstrat/demo/luxor.2.add.paramsets.R
===================================================================
--- pkg/quantstrat/demo/luxor.2.add.paramsets.R	2015-12-06 21:46:31 UTC (rev 1720)
+++ pkg/quantstrat/demo/luxor.2.add.paramsets.R	2015-12-06 23:08:26 UTC (rev 1721)
@@ -62,7 +62,7 @@
 	component.type = 'enter',
 	component.label = 'EnterLONG',
 	variable = list(timespan = .timespans),
-	label = 'Timespan'
+	label = 'EnterLong'
 )
 
 add.distribution(strategy.st,
@@ -70,7 +70,7 @@
 	component.type = 'enter',
 	component.label = 'EnterSHORT',
 	variable = list(timespan = .timespans),
-	label = 'Timespan'
+	label = 'EnterShort'
 )
 
 add.distribution(strategy.st,
@@ -78,7 +78,7 @@
 	component.type = 'exit',
 	component.label = 'Exit2LONG',
 	variable = list(timespan = .timespans),
-	label = 'Timespan'
+	label = 'ExitLong'
 )
 
 add.distribution(strategy.st,
@@ -86,9 +86,33 @@
 	component.type = 'exit',
 	component.label = 'Exit2SHORT',
 	variable = list(timespan = .timespans),
-	label = 'Timespan'
+	label = 'ExitShort'
 )
 
+add.distribution.constraint(strategy.st,
+	paramset.label = 'Timespan',
+	distribution.label.1 = 'EnterLong',
+	distribution.label.2 = 'EnterShort',
+	operator = '==',
+	label = 'EnterTimespan'
+)
+
+add.distribution.constraint(strategy.st,
+	paramset.label = 'Timespan',
+	distribution.label.1 = 'ExitLong',
+	distribution.label.2 = 'ExitShort',
+	operator = '==',
+	label = 'ExitTimespan'
+)
+
+add.distribution.constraint(strategy.st,
+	paramset.label = 'Timespan',
+	distribution.label.1 = 'EnterLong',
+	distribution.label.2 = 'ExitShort',
+	operator = '==',
+	label = 'EnterExitTimespan'
+)
+
 ###
 
 save.strategy(strategy.st)



More information about the Blotter-commits mailing list