rtsplot.fake.stock.data {rtsplot} | R Documentation |
Generate fake stock data
Description
Generate fake stock data for use in rtsplot examples
Usage
rtsplot.fake.stock.data(
n,
y0 = 10,
stdev = 0.1,
ohlc = FALSE,
method = c("normal", "adhoc"),
period = c("day", "minute"),
remove.non.trading = FALSE
)
Arguments
n |
number of points to generate |
y0 |
starting price, defaults to 10 |
stdev |
standard deviation, defaults to 0.1 |
ohlc |
generate ohlc data, defaults to FALSE |
method |
method to generate fake stock data, defaults to 'normal' two methods are implemented: * 'normal' - generate fake stock data assuming returns are normally distributed with zero drift * 'uniform' - generate fake stock data assuming returns are uniformly distributed with zero drift |
period |
frequency to generate fake stock data, (possible values: "day", "minute"), defaults to "day" |
remove.non.trading |
flag to remove non trading periods(i.e. weekends and non-trading hours). Note, this flag likely will cause function return less than 'n' observation, defaults to FALSE |
Value
xts
object with fake stock data
Examples
rtsplot.fake.stock.data(10)