[Blotter-commits] r1213 - pkg/quantstrat/demo
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Oct 6 20:03:01 CEST 2012
Author: braverock
Date: 2012-10-06 20:02:55 +0200 (Sat, 06 Oct 2012)
New Revision: 1213
Modified:
pkg/quantstrat/demo/maCross.R
Log:
- fix problem apparently related to changes in exit handling
Modified: pkg/quantstrat/demo/maCross.R
===================================================================
--- pkg/quantstrat/demo/maCross.R 2012-10-06 17:47:08 UTC (rev 1212)
+++ pkg/quantstrat/demo/maCross.R 2012-10-06 18:02:55 UTC (rev 1213)
@@ -28,7 +28,7 @@
stratMACROSS <- add.signal(strategy = stratMACROSS,name="sigCrossover",arguments = list(column=c("ma50","ma200"),relationship="lt"),label="ma50.lt.ma200")
stratMACROSS <- add.rule(strategy = stratMACROSS,name='ruleSignal', arguments = list(sigcol="ma50.gt.ma200",sigval=TRUE, orderqty=100, ordertype='market', orderside='long'),type='enter')
-stratMACROSS <- add.rule(strategy = stratMACROSS,name='ruleSignal', arguments = list(sigcol="ma50.lt.ma200",sigval=TRUE, orderqty=-100, ordertype='market', orderside='long'),type='exit')
+stratMACROSS <- add.rule(strategy = stratMACROSS,name='ruleSignal', arguments = list(sigcol="ma50.lt.ma200",sigval=TRUE, orderqty='all', ordertype='market', orderside='long'),type='exit')
# if you want a long/short Stops and Reverse MA cross strategy, you'd add two more rules for the short side:
More information about the Blotter-commits
mailing list