create.trade.data {tradeCosts} | R Documentation |
This function requires five vectors: period, id, side, exec.qty, and exec.price. It combines these five vectors and optional vectors into a single data.frame ready for use in the trade.costs function.
create.trade.data(period, id, side, exec.qty, exec.price, ...)
period |
The column of periods in which trades occured. |
id |
The column of security identifiers traded. |
side |
What side the security was traded in. |
exec.qty |
How much was traded. |
exec.price |
The price per share of the trade. |
... |
Additional vector arguments of the same length to be incorporated into the resulting data frame |
This helper function makes creating a trade data.frame easier.
A data.frame is returned for use in the trade.costs function.
Daniel Suo
data(trade.mar.2007) create.trade.data(trade.mar.2007$period, trade.mar.2007$id, trade.mar.2007$side, trade.mar.2007$exec.qty, trade.mar.2007$exec.price)