Description Usage Arguments Details Author(s) References Examples
Creates financial 'bars' (also known as 'candlesticks') from raw trade data. One may construct either time, volume, unit, tick, tick-runs, tick-imbalance (TIBs) volume-imbalance (VIBs), unit-imbalance (DIBs), or CUSUM-bars.
1 |
x |
A data.frame of raw tick data. The object must contain columns: timestamp(POSIXct), price(numeric), size(numeric), and side(character). |
type |
One of either: time, volume, unit, tick, tick runs, tick imbalance volume imbalance, unit imbalance, or CUSUM bars. See details for further information. |
by |
An integer (or in the case of type='time', an integer and interval) specifying the sampling frequency. See details for further information. |
'make_bars' creates an OHLCV (Open/High/Low/Close/Volume) matrix of class 'xts' The function requires an input of class 'data.frame' or 'matrix' with the following columns:
timestamp: time of observation; will be used as the xts index
price: the price of the transacted units
size: number of transacted units
side: an integer vector of 1L(buy) or -1L(sell)
Type may be one of either time, volume, unit, tick runs, tick imbalance volume imbalance, unit imbalance, or CUSUM bars.
time: sampled every 'by' units of time; must be a vector of length two, and corresponding to [units, interval]; for example, 'by=c(1, "days")' or 'by=c(1, "secs")'. Default is c(1, "days")
tick: sampled every 'by' number of ticks
volume: sampled every 'by' units of volume
unit: sampled every 'by' units(dollars) of units (e.g., every $10,000)
*NOTE* 'tick runs', 'tick imbalance', 'volume imbalance', 'unit imbalance', and 'CUMSUM' are not yet supported
Nathan Matare <email: nmatare@chicagobooth.com>
Lopez de Prado, Marcos, Advances in Financial Machine Learning (2018)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.