[Blotter-commits] r1325 - pkg/quantstrat/inst/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Dec 30 17:42:08 CET 2012
Author: milktrader
Date: 2012-12-30 17:42:08 +0100 (Sun, 30 Dec 2012)
New Revision: 1325
Modified:
pkg/quantstrat/inst/tests/blue.R
Log:
changed params to 10 30 for blue and moved rules around
Modified: pkg/quantstrat/inst/tests/blue.R
===================================================================
--- pkg/quantstrat/inst/tests/blue.R 2012-12-29 15:31:07 UTC (rev 1324)
+++ pkg/quantstrat/inst/tests/blue.R 2012-12-30 16:42:08 UTC (rev 1325)
@@ -29,8 +29,8 @@
acct = 'blueAcct'
initEq = 1e6
initDate = '1969-12-31'
-fast = 3
-slow = 8
+fast = 10
+slow = 30
############################# INITIALIZE ####################################
@@ -78,37 +78,25 @@
blue <- add.rule(
strategy = blue,
name = 'ruleSignal',
- arguments = list(sigcol = 'fast.lt.slow',
+ arguments = list(sigcol = 'fast.gt.slow',
sigval = TRUE,
- orderqty = 'all',
+ orderqty = 100,
ordertype = 'market',
orderside = 'long'),
- type = 'exit',
- label = 'ExitLONG')
+ type = 'enter',
+ label = 'EnterLONG')
blue <- add.rule(
strategy = blue,
name = 'ruleSignal',
- arguments = list(sigcol = 'fast.gt.slow',
- sigval = TRUE,
- orderqty = 'all',
- ordertype = 'market',
- orderside = 'short'),
- type = 'exit',
- label = 'ExitSHORT')
-
-blue <- add.rule(
- strategy = blue,
- name = 'ruleSignal',
- arguments = list(sigcol = 'fast.gt.slow',
+ arguments = list(sigcol = 'fast.lt.slow',
sigval = TRUE,
- orderqty = 100,
+ orderqty = 'all',
ordertype = 'market',
orderside = 'long'),
+ type = 'exit',
+ label = 'ExitLONG')
- type = 'enter',
- label = 'EnterLONG')
-
blue <- add.rule(
strategy = blue,
name = 'ruleSignal',
@@ -120,6 +108,17 @@
type = 'enter',
label = 'EnterSHORT')
+blue <- add.rule(
+ strategy = blue,
+ name = 'ruleSignal',
+ arguments = list(sigcol = 'fast.gt.slow',
+ sigval = TRUE,
+ orderqty = 'all',
+ ordertype = 'market',
+ orderside = 'short'),
+ type = 'exit',
+ label = 'ExitSHORT')
+
############################# APPLY STRATEGY ################################
applyStrategy(blue, port, prefer='Open', verbose=FALSE)
More information about the Blotter-commits
mailing list