[Blotter-commits] r342 - in pkg/quantstrat: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jun 15 19:47:23 CEST 2010
Author: braverock
Date: 2010-06-15 19:47:23 +0200 (Tue, 15 Jun 2010)
New Revision: 342
Modified:
pkg/quantstrat/R/orders.R
pkg/quantstrat/R/parameters.R
pkg/quantstrat/man/add.indicator.Rd
pkg/quantstrat/man/add.paramLookupTable.Rd
pkg/quantstrat/man/add.parameter.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/applyRules.Rd
pkg/quantstrat/man/getOrders.Rd
pkg/quantstrat/man/osMaxPos.Rd
pkg/quantstrat/man/paramLookup.Rd
pkg/quantstrat/man/ruleOrderProc.Rd
pkg/quantstrat/man/ruleSignal.Rd
pkg/quantstrat/man/sigComparison.Rd
pkg/quantstrat/man/sigCrossover.Rd
pkg/quantstrat/man/sigThreshold.Rd
pkg/quantstrat/man/stratBBands.Rd
pkg/quantstrat/man/updateOrders.Rd
Log:
- updates to pass R CMD check
Modified: pkg/quantstrat/R/orders.R
===================================================================
--- pkg/quantstrat/R/orders.R 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/R/orders.R 2010-06-15 17:47:23 UTC (rev 342)
@@ -336,7 +336,7 @@
} else if(is.BBO(mktdata)){
# check side/qty
if(as.numeric(procorders[ii,]$Order.Qty)>0){ # positive quantity 'buy'
- if(as.numeric(procorders[ii,]$Order.Price)>=as.numberic(getPrice(mktdata[timestamp],prefer='offer'))){
+ if(as.numeric(procorders[ii,]$Order.Price)>=as.numeric(getPrice(mktdata[timestamp],prefer='offer'))){
# price we're willing to pay is higher than the offer price, so execute at the limit
txnprice = as.numeric(procorders[ii,]$Order.Price)
txntime = as.character(timestamp)
Modified: pkg/quantstrat/R/parameters.R
===================================================================
--- pkg/quantstrat/R/parameters.R 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/R/parameters.R 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,3 +1,12 @@
+#' add parameters to strategy objects: ALPHA CODE USE WITH CARE
+#' @param strategy
+#' @param type
+#' @param add.to.name
+#' @param method
+#' @param arguments
+#' @param label
+#' @param ...
+#' @param store
#' @export
add.parameter <-
function (strategy,
@@ -46,6 +55,13 @@
}
+#' add parameters to strategy objects: ALPHA CODE USE WITH CARE
+#' @param strategy
+#' @param symbol
+#' @param type
+#' @param name
+#' @param parameter
+#' @param ...
paramLookup <- function(strategy, symbol , type, name, parameter, ...) {
# should take in a strategy and parameter object, and return an argument list for 'symbol'
#as.pairlist(paramTable[,symbol]
@@ -53,6 +69,11 @@
as.pairlist(paramTable[,symbol])
}
+#' add parameters to strategy objects: ALPHA CODE USE WITH CARE
+#' @param strategy
+#' @param type
+#' @param name
+#' @param paramTable
#' @export
add.paramLookupTable <- function(strategy, type, name, paramTable){
assign(paste(strategy,type,name,'table',pos=.strategy),paramTable)
Modified: pkg/quantstrat/man/add.indicator.Rd
===================================================================
--- pkg/quantstrat/man/add.indicator.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/add.indicator.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{add.indicator}
\alias{add.indicator}
\title{add an indicator to a strategy...}
-\usage{add.indicator(strategy, name, arguments, label, ..., enabled=TRUE, indexnum, store=FALSE)}
+\usage{add.indicator(strategy, name, arguments, label, ..., enabled=TRUE,
+ indexnum, store=FALSE)}
\description{add an indicator to a strategy}
\arguments{\item{strategy}{an object of type 'strategy' to add the indicator to}
\item{name}{name of the indicator, must correspond to an R function}
Modified: pkg/quantstrat/man/add.paramLookupTable.Rd
===================================================================
--- pkg/quantstrat/man/add.paramLookupTable.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/add.paramLookupTable.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,4 +1,9 @@
\name{add.paramLookupTable}
\alias{add.paramLookupTable}
-\title{add.paramLookupTable}
+\title{add parameters to strategy objects: ALPHA CODE USE WITH CARE...}
\usage{add.paramLookupTable(strategy, type, name, paramTable)}
+\description{add parameters to strategy objects: ALPHA CODE USE WITH CARE}
+\arguments{\item{strategy}{}
+\item{type}{}
+\item{name}{}
+\item{paramTable}{}}
Modified: pkg/quantstrat/man/add.parameter.Rd
===================================================================
--- pkg/quantstrat/man/add.parameter.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/add.parameter.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,5 +1,15 @@
\name{add.parameter}
\alias{add.parameter}
-\title{add.parameter}
-\usage{add.parameter(strategy, type=c("indicator", "signal"), add.to.name, method=c("lookup", "lookup.range", "calc"), arguments, label, ...,
+\title{add parameters to strategy objects: ALPHA CODE USE WITH CARE...}
+\usage{add.parameter(strategy, type=c("indicator", "signal"), add.to.name,
+ method=c("lookup", "lookup.range", "calc"), arguments, label, ...,
store=FALSE)}
+\description{add parameters to strategy objects: ALPHA CODE USE WITH CARE}
+\arguments{\item{strategy}{}
+\item{type}{}
+\item{add.to.name}{}
+\item{method}{}
+\item{arguments}{}
+\item{label}{}
+\item{...}{}
+\item{store}{}}
Modified: pkg/quantstrat/man/add.rule.Rd
===================================================================
--- pkg/quantstrat/man/add.rule.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/add.rule.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,8 +1,9 @@
\name{add.rule}
\alias{add.rule}
\title{add a rule to a strategy...}
-\usage{add.rule(strategy, name, arguments, label, type=c(NULL, "risk", "order", "rebalance", "exit", "entry"), ..., enabled=TRUE, indexnum,
- path.dep=TRUE, store=FALSE)}
+\usage{add.rule(strategy, name, arguments, label, type=c(NULL, "risk",
+ "order", "rebalance", "exit", "entry"), ..., enabled=TRUE,
+ indexnum, path.dep=TRUE, store=FALSE)}
\description{add a rule to a strategy}
\details{Rules will be processed in a very particular manner, so it bears going over.
Modified: pkg/quantstrat/man/add.signal.Rd
===================================================================
--- pkg/quantstrat/man/add.signal.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/add.signal.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{add.signal}
\alias{add.signal}
\title{add a signal to a strategy...}
-\usage{add.signal(strategy, name, arguments, label, ..., enabled=TRUE, indexnum, store=FALSE)}
+\usage{add.signal(strategy, name, arguments, label, ..., enabled=TRUE,
+ indexnum, store=FALSE)}
\description{add a signal to a strategy}
\arguments{\item{strategy}{an object of type 'strategy' to add the signal to}
\item{name}{name of the signal, must correspond to an R function}
Modified: pkg/quantstrat/man/addOrder.Rd
===================================================================
--- pkg/quantstrat/man/addOrder.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/addOrder.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,9 @@
\name{addOrder}
\alias{addOrder}
\title{add an order to the order book...}
-\usage{addOrder(portfolio, symbol, timestamp, qty, price, ordertype, side, threshold, status="open", replace=TRUE, statustimestamp="", delay=1e-05)}
+\usage{addOrder(portfolio, symbol, timestamp, qty, price, ordertype, side,
+ threshold, status="open", replace=TRUE, statustimestamp="",
+ delay=1e-05)}
\description{add an order to the order book}
\details{By default, this function will locate and replace any 'open' order(s)
on the requested portfolio/symbol that have the same type and side.
Modified: pkg/quantstrat/man/addPosLimit.Rd
===================================================================
--- pkg/quantstrat/man/addPosLimit.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/addPosLimit.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{addPosLimit}
\alias{addPosLimit}
\title{add position and level limits at timestamp...}
-\usage{addPosLimit(portfolio, symbol, timestamp, maxpos, longlevels=1, minpos=0, shortlevels=0)}
+\usage{addPosLimit(portfolio, symbol, timestamp, maxpos, longlevels=1,
+ minpos=0, shortlevels=0)}
\description{add position and level limits at timestamp}
\details{levels are a simplification of more complex (proprietary)
techniques sometimes used for order sizing.
Modified: pkg/quantstrat/man/applyRules.Rd
===================================================================
--- pkg/quantstrat/man/applyRules.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/applyRules.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{applyRules}
\alias{applyRules}
\title{apply the rules in the strategy to arbitrary market data...}
-\usage{applyRules(portfolio, symbol, strategy, mktdata, Dates, indicators, signals, ..., path.dep=TRUE)}
+\usage{applyRules(portfolio, symbol, strategy, mktdata, Dates, indicators,
+ signals, ..., path.dep=TRUE)}
\description{apply the rules in the strategy to arbitrary market data}
\details{In typical usage, this function will be called via \code{\link{applyStrategy}}.
In this mode, this function will be called twice, once with \code{path.dep=FALSE}
Modified: pkg/quantstrat/man/getOrders.Rd
===================================================================
--- pkg/quantstrat/man/getOrders.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/getOrders.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{getOrders}
\alias{getOrders}
\title{get orders by time span, status, type, and side...}
-\usage{getOrders(portfolio, symbol, status="open", timespan, ordertype, side, starttime=-86400)}
+\usage{getOrders(portfolio, symbol, status="open", timespan, ordertype, side,
+ starttime=-86400)}
\description{get orders by time span, status, type, and side}
\details{This function exists so that other code can find open orders, potentially to update or cancel them.
Modified: pkg/quantstrat/man/osMaxPos.Rd
===================================================================
--- pkg/quantstrat/man/osMaxPos.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/osMaxPos.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{osMaxPos}
\alias{osMaxPos}
\title{order sizing function for position limits and level sizing...}
-\usage{osMaxPos(mktdata, timestamp, orderqty, ordertype, orderside, portfolio, symbol)}
+\usage{osMaxPos(mktdata, timestamp, orderqty, ordertype, orderside, portfolio,
+ symbol)}
\description{order sizing function for position limits and level sizing}
\details{levels are a simplification of more complex (proprietary)
techniques sometimes used for order sizing.
Modified: pkg/quantstrat/man/paramLookup.Rd
===================================================================
--- pkg/quantstrat/man/paramLookup.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/paramLookup.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,4 +1,11 @@
\name{paramLookup}
\alias{paramLookup}
-\title{paramLookup}
+\title{add parameters to strategy objects: ALPHA CODE USE WITH CARE...}
\usage{paramLookup(strategy, symbol, type, name, parameter, ...)}
+\description{add parameters to strategy objects: ALPHA CODE USE WITH CARE}
+\arguments{\item{strategy}{}
+\item{symbol}{}
+\item{type}{}
+\item{name}{}
+\item{parameter}{}
+\item{...}{}}
Modified: pkg/quantstrat/man/ruleOrderProc.Rd
===================================================================
--- pkg/quantstrat/man/ruleOrderProc.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/ruleOrderProc.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{ruleOrderProc}
\alias{ruleOrderProc}
\title{process open orders at time t, generating transactions or new orders...}
-\usage{ruleOrderProc(portfolio, symbol, mktdata, timespan, ordertype, ..., slippageFUN)}
+\usage{ruleOrderProc(portfolio, symbol, mktdata, timespan, ordertype, ...,
+ slippageFUN)}
\description{process open orders at time t, generating transactions or new orders}
\arguments{\item{portfolio}{text name of the portfolio to associate the order book with}
\item{symbol}{identfier of the instrument to find orders for. The name of any associated price objects (xts prices, usually OHLC) should match these}
Modified: pkg/quantstrat/man/ruleSignal.Rd
===================================================================
--- pkg/quantstrat/man/ruleSignal.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/ruleSignal.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{ruleSignal}
\alias{ruleSignal}
\title{default rule to generate a trade order on a signal...}
-\usage{ruleSignal(mktdata, timestamp, sigcol, sigval, orderqty=0, ordertype, orderside, threshold, replace=TRUE, delay=1e-04, osFUN="osNoOp",
+\usage{ruleSignal(mktdata, timestamp, sigcol, sigval, orderqty=0, ordertype,
+ orderside, threshold, replace=TRUE, delay=1e-04, osFUN="osNoOp",
pricemethod=c("market", "opside"), portfolio, symbol, ...)}
\description{default rule to generate a trade order on a signal}
\details{\code{pricemethod} may be one of 'market' or 'opside'
Modified: pkg/quantstrat/man/sigComparison.Rd
===================================================================
--- pkg/quantstrat/man/sigComparison.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/sigComparison.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{sigComparison}
\alias{sigComparison}
\title{generate comparison signal...}
-\usage{sigComparison(label, data, columns, relationship=c("gt", "lt", "eq", "gte", "lte"))}
+\usage{sigComparison(label, data, columns, relationship=c("gt", "lt", "eq",
+ "gte", "lte"))}
\description{generate comparison signal}
\details{Currently, this function compares two columns.
Patches to compare an arbitrary number of columns would be gladly accepted.
Modified: pkg/quantstrat/man/sigCrossover.Rd
===================================================================
--- pkg/quantstrat/man/sigCrossover.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/sigCrossover.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{sigCrossover}
\alias{sigCrossover}
\title{generate a crossover signal...}
-\usage{sigCrossover(label, data, columns, relationship=c("gt", "lt", "eq", "gte", "lte"))}
+\usage{sigCrossover(label, data, columns, relationship=c("gt", "lt", "eq",
+ "gte", "lte"))}
\description{generate a crossover signal}
\details{This will generate a crossover signal, which is a dimension-reduced version
of a comparison signal \code{\link{sigComparison}}.
Modified: pkg/quantstrat/man/sigThreshold.Rd
===================================================================
--- pkg/quantstrat/man/sigThreshold.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/sigThreshold.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{sigThreshold}
\alias{sigThreshold}
\title{generate a threshold signal...}
-\usage{sigThreshold(label, data, column, threshold=0, relationship=c("gt", "lt", "eq", "gte", "lte"))}
+\usage{sigThreshold(label, data, column, threshold=0, relationship=c("gt",
+ "lt", "eq", "gte", "lte"))}
\description{generate a threshold signal}
\details{Many strategies, including RSI or MACD styles, make trading decisions when an indicator
is over or under a specific threshold.
Modified: pkg/quantstrat/man/stratBBands.Rd
===================================================================
--- pkg/quantstrat/man/stratBBands.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/stratBBands.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -22,14 +22,14 @@
\section{Rules}{
In this strategy, each signal has a corresponding entry or exit rule.
\describe{
- \item{enter} \itemize{
+ \item{enter}{\itemize{
\item type \code{\link{ruleSignal}}, enter a sell order at market on \code{Cl.gt.UpperBand} signal.
\item type \code{\link{ruleSignal}}, enter a buy order at market on \code{Cl.lt.LowerBand} signal.
- }
+ }}
- \item{exit} \itemize{
+ \item{exit}{\itemize{
\item type \code{\link{ruleSignal}}, enter a market order to close any open position at market on \code{Cross.mid} signal.
- }
+ }}
}
}
\section{Notes}{
Modified: pkg/quantstrat/man/updateOrders.Rd
===================================================================
--- pkg/quantstrat/man/updateOrders.Rd 2010-06-15 17:23:04 UTC (rev 341)
+++ pkg/quantstrat/man/updateOrders.Rd 2010-06-15 17:47:23 UTC (rev 342)
@@ -1,7 +1,8 @@
\name{updateOrders}
\alias{updateOrders}
\title{update an order or orders...}
-\usage{updateOrders(portfolio, symbol, timespan, ordertype, side, oldstatus="open", newstatus, statustimestamp)}
+\usage{updateOrders(portfolio, symbol, timespan, ordertype, side,
+ oldstatus="open", newstatus, statustimestamp)}
\description{update an order or orders}
\details{When an order gets filled, it should have its status moved to 'closed'.
More information about the Blotter-commits
mailing list