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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed May 16 21:06:09 CEST 2012


Author: opentrades
Date: 2012-05-16 21:06:09 +0200 (Wed, 16 May 2012)
New Revision: 1025

Modified:
   pkg/quantstrat/R/ruleSignal.R
Log:
changed default orderset in ruleSignal.R to NULL

Modified: pkg/quantstrat/R/ruleSignal.R
===================================================================
--- pkg/quantstrat/R/ruleSignal.R	2012-05-16 19:00:49 UTC (rev 1024)
+++ pkg/quantstrat/R/ruleSignal.R	2012-05-16 19:06:09 UTC (rev 1025)
@@ -44,7 +44,7 @@
 #' @param label rule label, default '', added by \code{\link{applyRules}}
 #' @seealso \code{\link{osNoOp}} , \code{\link{add.rule}}
 #' @export
-ruleSignal <- function(data=mktdata, timestamp, sigcol, sigval, orderqty=0, ordertype, orderside=NULL, orderset='', threshold=NULL, tmult=FALSE, replace=TRUE, delay=0.0001, osFUN='osNoOp', pricemethod=c('market','opside','active'), portfolio, symbol, ..., ruletype, TxnFees=0, prefer=NULL, sethold=FALSE, label='')
+ruleSignal <- function(data=mktdata, timestamp, sigcol, sigval, orderqty=0, ordertype, orderside=NULL, orderset=NULL, threshold=NULL, tmult=FALSE, replace=TRUE, delay=0.0001, osFUN='osNoOp', pricemethod=c('market','opside','active'), portfolio, symbol, ..., ruletype, TxnFees=0, prefer=NULL, sethold=FALSE, label='')
 {
 
     if(!is.function(osFUN)) osFUN<-match.fun(osFUN)
@@ -151,6 +151,8 @@
 			orderqty = NULL		# dirty trick to suppress adding order below JH
         }
 
+	if(is.null(orderset)) orderset=NA
+
 	if(!is.null(orderqty) && orderqty!=0 && !is.null(orderprice)) #orderqty could have length > 1
 	{
 		addOrder(portfolio=portfolio, symbol=symbol, timestamp=timestamp, qty=orderqty, price=as.numeric(orderprice), ordertype=ordertype, side=orderside, orderset=orderset, threshold=threshold, status="open", replace=replace , delay=delay, tmult=tmult, ...=..., TxnFees=TxnFees,label=label)



More information about the Blotter-commits mailing list