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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 15 23:25:11 CET 2013


Author: opentrades
Date: 2013-01-15 23:25:10 +0100 (Tue, 15 Jan 2013)
New Revision: 1362

Modified:
   pkg/quantstrat/DESCRIPTION
   pkg/quantstrat/NAMESPACE
   pkg/quantstrat/R/orders.R
   pkg/quantstrat/R/paramsets.R
   pkg/quantstrat/R/rules.R
   pkg/quantstrat/R/walk.forward.R
   pkg/quantstrat/man/add.constraint.Rd
   pkg/quantstrat/man/add.distribution.Rd
   pkg/quantstrat/man/add.rule.Rd
   pkg/quantstrat/man/addOrder.Rd
   pkg/quantstrat/man/apply.paramset.Rd
   pkg/quantstrat/man/delete.paramset.Rd
Log:
- fixed some undocumented arguments and other R CMD check warnings



Modified: pkg/quantstrat/DESCRIPTION
===================================================================
--- pkg/quantstrat/DESCRIPTION	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/DESCRIPTION	2013-01-15 22:25:10 UTC (rev 1362)
@@ -6,7 +6,8 @@
 Author: Peter Carl, Brian G. Peterson, Joshua Ulrich, Jan Humme
 Depends:
     xts(>= 0.8-2),TTR(>= 0.2),blotter(>= 0.7.2),
-    FinancialInstrument(>= 0.12.5)
+    FinancialInstrument(>= 0.12.5),
+    foreach(>= 1.4.0)
 Suggests:
     PerformanceAnalytics,PortfolioAnalytics,rgl,
     testthat

Modified: pkg/quantstrat/NAMESPACE
===================================================================
--- pkg/quantstrat/NAMESPACE	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/NAMESPACE	2013-01-15 22:25:10 UTC (rev 1362)
@@ -11,8 +11,8 @@
 export(applyParameter)
 export(applyRules)
 export(applySignals)
+export(applyStrategy)
 export(applyStrategy.rebalancing)
-export(applyStrategy)
 export(delete.paramset)
 export(getOrderBook)
 export(getOrders)

Modified: pkg/quantstrat/R/orders.R
===================================================================
--- pkg/quantstrat/R/orders.R	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/R/orders.R	2013-01-15 22:25:10 UTC (rev 1362)
@@ -227,6 +227,7 @@
 #' @param orderset set a tag identifying the orderset
 #' @param status one of "open", "closed", "canceled", "revoked", or "replaced", default "open"
 #' @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 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 

Modified: pkg/quantstrat/R/paramsets.R
===================================================================
--- pkg/quantstrat/R/paramsets.R	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/R/paramsets.R	2013-01-15 22:25:10 UTC (rev 1362)
@@ -36,6 +36,11 @@
 #
 ###############################################################################
 
+#require(foreach, quietly=TRUE)
+require('foreach')
+#require(iterators, quietly=TRUE)
+require('iterators')
+
 # creates a copy of a portfolio, stripping all history (transactions etc)
 
 clone.portfolio <- function(portfolio.st, cloned.portfolio.st, strip.history=TRUE)
@@ -207,6 +212,7 @@
 #' 
 #' @param strategy the name of the strategy object
 #' @param paramset.label a label uniquely identifying the paramset within the strategy
+#' @param store indicates whether to store the strategy in the .strategy environment
 #'
 #' @author Jan Humme
 #' @export
@@ -244,6 +250,8 @@
 #' @param component.label a label identifying the component. must be unique per component type
 #' @param variable the name of the variable in the component
 #' @param label a label uniquely identifying the distribution within the paramset
+#' @param weight vector
+#' @param store indicates whether to store the strategy in the .strategy environment
 #'
 #' @author Jan Humme
 #' @export
@@ -289,6 +297,7 @@
 #' @param distribution.label.2 a label identifying the second distribution
 #' @param operator an operator specifying the relational constraint between the 2 distributions
 #' @param label a label uniquely identifying the constraint within the paramset
+#' @param store indicates whether to store the strategy in the .strategy environment
 #'
 #' @author Jan Humme
 #' @export
@@ -331,9 +340,11 @@
 #' for parallel processing. It is up to the caller to load and register an appropriate backend, eg. doMC,
 #' doParallel or doRedis.
 #' 
-#' @param strategy the name of the strategy object
+#' @param strategy.st the name of the strategy object
 #' @param paramset.label a label uniquely identifying the paramset within the strategy
-#' @param portfolio.st a string variable
+#' @param portfolio.st the name of the portfolio
+#' @param account.st the name of the account
+#' @param mktdata optional xts mktdata object, will be passed unchanged to applyStrategy
 #' @param nsamples if > 0 then take a sample of only size nsamples from the paramset
 #' @param user.func an optional user-supplied function to be run for each param.combo at the end, either on the slave or on the master (see calc)
 #' @param user.args user-supplied list of arguments for user.func
@@ -346,9 +357,6 @@
 
 apply.paramset <- function(strategy.st, paramset.label, portfolio.st, account.st, mktdata, nsamples=0, user.func=NULL, user.args=NULL, calc='slave', verbose=FALSE)
 {
-    require(foreach, quietly=TRUE)
-    require(iterators, quietly=TRUE)
-
     must.have.args(match.call(), c('strategy.st', 'paramset.label', 'portfolio.st'))
 
     strategy <- must.be.strategy(strategy.st)

Modified: pkg/quantstrat/R/rules.R
===================================================================
--- pkg/quantstrat/R/rules.R	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/R/rules.R	2013-01-15 22:25:10 UTC (rev 1362)
@@ -65,6 +65,7 @@
 #' @param parameters vector of strings naming parameters to be saved for apply-time definition
 #' @param label arbitrary text label for rule output, NULL default will be converted to '<name>.rule'
 #' @param type one of "risk","order","rebalance","exit","enter","chain" see Details
+#' @param parent the parent rule for a chain rule
 #' @param ... any other passthru parameters
 #' @param enabled TRUE/FALSE whether the rule is enabled for use in applying the strategy, default TRUE
 #' @param indexnum if you are updating a specific rule, the index number in the $rules[type] list to update

Modified: pkg/quantstrat/R/walk.forward.R
===================================================================
--- pkg/quantstrat/R/walk.forward.R	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/R/walk.forward.R	2013-01-15 22:25:10 UTC (rev 1362)
@@ -29,6 +29,7 @@
 #' For a complete description, see Jaekle&Tomasini chapter 6.
 #' 
 #' @param portfolio.st the name of the portfolio object
+#' @param account.st the name of the account object
 #' @param strategy.st the name of the strategy object
 #' @param paramset.label a label uniquely identifying within the strategy the paramset to be tested
 #' @param period the period unit, as a character string, eg. 'days' or 'months'
@@ -43,9 +44,6 @@
 #'
 #' @seealso \code{\link{applyStrategy}} \code{\link{apply.paramset}} \code{\link{endpoints}} \code{\link{tradeStats}}
 #'
-#' @examples
-#' res <- walk.forward(strategy.st, paramset.label='SMA', portfolio.st=portfolio.st, on='months', k.training=3, k.testing=1, verbose=FALSE)
-#'
 #' @author Jan Humme
 #'
 #' @export

Modified: pkg/quantstrat/man/add.constraint.Rd
===================================================================
--- pkg/quantstrat/man/add.constraint.Rd	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/man/add.constraint.Rd	2013-01-15 22:25:10 UTC (rev 1362)
@@ -24,6 +24,9 @@
 
   \item{label}{a label uniquely identifying the constraint
   within the paramset}
+
+  \item{store}{indicates whether to store the strategy in
+  the .strategy environment}
 }
 \description{
   Creates a constraint on 2 distributions in a paramset,

Modified: pkg/quantstrat/man/add.distribution.Rd
===================================================================
--- pkg/quantstrat/man/add.distribution.Rd	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/man/add.distribution.Rd	2013-01-15 22:25:10 UTC (rev 1362)
@@ -24,6 +24,11 @@
 
   \item{label}{a label uniquely identifying the
   distribution within the paramset}
+
+  \item{weight}{vector}
+
+  \item{store}{indicates whether to store the strategy in
+  the .strategy environment}
 }
 \description{
   Creates a distribution in paramset, where a distribution

Modified: pkg/quantstrat/man/add.rule.Rd
===================================================================
--- pkg/quantstrat/man/add.rule.Rd	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/man/add.rule.Rd	2013-01-15 22:25:10 UTC (rev 1362)
@@ -29,6 +29,8 @@
   "risk","order","rebalance","exit","enter","chain" see
   Details}
 
+  \item{parent}{the parent rule for a chain rule}
+
   \item{...}{any other passthru parameters}
 
   \item{enabled}{TRUE/FALSE whether the rule is enabled for

Modified: pkg/quantstrat/man/addOrder.Rd
===================================================================
--- pkg/quantstrat/man/addOrder.Rd	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/man/addOrder.Rd	2013-01-15 22:25:10 UTC (rev 1362)
@@ -41,6 +41,8 @@
   \item{statustimestamp}{timestamp of a status update, will
   be blank when order is initiated}
 
+  \item{prefer}{the prefered order price (eg. 'Close')}
+
   \item{delay}{what delay to add to timestamp when
   inserting the order into the order book, in seconds}
 

Modified: pkg/quantstrat/man/apply.paramset.Rd
===================================================================
--- pkg/quantstrat/man/apply.paramset.Rd	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/man/apply.paramset.Rd	2013-01-15 22:25:10 UTC (rev 1362)
@@ -7,13 +7,18 @@
     user.args = NULL, calc = "slave", verbose = FALSE)
 }
 \arguments{
-  \item{strategy}{the name of the strategy object}
+  \item{strategy.st}{the name of the strategy object}
 
   \item{paramset.label}{a label uniquely identifying the
   paramset within the strategy}
 
-  \item{portfolio.st}{a string variable}
+  \item{portfolio.st}{the name of the portfolio}
 
+  \item{account.st}{the name of the account}
+
+  \item{mktdata}{optional xts mktdata object, will be
+  passed unchanged to applyStrategy}
+
   \item{nsamples}{if > 0 then take a sample of only size
   nsamples from the paramset}
 

Modified: pkg/quantstrat/man/delete.paramset.Rd
===================================================================
--- pkg/quantstrat/man/delete.paramset.Rd	2013-01-15 16:30:50 UTC (rev 1361)
+++ pkg/quantstrat/man/delete.paramset.Rd	2013-01-15 22:25:10 UTC (rev 1362)
@@ -9,6 +9,9 @@
 
   \item{paramset.label}{a label uniquely identifying the
   paramset within the strategy}
+
+  \item{store}{indicates whether to store the strategy in
+  the .strategy environment}
 }
 \description{
   Delete a paramset from a strategy, including its



More information about the Blotter-commits mailing list