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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Apr 19 16:04:05 CEST 2013


Author: bodanker
Date: 2013-04-19 16:04:05 +0200 (Fri, 19 Apr 2013)
New Revision: 1441

Modified:
   pkg/quantstrat/R/rules.R
Log:
- check for open stoplimit orders before moving to next index


Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R	2013-04-18 21:01:16 UTC (rev 1440)
+++ pkg/quantstrat/R/rules.R	2013-04-19 14:04:05 UTC (rev 1441)
@@ -325,7 +325,9 @@
             isBBOmktdata  <- is.BBO(mktdata)
             #check for open orders at curIndex
             timespan<-paste(timestamp,"::",sep='') #no check to see if timestamp came through dots? Does it come from the search path? -gsee
-            if(nrow(ordersubset[oo.idx,][timespan])==0){
+            if(nrow(ordersubset[oo.idx,][timespan])==0 &&             # prior open orders already in dindex; no need to recheck
+               !any(ordersubset$Order.Type[oo.idx]=="stoptrailing"))  # ... but stoptrailing may need to move
+            {
                 # no open orders between now and the next index
                 nidx=FALSE
             } else {



More information about the Blotter-commits mailing list