[Blotter-commits] r1157 - pkg/quantstrat/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 6 01:48:42 CEST 2012


Author: opentrades
Date: 2012-09-06 01:48:42 +0200 (Thu, 06 Sep 2012)
New Revision: 1157

Modified:
   pkg/quantstrat/R/rules.R
Log:
limitorders <- limitorders[-stoplimitorders] removed, does not work
changed regexp in grep for exact matches '^limit$' and '^stoplimit$'



Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R	2012-09-05 23:42:13 UTC (rev 1156)
+++ pkg/quantstrat/R/rules.R	2012-09-05 23:48:42 UTC (rev 1157)
@@ -408,9 +408,8 @@
                 if (!length(grep('limit',ordersubset[oo.idx,'Order.Type']))==0){ # process limit orders
                     #else limit
                     #print("limit")
-                    stoplimitorders <- grep('stoplimit',ordersubset[oo.idx,'Order.Type'])
-                    limitorders<-grep('limit',ordersubset[oo.idx,'Order.Type'])
-                    limitorders <- limitorders[-stoplimitorders]
+                    stoplimitorders <- grep('^stoplimit$',ordersubset[oo.idx,'Order.Type'])
+                    limitorders<-grep('^limit$',ordersubset[oo.idx,'Order.Type'])
 
                     for (slorder in stoplimitorders) {
                         dindex <- get.dindex()



More information about the Blotter-commits mailing list