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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 6 16:23:16 CEST 2013


Author: bodanker
Date: 2013-04-06 16:23:16 +0200 (Sat, 06 Apr 2013)
New Revision: 1426

Modified:
   pkg/quantstrat/R/orders.R
   pkg/quantstrat/R/ruleSignal.R
Log:
- Update tmult documentation


Modified: pkg/quantstrat/R/orders.R
===================================================================
--- pkg/quantstrat/R/orders.R	2013-04-06 13:09:42 UTC (rev 1425)
+++ pkg/quantstrat/R/orders.R	2013-04-06 14:23:16 UTC (rev 1426)
@@ -194,7 +194,9 @@
 #'  
 #' The 'limit', 'stoplimit', 'stoptrailing' and 'iceberg' order types are the only order types that make
 #' use of the order \code{threshold}. Thresholds may be specified in one of 2 ways: as a scalar (\code{tmult=FALSE})
-#' or as a multiplier for the current price (\code{tmult=TRUE}).
+#' or as a multiplier for the current price (\code{tmult=TRUE}). If \code{tmult=TRUE}, \code{threshold} is converted to a
+#' scalar by multiplying it with the price at the time of order entry, and the scalar will not change if the order is updated.
+#'
 #' The threshold is then added to the prefered order price upon order entry. The correct sign for the threshold
 #' (pos or neg, ie. add or subtract) is automagically figured out from the order side and the order quantity (buy or sell);
 #' if the user provides the wrong sign for the threshold, then it will be reversed. In other words, the user may
@@ -232,7 +234,7 @@
 #' @param statustimestamp timestamp of a status update, will be blank when order is initiated 
 #' @param prefer the prefered order price (eg. 'Close')
 #' @param delay what delay to add to timestamp when inserting the order into the order book, in seconds
-#' @param tmult if TRUE, threshold is a percent multiplier for \code{price}, not a scalar. Threshold is converted to a scalar by multiplying it with the price, then added to the price just like a scalar threshold. 
+#' @param tmult if TRUE, threshold is a percent multiplier for \code{price}, not a scalar. Threshold is converted to a scalar by multiplying it with the price at the time of order entry (i.e. the scalar will not change if the order is updated, as in the case of a trailing stop), then it is added to the price just like a scalar threshold. 
 #' @param replace TRUE/FALSE, whether to replace any other open order(s) on this symbol with the same properties as this order, default TRUE, see Details 
 #' @param return if TRUE, return the row that makes up the order, default FALSE (will assign into the environment)
 #' @param \dots any other passthru parameters

Modified: pkg/quantstrat/R/ruleSignal.R
===================================================================
--- pkg/quantstrat/R/ruleSignal.R	2013-04-06 13:09:42 UTC (rev 1425)
+++ pkg/quantstrat/R/ruleSignal.R	2013-04-06 14:23:16 UTC (rev 1426)
@@ -35,7 +35,7 @@
 #' @param orderside one of either "long" or "short", default NULL, see details 
 #' @param orderset tag to identify an orderset; if one order of the set is filled, all others are canceled
 #' @param threshold numeric or name of indicator column in mktdata, default NULL, see Details
-#' @param tmult if TRUE, threshold is a percent multiplier for \code{price}, not a scalar to be added/subtracted from price.  threshold will be dynamically converted to a scalar at time of order entry
+#' @param tmult if TRUE, threshold is a percent multiplier for \code{price}, not a scalar. Threshold is converted to a scalar by multiplying it with the price at the time of order entry (i.e. the scalar will not change if the order is updated, as in the case of a trailing stop), then it is added to the price just like a scalar threshold. 
 #' @param replace TRUE/FALSE, whether to replace any other open order(s) on this portfolio symbol, default TRUE 
 #' @param delay what delay to add to timestamp when inserting the order into the order book, in seconds
 #' @param osFUN function or text descriptor of function to use for order sizing, default \code{\link{osNoOp}}



More information about the Blotter-commits mailing list