tradeImpacts {obAnalytics} | R Documentation |
Trade impacts.
Description
Generates a data.frame containing order book impacts.
Usage
tradeImpacts(trades)
Arguments
trades |
|
Details
An impact consists of 1 or more limit orders being hit in order to fulfil a market order.
Value
A data.frame containing a summary of market order impacts:
- id
market order id
- min.price
minimum executed price
- max.price
maximum executed price
- vwap
VWAP obtained by market order
- hits
number of limit orders hit by market order
- vol
total volume removed by this impact
- start.time
(local) start time of this impact
- end.time
(local) end time of this impact
- dir
direction of this impact (buy or sell)
Author(s)
phil
Examples
# get impacts data.frame from trades data.
impacts <- tradeImpacts(lob.data$trades)
# impacts (in bps)
sell.bps <- with(impacts[impacts$dir == "sell", ], {
(max.price-min.price)/max.price
})
10000*summary(sell.bps[sell.bps > 0])
[Package obAnalytics version 0.1.1 Index]