[Blotter-commits] r1648 - in pkg/quantstrat: . man sandbox sandbox/backtest_musings
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Nov 18 22:47:57 CET 2014
Author: braverock
Date: 2014-11-18 22:47:56 +0100 (Tue, 18 Nov 2014)
New Revision: 1648
Added:
pkg/quantstrat/sandbox/backtest_musings/
pkg/quantstrat/sandbox/backtest_musings/.directory
pkg/quantstrat/sandbox/backtest_musings/MAE.png
pkg/quantstrat/sandbox/backtest_musings/Notes_S_Rush_2014-10-10.txt
pkg/quantstrat/sandbox/backtest_musings/OOS_det.png
pkg/quantstrat/sandbox/backtest_musings/boxplot.png
pkg/quantstrat/sandbox/backtest_musings/building_blocks.png
pkg/quantstrat/sandbox/backtest_musings/cc-by-nc-sa.pdf
pkg/quantstrat/sandbox/backtest_musings/gamlss.png
pkg/quantstrat/sandbox/backtest_musings/gd_pres_backtest.Rmd
pkg/quantstrat/sandbox/backtest_musings/gd_pres_backtest.pdf
pkg/quantstrat/sandbox/backtest_musings/histogram.png
pkg/quantstrat/sandbox/backtest_musings/hypothesis_process.pdf
pkg/quantstrat/sandbox/backtest_musings/idea_funnel.svg
pkg/quantstrat/sandbox/backtest_musings/param_region.png
pkg/quantstrat/sandbox/backtest_musings/resampling1.png
pkg/quantstrat/sandbox/backtest_musings/stat_process.bib
pkg/quantstrat/sandbox/backtest_musings/strat_dev_proc_Kent_notes_2014-09-21.txt
pkg/quantstrat/sandbox/backtest_musings/strat_dev_process.Rmd
pkg/quantstrat/sandbox/backtest_musings/strat_dev_process.diff.Rmd
pkg/quantstrat/sandbox/backtest_musings/strat_dev_process.pdf
pkg/quantstrat/sandbox/backtest_musings/walk_forward_chart.png
pkg/quantstrat/sandbox/backtest_musings/walk_forward_gantt.png
Modified:
pkg/quantstrat/
pkg/quantstrat/DESCRIPTION
pkg/quantstrat/NAMESPACE
pkg/quantstrat/man/add.distribution.Rd
pkg/quantstrat/man/add.distribution.constraint.Rd
pkg/quantstrat/man/add.indicator.Rd
pkg/quantstrat/man/add.init.Rd
pkg/quantstrat/man/add.rule.Rd
pkg/quantstrat/man/add.signal.Rd
pkg/quantstrat/man/addOrder.Rd
pkg/quantstrat/man/addPosLimit.Rd
pkg/quantstrat/man/apply.paramset.Rd
pkg/quantstrat/man/applyIndicators.Rd
pkg/quantstrat/man/applyParameter.Rd
pkg/quantstrat/man/applyRules.Rd
pkg/quantstrat/man/applySignals.Rd
pkg/quantstrat/man/applyStrategy.Rd
pkg/quantstrat/man/applyStrategy.rebalancing.Rd
pkg/quantstrat/man/chart.forward.Rd
pkg/quantstrat/man/chart.forward.training.Rd
pkg/quantstrat/man/delete.paramset.Rd
pkg/quantstrat/man/enable.rule.Rd
pkg/quantstrat/man/get.strategy.Rd
pkg/quantstrat/man/getOrderBook.Rd
pkg/quantstrat/man/getOrders.Rd
pkg/quantstrat/man/getParameterTable.Rd
pkg/quantstrat/man/getPosLimit.Rd
pkg/quantstrat/man/initOrders.Rd
pkg/quantstrat/man/initStrategy.Rd
pkg/quantstrat/man/is.strategy.Rd
pkg/quantstrat/man/load.strategy.Rd
pkg/quantstrat/man/match.names.Rd
pkg/quantstrat/man/osMaxPos.Rd
pkg/quantstrat/man/osNoOp.Rd
pkg/quantstrat/man/paramConstraint.Rd
pkg/quantstrat/man/put.orderbook.Rd
pkg/quantstrat/man/put.strategy.Rd
pkg/quantstrat/man/rm.strat.Rd
pkg/quantstrat/man/ruleOrderProc.Rd
pkg/quantstrat/man/rulePctEquity.Rd
pkg/quantstrat/man/ruleRevoke.Rd
pkg/quantstrat/man/ruleSignal.Rd
pkg/quantstrat/man/save.strategy.Rd
pkg/quantstrat/man/setParameterConstraint.Rd
pkg/quantstrat/man/setParameterDistribution.Rd
pkg/quantstrat/man/sigComparison.Rd
pkg/quantstrat/man/sigCrossover.Rd
pkg/quantstrat/man/sigFormula.Rd
pkg/quantstrat/man/sigPeak.Rd
pkg/quantstrat/man/sigThreshold.Rd
pkg/quantstrat/man/sigTimestamp.Rd
pkg/quantstrat/man/strategy.Rd
pkg/quantstrat/man/tradeGraphs.Rd
pkg/quantstrat/man/tradeOrderStats.Rd
pkg/quantstrat/man/updateOrders.Rd
pkg/quantstrat/man/updateStrategy.Rd
pkg/quantstrat/man/walk.forward.Rd
Log:
- add backtest musings sandbox dir
- update roxygen docs
Property changes on: pkg/quantstrat
___________________________________________________________________
Added: svn:ignore
+ .Rproj.user
.Rhistory
.RData
Modified: pkg/quantstrat/DESCRIPTION
===================================================================
--- pkg/quantstrat/DESCRIPTION 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/DESCRIPTION 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,7 +1,7 @@
Package: quantstrat
Type: Package
Title: Quantitative Strategy Model Framework
-Version: 0.9.1632
+Version: 0.9.1648
Date: $Date$
Author: Peter Carl, Brian G. Peterson, Joshua Ulrich, Jan Humme
Depends:
Modified: pkg/quantstrat/NAMESPACE
===================================================================
--- pkg/quantstrat/NAMESPACE 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/NAMESPACE 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,5 @@
+# Generated by roxygen2 (4.0.2): do not edit by hand
+
export(add.distribution)
export(add.distribution.constraint)
export(add.indicator)
@@ -13,7 +15,7 @@
export(applySignals)
export(applyStrategy)
export(applyStrategy.rebalancing)
-#export(applyStrategy.rebalancing.training)
+export(applyStrategy.rebalancing.training)
export(chart.forward)
export(chart.forward.training)
export(delete.paramset)
@@ -27,6 +29,7 @@
export(getStrategy)
export(initOrders)
export(initStrategy)
+export(initSymbol)
export(is.strategy)
export(load.strategy)
export(match.names)
Modified: pkg/quantstrat/man/add.distribution.Rd
===================================================================
--- pkg/quantstrat/man/add.distribution.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/add.distribution.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{add.distribution}
\alias{add.distribution}
\title{Adds a distribution to a paramset in a strategy}
@@ -6,39 +7,30 @@
variable, weight = NULL, label, store = TRUE)
}
\arguments{
- \item{strategy}{the name of the strategy object to add
- the distribution to}
+\item{strategy}{the name of the strategy object to add the distribution to}
- \item{paramset.label}{a label uniquely identifying the
- paramset within the strategy}
+\item{paramset.label}{a label uniquely identifying the paramset within the strategy}
- \item{component.type}{one of c('indicator', 'signal',
- 'order', 'enter', 'exit', 'chain')}
+\item{component.type}{one of c('indicator', 'signal', 'order', 'enter', 'exit', 'chain')}
- \item{component.label}{a label identifying the component.
- must be unique per component type}
+\item{component.label}{a label identifying the component. must be unique per component type}
- \item{variable}{the name of the variable in the
- component}
+\item{variable}{the name of the variable in the component}
- \item{label}{a label uniquely identifying the
- distribution within the paramset}
+\item{weight}{vector}
- \item{weight}{vector}
+\item{label}{a label uniquely identifying the distribution within the paramset}
- \item{store}{indicates whether to store the strategy in
- the .strategy environment}
+\item{store}{indicates whether to store the strategy in the .strategy environment}
}
\description{
-Creates a distribution in paramset, where a distribution
-consists of the name of a variable in a strategy component
-plus a range of values for this variable.
+Creates a distribution in paramset, where a distribution consists of the name of a variable in
+a strategy component plus a range of values for this variable.
}
\author{
Jan Humme
}
\seealso{
-\code{\link{add.distribution.constraint}},
-\code{\link{delete.paramset}}, \code{\link{apply.paramset}}
+\code{\link{add.distribution.constraint}}, \code{\link{delete.paramset}}, \code{\link{apply.paramset}}
}
Modified: pkg/quantstrat/man/add.distribution.constraint.Rd
===================================================================
--- pkg/quantstrat/man/add.distribution.constraint.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/add.distribution.constraint.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{add.distribution.constraint}
\alias{add.distribution.constraint}
\title{Adds a constraint on 2 distributions within a paramset}
@@ -6,37 +7,28 @@
distribution.label.2, operator, label, store = TRUE)
}
\arguments{
- \item{strategy}{the name of the strategy object to add
- the constraint to}
+\item{strategy}{the name of the strategy object to add the constraint to}
- \item{paramset.label}{a label uniquely identifying the
- paramset within the strategy}
+\item{paramset.label}{a label uniquely identifying the paramset within the strategy}
- \item{distribution.label.1}{a label identifying the first
- distribution}
+\item{distribution.label.1}{a label identifying the first distribution}
- \item{distribution.label.2}{a label identifying the
- second distribution}
+\item{distribution.label.2}{a label identifying the second distribution}
- \item{operator}{an operator specifying the relational
- constraint between the 2 distributions}
+\item{operator}{an operator specifying the relational constraint between the 2 distributions}
- \item{label}{a label uniquely identifying the constraint
- within the paramset}
+\item{label}{a label uniquely identifying the constraint within the paramset}
- \item{store}{indicates whether to store the strategy in
- the .strategy environment}
+\item{store}{indicates whether to store the strategy in the .strategy environment}
}
\description{
-Creates a constraint on 2 distributions in a paramset, i.e.
-a restriction limiting the allowed combinations from the
-ranges for distribution 1 and distribution 2.
+Creates a constraint on 2 distributions in a paramset, i.e. a restriction limiting the allowed
+combinations from the ranges for distribution 1 and distribution 2.
}
\author{
Jan Humme
}
\seealso{
-\code{\link{add.distribution}},
-\code{\link{delete.paramset}}, \code{\link{apply.paramset}}
+\code{\link{add.distribution}}, \code{\link{delete.paramset}}, \code{\link{apply.paramset}}
}
Modified: pkg/quantstrat/man/add.indicator.Rd
===================================================================
--- pkg/quantstrat/man/add.indicator.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/add.indicator.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{add.indicator}
\alias{add.indicator}
\title{add an indicator to a strategy}
@@ -6,101 +7,67 @@
..., enabled = TRUE, indexnum = NULL, store = FALSE)
}
\arguments{
- \item{strategy}{an object (or the name of an object) type
- 'strategy' to add the indicator to}
+\item{strategy}{an object (or the name of an object) type 'strategy' to add the indicator to}
- \item{name}{name of the indicator function -- must
- correspond to an R function}
+\item{name}{name of the indicator function -- must correspond to an R function}
- \item{arguments}{default arguments to be passed to an
- indicator function when executed}
+\item{arguments}{default arguments to be passed to an indicator function when executed}
- \item{parameters}{vector of strings naming parameters to
- be saved for apply-time definition,default NULL, only
- needed if you need special names to avoid argument
- collision}
+\item{parameters}{vector of strings naming parameters to be saved for apply-time definition,default NULL, only needed if you need special names to avoid argument collision}
- \item{label}{arbitrary text label for indicator output.
- This will also be used as the name of the indicator list
- when it is stored. NULL default will be converted to
- '<name>.ind'}
+\item{label}{arbitrary text label for indicator output. This will also be used as the
+name of the indicator list when it is stored. NULL default will be converted to '<name>.ind'}
- \item{...}{any other passthru parameters}
+\item{...}{any other passthru parameters}
- \item{enabled}{TRUE/FALSE whether the indicator is
- enabled for use in applying the strategy, default TRUE}
+\item{enabled}{TRUE/FALSE whether the indicator is enabled for use in applying the strategy, default TRUE}
- \item{indexnum}{if you are updating a specific indicator,
- the \code{label} or the index number in the $indicators
- list to update.}
+\item{indexnum}{if you are updating a specific indicator, the \code{label} or the index number in the $indicators list to update.}
- \item{store}{TRUE/FALSE whether to store the strategy in
- the .strategy environment, or return it. default FALSE}
+\item{store}{TRUE/FALSE whether to store the strategy in the .strategy environment, or return it. default FALSE}
}
\value{
-if \code{strategy} was the name of a strategy, the name. It
-it was a strategy, the updated strategy.
+if \code{strategy} was the name of a strategy, the name. It it was a strategy, the updated strategy.
}
\description{
-Indicators are typically standard technical or statistical
-analysis outputs, such as moving averages, bands, or
-pricing models.
+Indicators are typically standard technical or statistical analysis outputs,
+such as moving averages, bands, or pricing models.
}
\details{
-Indicators are always path-independent, and should be
-constructed from vectorized functions where possible.
+Indicators are always path-independent, and should be constructed from vectorized functions where possible.
-Indicators are applied before signals and rules, and the
-output of indicators may be used as inputs to construct
-signals or fire rules.
+Indicators are applied before signals and rules, and the output of indicators
+may be used as inputs to construct signals or fire rules.
-\code{arguments} and \code{parameters} are named lists that
-describe the arguments to be passed to the indicator
-function. \code{arguments} is for defining any non-default
-arguments to be passed to the function named in the
-\code{name} of the indicator. For example, the \code{x}
-argument to a moving average function may be defined as
-\code{x=quote(Cl(mktdata))}
+\code{arguments} and \code{parameters} are named lists that describe the arguments to be passed to the indicator function.
+\code{arguments} is for defining any non-default arguments to be passed to the function named in the \code{name} of the indicator.
+For example, the \code{x} argument to a moving average function may be defined as \code{x=quote(Cl(mktdata))}
-If you look at the demo scripts, you'll notice that we
-often use \code{quote(mktdata)} in setting up indicators,
-signals, or rules. This tells \R to delay evaluation via
-\code{quote()}, and to use the special variable
-\code{mktdata}.
+If you look at the demo scripts, you'll notice that we often use \code{quote(mktdata)} in setting up indicators, signals, or rules.
+This tells \R to delay evaluation via \code{quote()}, and to use the special variable \code{mktdata}.
-\code{mktdata} is typically created internally to
-\code{quantstrat} by looking in the global environment for
-a time series of prices or returns. mktdata may also
-contain other data you've manipulated outside quantstrat,
-though where possible you should use quantstrat to contain
-all the logic for the strategy, to aid in maintenance and
-modifications.
+\code{mktdata} is typically created internally to \code{quantstrat} by looking in the global environment for
+a time series of prices or returns. mktdata may also contain other data you've manipulated outside quantstrat,
+though where possible you should use quantstrat to contain all the logic for the strategy,
+to aid in maintenance and modifications.
-The use of \code{quote()} tells R to not evaluate what's
-inside the quote until the function is evaluated later. By
-the time that code is evaluated, \code{mktdata} will be
-populated with the correct price information based on the
-contents of whatever portfolio you are evaluating the
-strategy on.
+The use of \code{quote()} tells R to not evaluate what's inside the quote until the function is evaluated later.
+By the time that code is evaluated, \code{mktdata} will be populated with the correct price information based on the contents of whatever portfolio you are evaluating the strategy on.
-\code{parameters} is another named list, and normally will
-not be needed. If you have multiple indicator, signal, or
-rule functions share the that \emph{both} share the same
-argument names \emph{and} will need to have different
-values passed to those arguments as defined parameters at
-apply-time, then you may need to give them unique names so
-that delayed evaluation can sort it all out for you at
-apply-time. We will endeavor to get an example of named
-parameters into the demo scripts.
+\code{parameters} is another named list, and normally will not be needed.
+If you have multiple indicator, signal, or rule functions share the that
+\emph{both} share the same argument names \emph{and} will need to have
+different values passed to those arguments as defined parameters at apply-time,
+then you may need to give them unique names so that delayed evaluation can
+sort it all out for you at apply-time.
+We will endeavor to get an example of named parameters into the demo scripts.
-if \code{label} is not supplied, NULL default will be
-converted to '<name>.ind' unless there already exists an
-indicator with that label in which case it will be appended
+if \code{label} is not supplied, NULL default will be converted to '<name>.ind' unless
+there already exists an indicator with that label in which case it will be appended
with a number (i.e. '<name>.ind.2', '<name>.ind.3', etc.).
-If the indicator function returns multiple columns, the
-label will be \code{\link{paste}}'d to the end of either
-the returned column names or the respective column number
-when applying it to \code{mktdata}.
+If the indicator function returns multiple columns, the label will be
+\code{\link{paste}}'d to the end of either the returned column names or the
+respective column number when applying it to \code{mktdata}.
}
\examples{
\dontrun{
@@ -113,7 +80,9 @@
}
}
\seealso{
-\code{\link{quote}} \code{\link{applyIndicators}}
-\code{\link{add.signal}} \code{link{add.rule}}
+\code{\link{quote}}
+\code{\link{applyIndicators}}
+\code{\link{add.signal}}
+\code{link{add.rule}}
}
Modified: pkg/quantstrat/man/add.init.Rd
===================================================================
--- pkg/quantstrat/man/add.init.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/add.init.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{add.init}
\alias{add.init}
\title{add arbitrary initialization functions to a strategy}
@@ -6,55 +7,39 @@
enabled = TRUE, indexnum = NULL, store = FALSE)
}
\arguments{
- \item{strategy}{an object (or the name of an object) of
- type 'strategy' to add the init function definition to}
+\item{strategy}{an object (or the name of an object) of type 'strategy' to add the init function definition to}
- \item{name}{name of the init, must correspond to an R
- function}
+\item{name}{name of the init, must correspond to an R function}
- \item{arguments}{named list of default arguments to be
- passed to an init function when executed}
+\item{arguments}{named list of default arguments to be passed to an init function when executed}
- \item{parameters}{vector of strings naming parameters to
- be saved for apply-time definition,default NULL, only
- needed if you need special names to avoid argument
- collision}
+\item{parameters}{vector of strings naming parameters to be saved for apply-time definition,default NULL, only needed if you need special names to avoid argument collision}
- \item{label}{arbitrary text label for init output,
- default NULL}
+\item{label}{arbitrary text label for init output, default NULL}
- \item{...}{any other passthru parameters}
+\item{...}{any other passthru parameters}
- \item{enabled}{TRUE/FALSE whether the init is enabled for
- use in applying the strategy, default TRUE}
+\item{enabled}{TRUE/FALSE whether the init is enabled for use in applying the strategy, default TRUE}
- \item{indexnum}{if you are updating a specific init, the
- index number in the $init list to update}
+\item{indexnum}{if you are updating a specific init, the index number in the $init list to update}
- \item{store}{TRUE/FALSE whether to store the strategy in
- the .strategy environment, or return it. default FALSE}
+\item{store}{TRUE/FALSE whether to store the strategy in the .strategy environment, or return it. default FALSE}
}
\value{
-if \code{strategy} was the name of a strategy, the name. It
-it was a strategy, the updated strategy.
+if \code{strategy} was the name of a strategy, the name. It it was a strategy, the updated strategy.
}
\description{
-\code{\link{initStrategy}} will run a series of common
-initialization functions at the beginning of an
-\code{\link{applyStrategy}} call. This function allows the
-user to add arbitrary initialization functions to the
-sequence.
+\code{\link{initStrategy}} will run a series of common initialization functions at the
+beginning of an \code{\link{applyStrategy}} call. This function allows the user to
+add arbitrary initialization functions to the sequence.
}
\details{
-These arbitrary functions will be added to the \code{init}
-slot of the strategy object and when \code{applyStrategy}
-is evaluated, the arbitrary initialization functions will
+These arbitrary functions will be added to the \code{init} slot of the strategy object
+and when \code{applyStrategy} is evaluated, the arbitrary initialization functions will
be evaluated after the standardized functions.
-For example, if your strategy uses a synthetic basket
-instrument, you could use this initialization slot to add a
-custom constructor to build the basket instrument time
-series and modify the symbols slot(s) of the strategy and
-portfolio.
+For example, if your strategy uses a synthetic basket instrument, you could use this
+initialization slot to add a custom constructor to build the basket instrument time
+series and modify the symbols slot(s) of the strategy and portfolio.
}
Modified: pkg/quantstrat/man/add.rule.Rd
===================================================================
--- pkg/quantstrat/man/add.rule.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/add.rule.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{add.rule}
\alias{add.rule}
\title{add a rule to a strategy}
@@ -8,131 +9,95 @@
timespan = NULL, store = FALSE, storefun = TRUE)
}
\arguments{
- \item{strategy}{an object of type 'strategy' to add the
- rule to}
+\item{strategy}{an object of type 'strategy' to add the rule to}
- \item{name}{name of the rule, must correspond to an R
- function}
+\item{name}{name of the rule, must correspond to an R function}
- \item{arguments}{named list of default arguments to be
- passed to an rule function when executed}
+\item{arguments}{named list of default arguments to be passed to an rule function when executed}
- \item{parameters}{vector of strings naming parameters to
- be saved for apply-time definition}
+\item{parameters}{vector of strings naming parameters to be saved for apply-time definition}
- \item{label}{arbitrary text label for rule output, NULL
- default will be converted to '<name>.rule'}
+\item{label}{arbitrary text label for rule output, NULL default will be converted to '<name>.rule'}
- \item{type}{one of
- "risk","order","rebalance","exit","enter","chain" see
- Details}
+\item{type}{one of "risk","order","rebalance","exit","enter","chain" see Details}
- \item{parent}{the label of the parent rule for a chain
- rule}
+\item{parent}{the label of the parent rule for a chain rule}
- \item{...}{any other passthru parameters}
+\item{...}{any other passthru parameters}
- \item{enabled}{TRUE/FALSE whether the rule is enabled for
- use in applying the strategy, default TRUE}
+\item{enabled}{TRUE/FALSE whether the rule is enabled for use in applying the strategy, default TRUE}
- \item{indexnum}{if you are updating a specific rule, the
- index number in the $rules[type] list to update}
+\item{indexnum}{if you are updating a specific rule, the index number in the $rules[type] list to update}
- \item{path.dep}{TRUE/FALSE whether rule is path
- dependent, default TRUE, see Details}
+\item{path.dep}{TRUE/FALSE whether rule is path dependent, default TRUE, see Details}
- \item{timespan}{an xts/ISO-8601 style \emph{time} subset,
- like "T08:00/T15:00", see Details}
+\item{timespan}{an xts/ISO-8601 style \emph{time} subset, like "T08:00/T15:00", see Details}
- \item{store}{TRUE/FALSE whether to store the strategy in
- the .strategy environment, or return it. default FALSE}
+\item{store}{TRUE/FALSE whether to store the strategy in the .strategy environment, or return it. default FALSE}
- \item{storefun}{TRUE/FALSE whether to store the function
- in the rule, default TRUE. setting this option to FALSE
- may slow the backtest, but makes \code{\link{debug}}
- usable}
+\item{storefun}{TRUE/FALSE whether to store the function in the rule, default TRUE. setting this option to FALSE may slow the backtest, but makes \code{\link{debug}} usable}
}
\value{
-if \code{strategy} was the name of a strategy, the name. It
-it was a strategy, the updated strategy.
+if \code{strategy} was the name of a strategy, the name. It it was a strategy, the updated strategy.
}
\description{
-Rules will be processed in a very particular manner, so it
-bears going over.
+Rules will be processed in a very particular manner, so it bears going over.
}
\details{
-First, rules are either path dependent or
-non-path-dependent. Path dependent rules will be processed
-in every time increment for the \code{mktdata} passed into
-\code{\link{applyStrategy}}. Non path dependent rules will
-likely be quite rare in real life, and will be applied
-after indicators and signals, and before path-dependent
-rules are processed.
+First, rules are either path dependent or non-path-dependent. Path dependent rules
+will be processed in every time increment for the \code{mktdata} passed into
+\code{\link{applyStrategy}}. Non path dependent rules will likely be quite rare in real life,
+and will be applied after indicators and signals, and before path-dependent rules are processed.
All rules have a \code{type}. These may be any of:
-\describe{ \item{risk}{ rules that check and react to risk
-of positions, may stop all other rule execution temporarily
-or permanently} \item{order}{ rules for order processing of
-any open orders at time t, always path-dependent}
-\item{rebalance}{ rules executed specifically in a
-portfolio context, unnecessary in univariate strategies}
-\item{exit}{ rules to determine whether to exit a position}
-\item{enter}{ rules to determine whether to enter or
-increase a position} \item{chain}{ rules executed upon fill
-of an order corresponding to the label of the parent rule
-identified by the \code{parent} arg. } }
+\describe{
+ \item{risk}{ rules that check and react to risk of positions, may stop all other rule execution temporarily or permanently}
+ \item{order}{ rules for order processing of any open orders at time t, always path-dependent}
+ \item{rebalance}{ rules executed specifically in a portfolio context, unnecessary in univariate strategies}
+ \item{exit}{ rules to determine whether to exit a position}
+ \item{enter}{ rules to determine whether to enter or increase a position}
+ \item{chain}{ rules executed upon fill of an order corresponding to the label of the parent rule identified by the \code{parent} arg. }
+}
-The rules will be executed by type, in the order listed
-above. Multiple rules of each type may be defined, as with
-signals and indicators, they will be executed in order by
-index number with any other rules sharing the same type.
+The rules will be executed by type, in the order listed above.
+Multiple rules of each type may be defined, as with signals and indicators,
+they will be executed in order by index number with any other rules sharing the same
+type.
-The rule execution order was constructed because
-path-dependent rules may modify the ability of rules that
-have not fired yet to be evaluated. For example, a risk
-rule may flatten (close out) an entire position and put new
-orders on hold, effectively stopping all further execution
-of the strategy. Another example would be a rebalancing
-rule function that would enter orders to rebalance the
-portfolio, and would hold other strategy processing until
-the rebalancing period was over.
+The rule execution order was constructed because path-dependent rules may modify
+the ability of rules that have not fired yet to be evaluated. For example, a
+risk rule may flatten (close out) an entire position and put new orders
+on hold, effectively stopping all further execution of the strategy.
+Another example would be a rebalancing rule function that would enter
+orders to rebalance the portfolio, and would hold other strategy processing
+until the rebalancing period was over.
-The \code{timespan} parameter will limit rule execution by
-time of day using time based subsetting. See ISO-8601
-specification and xts documentation for more details. Note
-that these are only applicable to intra-day execution, and
-will remain that way barring patches (tests and
-documentation) from interested parties. The subsetting may
-(will likely) work with normal ISO/xts subset ranges, but
-consider it unsupported.
+The \code{timespan} parameter will limit rule execution by time of day using
+time based subsetting. See ISO-8601 specification and xts documentation for
+more details. Note that these are only applicable to intra-day execution,
+and will remain that way barring patches (tests and documentation) from
+interested parties. The subsetting may (will likely) work with normal
+ISO/xts subset ranges, but consider it unsupported.
-The \code{name} parameter should be a character string
-naming the function to be called in the
-\code{\link{applyRules}} loop. The \code{add.rule} function
-will then call \code{\link{match.fun}}, ands store the
-actual function in your strategy object. This will avoid
-lookups via \code{\link{match.fun}} at
-\code{\link{applyRules}} time, and may provide a
-significant speed increase on higher frequency data (20\%
-or more).
+The \code{name} parameter should be a character string naming the function
+to be called in the \code{\link{applyRules}} loop. The \code{add.rule}
+function will then call \code{\link{match.fun}}, ands store the actual function
+in your strategy object.
+This will avoid lookups via \code{\link{match.fun}} at \code{\link{applyRules}} time,
+and may provide a significant speed increase on higher frequency data (20\% or more).
-We anticipate that rules will be the portion of a strategy
-most likely to not have suitable template code included
-with this package, as every strategy and environment are
-different, especially in this respect. We will attempt to
-provide enough examples and generic rules to give strategy
+We anticipate that rules will be the portion of a strategy most likely to
+not have suitable template code included with this package, as every strategy
+and environment are different, especially in this respect.
+We will attempt to provide enough examples and generic rules to give strategy
authors a place to start.
-For quantstrat to be able to (largly) vectorize the
-execution of path-dependent rule evaluation, the rule
-function is presumed to have a function signature like that
-of \code{\link{ruleSignal}}, specifically the arguments
-\code{sigcol} and \code{sigval}. If these are present and
-function in a manner similar to \code{\link{ruleSignal}} we
-can do some preprocessing to significantly reduce the
-dimensionality of the index we need to loop over. The
-speedup is the ratio of (symbols\*total
-observations)/signal observations, so it can be significant
-for many strategies.
+For quantstrat to be able to (largly) vectorize the execution of path-dependent
+rule evaluation, the rule function is presumed to have a function signature
+like that of \code{\link{ruleSignal}}, specifically the arguments \code{sigcol}
+and \code{sigval}. If these are present and function in a manner similar to
+\code{\link{ruleSignal}} we can do some preprocessing to significantly reduce the
+dimensionality of the index we need to loop over. The speedup is the ratio of
+(symbols\*total observations)/signal observations, so it can be significant for many strategies.
}
Modified: pkg/quantstrat/man/add.signal.Rd
===================================================================
--- pkg/quantstrat/man/add.signal.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/add.signal.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{add.signal}
\alias{add.signal}
\title{add a signal to a strategy}
@@ -6,58 +7,50 @@
enabled = TRUE, indexnum = NULL, store = FALSE)
}
\arguments{
- \item{strategy}{an object (or the name of an object) of
- type 'strategy' to add the signal to}
+\item{strategy}{an object (or the name of an object) of type 'strategy' to add the signal to}
- \item{name}{name of the signal, must correspond to an R
- function}
+\item{name}{name of the signal, must correspond to an R function}
- \item{arguments}{named list of default arguments to be
- passed to an signal function when executed}
+\item{arguments}{named list of default arguments to be passed to an signal function when executed}
- \item{parameters}{vector of strings naming parameters to
- be saved for apply-time definition,default NULL, only
- needed if you need special names to avoid argument
- collision}
+\item{parameters}{vector of strings naming parameters to be saved for apply-time definition,default NULL, only needed if you need special names to avoid argument collision}
- \item{label}{arbitrary text label for signal output,
- default NULL}
+\item{label}{arbitrary text label for signal output, default NULL}
- \item{...}{any other passthru parameters}
+\item{...}{any other passthru parameters}
- \item{enabled}{TRUE/FALSE whether the signal is enabled
- for use in applying the strategy, default TRUE}
+\item{enabled}{TRUE/FALSE whether the signal is enabled for use in applying the strategy, default TRUE}
- \item{indexnum}{if you are updating a specific signal,
- the index number in the $signals list to update}
+\item{indexnum}{if you are updating a specific signal, the index number in the $signals list to update}
- \item{store}{TRUE/FALSE whether to store the strategy in
- the .strategy environment, or return it. default FALSE}
+\item{store}{TRUE/FALSE whether to store the strategy in the .strategy environment, or return it. default FALSE}
}
\value{
-if \code{strategy} was the name of a strategy, the name. It
-it was a strategy, the updated strategy.
+if \code{strategy} was the name of a strategy, the name. It it was a strategy, the updated strategy.
}
\description{
This adds a signal definition to a strategy object.
}
\details{
-Signals denote times at which the strategy \emph{may} want
-to take action. Common signals types from the literature
-include crossovers, thresholds, or other interactions
-between your \code{mktdata} and your indicators.
+Signals denote times at which the strategy \emph{may} want to
+take action. Common signals types from the literature include
+crossovers, thresholds, or other interactions between your \code{mktdata}
+and your indicators.
-if \code{label} is not supplied, NULL default will be
-converted to '<name>.sig' if the signal function returns
-one named column, we use that, and ignore the label. If the
-signal function returns multiple columns, the label will be
-\code{\link{paste}}'d to either the returned column names
-or the respective column number.
+if \code{label} is not supplied, NULL default will be converted to '<name>.sig'
+if the signal function returns one named column, we use that, and ignore the label.
+If the signal function returns multiple columns, the label will be
+\code{\link{paste}}'d to either the returned column names or the
+respective column number.
}
\seealso{
-\code{\link{applySignals}} \code{\link{add.indicator}}
-\code{link{add.rule}} \code{\link{sigComparison}}
-\code{\link{sigCrossover}} \code{\link{sigFormula}}
-\code{\link{sigPeak}} \code{\link{sigThreshold}}
+\code{\link{applySignals}}
+\code{\link{add.indicator}}
+\code{link{add.rule}}
+\code{\link{sigComparison}}
+\code{\link{sigCrossover}}
+\code{\link{sigFormula}}
+\code{\link{sigPeak}}
+\code{\link{sigThreshold}}
}
Modified: pkg/quantstrat/man/addOrder.Rd
===================================================================
--- pkg/quantstrat/man/addOrder.Rd 2014-11-12 14:56:21 UTC (rev 1647)
+++ pkg/quantstrat/man/addOrder.Rd 2014-11-18 21:47:56 UTC (rev 1648)
@@ -1,3 +1,4 @@
+% Generated by roxygen2 (4.0.2): do not edit by hand
\name{addOrder}
\alias{addOrder}
\title{add an order to the order book}
@@ -4,189 +5,128 @@
\usage{
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/blotter -r 1648
More information about the Blotter-commits
mailing list