trade.costs {tradeCosts}R Documentation

User-level function to perform basic trade cost analysis.

Description

This function requires three data sets (dynamic descriptive, static descriptive, and trading data). It also requires the names of important columns related to the trade cost analysis.

Usage

trade.costs(trade, dynamic, static = NULL, decisions = NULL,
            benchmark.price = "vwap", base.price = "exec.price", num.trades = 5,
            analysis.title = "Trade Cost Analysis", batch.method = "unique",
            start.period = NULL, end.period = NULL)

Arguments

dynamic The dynamic argument is for dynamic descriptive data of securities and should include some notion of time period and price.
trade The trade argument should be a data set with trading data including at least one type of price related to the execution of a trade as well as a notion of period.
static The static argument is an optional argument with defaults NULL that provides descriptive data for securities, should include basic information for each security.
decisions The decisions argument is an optional argument that can provide decision data for calculating implementation shortfall.
benchmark.price The benchmark.price argument should be the name of a column in dyna and is the price that will be used for benchmarking and calculating trade cost statistics such as slippage.
base.price The base.price argument should be the name of a column in dyna and is the price that will be used as the base price for calculating trade cost statistics such as slippage.
num.trades The num.trades argument is a numeric argument that specifies how many trades should be shown in the resulting summaries. The default is 5 trades, which means for each category, the summary shows the 5 best and worst trades.
analysis.title User-specified character string which serves as the title of the report for aesthetic purposes.
batch.method Option for selecting method for grouping trades.
start.period Object of the same class as the period column in the trade and static data frames that specifies the first period of the analysis.
end.period Object of the same class as the period column in the trade and static data frames that specifies the last period of the analysis.

Details

This version of trade.costs provides a single multi-period sample batch method, same.sided, which groups all consecutive same-sided orders into a single batch. The default batch.method, unique, places each trade in its own batch.

Value

A tradeCostsResults object is returned.

Author(s)

Aaron Schwartz and Luyi Zhao

Examples

data(dynamic.mar.2007)
data(trade.mar.2007)
data(static.mar.2007)
trade.costs(trade.mar.2007, dynamic.mar.2007,
                    static.mar.2007, num.trades = 3)

[Package tradeCosts version 0.2-1 Index]