[Blotter-commits] r1410 - in pkg/quantstrat: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 19 14:10:23 CET 2013


Author: braverock
Date: 2013-03-19 14:10:23 +0100 (Tue, 19 Mar 2013)
New Revision: 1410

Removed:
   pkg/quantstrat/man/ruleCancel.Rd
Modified:
   pkg/quantstrat/NAMESPACE
   pkg/quantstrat/R/ruleRevoke.R
   pkg/quantstrat/man/ruleRevoke.Rd
Log:
- alias ruleRevoke to ruleCancel, it will make more sense to those with market experience
- update NAMESPACE

Modified: pkg/quantstrat/NAMESPACE
===================================================================
--- pkg/quantstrat/NAMESPACE	2013-03-19 12:31:54 UTC (rev 1409)
+++ pkg/quantstrat/NAMESPACE	2013-03-19 13:10:23 UTC (rev 1410)
@@ -2,13 +2,13 @@
 export(add.distribution)
 export(add.indicator)
 export(add.init)
+export(addOrder)
+export(addPosLimit)
 export(add.rule)
 export(add.signal)
-export(addOrder)
-export(addPosLimit)
-export(apply.paramset)
 export(applyIndicators)
 export(applyParameter)
+export(apply.paramset)
 export(applyRules)
 export(applySignals)
 export(applyStrategy)
@@ -31,6 +31,7 @@
 export(put.orderbook)
 export(put.strategy)
 export(rm.strat)
+export(ruleCancel)
 export(ruleOrderProc)
 export(rulePctEquity)
 export(ruleRevoke)

Modified: pkg/quantstrat/R/ruleRevoke.R
===================================================================
--- pkg/quantstrat/R/ruleRevoke.R	2013-03-19 12:31:54 UTC (rev 1409)
+++ pkg/quantstrat/R/ruleRevoke.R	2013-03-19 13:10:23 UTC (rev 1410)
@@ -1,10 +1,13 @@
-#' rule to revoke an unfilled limit order on a signal
+#' rule to revoke(cancel) an unfilled limit order on a signal
 #' 
 #' As described elsewhere in the documentation, quantstrat models 
 #' \emph{orders}.  All orders in quantstrat are GTC orders, which means that
 #' unfilled limit orders have to be revokeled manually or replaced by other orders.
 #' 
-#' This function is used for revokeing the orders based on a signal.
+#' This function is used for revoking or canceling the orders based on a signal.  
+#' Order status will be changed to 'revoked', to separate it from cancelations or
+#' replacements from other causes.  THis may make it easier it decipher the order book 
+#' to figure out what the strategy ewas doing.
 #' 
 #' @param data an xts object containing market data.  depending on rules, may need to be in OHLCV or BBO formats, and may include indicator and signal information
 #' @param timestamp timestamp coercible to POSIXct that will be the time the order will be inserted on 
@@ -18,9 +21,9 @@
 #' @author Niklas Kolster, Jan Humme
 #' @seealso \code{\link{osNoOp}} , \code{\link{add.rule}}
 #' @export
-ruleRevoke <- function(data=mktdata, timestamp, sigcol, sigval, orderside=NULL, orderset=NULL, portfolio, symbol, ruletype)
+ruleRevoke <- ruleCancel <- function(data=mktdata, timestamp, sigcol, sigval, orderside=NULL, orderset=NULL, portfolio, symbol, ruletype)
 {
-    if(ruletype!='risk') stop('Ruletype for ruleRevoke must be risk')
+    if(ruletype!='risk') stop('Ruletype for ruleRevoke or ruleCancel must be "risk".')
 
     pos <- getPosQty(portfolio, symbol, timestamp)
     if(pos == 0)

Deleted: pkg/quantstrat/man/ruleCancel.Rd
===================================================================
--- pkg/quantstrat/man/ruleCancel.Rd	2013-03-19 12:31:54 UTC (rev 1409)
+++ pkg/quantstrat/man/ruleCancel.Rd	2013-03-19 13:10:23 UTC (rev 1410)
@@ -1,52 +0,0 @@
-\name{ruleCancel}
-\alias{ruleCancel}
-\title{rule to cancel an unfilled limit order on a signal}
-\usage{
-  ruleCancel(data = mktdata, timestamp, sigcol, sigval,
-    orderside = NULL, orderset = NULL, portfolio, symbol,
-    ruletype)
-}
-\arguments{
-  \item{data}{an xts object containing market data.
-  depending on rules, may need to be in OHLCV or BBO
-  formats, and may include indicator and signal
-  information}
-
-  \item{timestamp}{timestamp coercible to POSIXct that will
-  be the time the order will be inserted on}
-
-  \item{sigcol}{column name to check for signal}
-
-  \item{sigval}{signal value to match against}
-
-  \item{orderside}{one of either "long" or "short", default
-  NULL, see details}
-
-  \item{orderset}{tag to identify an orderset}
-
-  \item{portfolio}{text name of the portfolio to place
-  orders in}
-
-  \item{symbol}{identifier of the instrument to cancel
-  orders for}
-
-  \item{ruletype}{must be 'risk' for ruleCancel, see
-  \code{\link{add.rule}}}
-}
-\description{
-  As described elsewhere in the documentation, quantstrat
-  models \emph{orders}.  All orders in quantstrat are GTC
-  orders, which means that unfilled limit orders have to be
-  cancelled manually or replaced by other orders.
-}
-\details{
-  This function is used for canceling the orders based on a
-  signal.
-}
-\author{
-  Niklas Kolster
-}
-\seealso{
-  \code{\link{osNoOp}} , \code{\link{add.rule}}
-}
-

Modified: pkg/quantstrat/man/ruleRevoke.Rd
===================================================================
--- pkg/quantstrat/man/ruleRevoke.Rd	2013-03-19 12:31:54 UTC (rev 1409)
+++ pkg/quantstrat/man/ruleRevoke.Rd	2013-03-19 13:10:23 UTC (rev 1410)
@@ -1,6 +1,6 @@
 \name{ruleRevoke}
 \alias{ruleRevoke}
-\title{rule to revoke an unfilled limit order on a signal}
+\title{rule to revoke(cancel) an unfilled limit order on a signal}
 \usage{
   ruleRevoke(data = mktdata, timestamp, sigcol, sigval,
     orderside = NULL, orderset = NULL, portfolio, symbol,
@@ -40,8 +40,12 @@
   revokeled manually or replaced by other orders.
 }
 \details{
-  This function is used for revokeing the orders based on a
-  signal.
+  This function is used for revoking or canceling the
+  orders based on a signal. Order status will be changed to
+  'revoked', to separate it from cancelations or
+  replacements from other causes.  THis may make it easier
+  it decipher the order book to figure out what the
+  strategy ewas doing.
 }
 \author{
   Niklas Kolster, Jan Humme



More information about the Blotter-commits mailing list