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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 28 01:53:06 CEST 2012


Author: opentrades
Date: 2012-09-28 01:53:06 +0200 (Fri, 28 Sep 2012)
New Revision: 1199

Modified:
   pkg/quantstrat/R/ruleOrderProc.R
Log:
added stopenter support to BBO orders - but not yet tested!



Modified: pkg/quantstrat/R/ruleOrderProc.R
===================================================================
--- pkg/quantstrat/R/ruleOrderProc.R	2012-09-27 23:43:08 UTC (rev 1198)
+++ pkg/quantstrat/R/ruleOrderProc.R	2012-09-27 23:53:06 UTC (rev 1199)
@@ -167,7 +167,7 @@
                         } else if(isBBOmktdata){
                             # check side/qty
                             if(orderQty > 0){ # positive quantity 'buy'
-                                if (orderType == 'stoplimit') {
+                                if (orderType == 'stoplimit' || orderType == 'stopenter') {
                                        if(orderPrice <= as.numeric(getPrice(mktdataTimestamp,prefer='ask')[,1])){
                                         # mktprice moved above our stop buy price 
                                         txnprice = orderPrice #assume we got filled at our stop price
@@ -183,7 +183,7 @@
                                     } else next()
                                 }
                             } else { # negative quantity 'sell'
-                                if (orderType == 'stoplimit') {
+                                if (orderType == 'stoplimit' || orderType == 'stopenter') {
                                     if(orderPrice >= as.numeric(getPrice(mktdataTimestamp,prefer='bid')[,1])){
                                         # mktprice moved below our stop sell price
                                         txnprice = orderPrice #assumption is that we're filled at our stop price



More information about the Blotter-commits mailing list