random_taq | R Documentation |
Calculate a TAQ time series of random prices following geometric Brownian motion, combined with random trading volumes.
random_taq(
volat = 6.5e-05,
drift = 0,
datev = seq(from = as.POSIXct(paste(Sys.Date() - 3, "09:30:00")), to =
as.POSIXct(paste(Sys.Date() - 1, "16:00:00")), by = "1 sec"),
bidask = 0.001,
...
)
bidask |
The bid-ask spread expressed as a fraction of the prices (default is 0.001=10bps). |
volat |
The volatility per period of the |
drift |
The drift per period of the |
datev |
The time index for the TAQ time series. |
The function random_taq()
calculates an xts time
series with four columns containing random prices following geometric
Brownian motion: the bid, ask, and trade prices, combined with random trade
volume data.
If datev
isn't supplied as an argument, then by default it's
equal to the secondly index over the two previous calendar days.
An xts time series, with time index equal to the input
datev
time index, and with four columns containing the bid, ask,
and trade prices, and the trade volume.
# Create secondly TAQ time series of random prices
taq <- HighFreq::random_taq()
# Create random TAQ time series from SPY index
taq <- HighFreq::random_taq(datev=index(HighFreq::SPY["2012-02-13/2012-02-15"]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.