rprices: Generate time series data based on different generators

Description Arguments Value Usage Details Examples

Description

This function will construct a portfolio of asset returns based on the time range specified or the number of 'observations' requested. The resulting time series will be based on the specified calendar, as defined by trading_dates that uses the timeDate package under the hood.

Arguments

process

The process to use

start

Start date

ohlc

Whether to include OHLC values

volume

Whether to include volume

...

Additional arguments to date generator

Value

An xts object with either obs rows or points in the range [start,end] and a time series for each symbol provided.

Usage

rprices(process, start=Sys.Date(), ohlc=FALSE, volume=FALSE, ...)

Details

The main entry point is getPortfolioPrices, which generates a TxM xts object based on the symbols provided. Prices generated by this function can be used in risk modeling, as a substitute for brownian motion in Monte Carlo simulations, and backtesting applications. Studying fractal generation of time series can be accomplished more directly by calling rfractal.

In addition to the arguments above, it is necessary to pass the appropriate arguments to the the underlying fractal call. This includes passing in a seed and generator patterns. If none are provided predefined sets will be used, although users of this package are encouraged to create their own initiators and generators.

The trading_dates function is a utility to generate proper business days for a given calendar. This is used to be compatible with other applications that load actual asset data.

Examples

1
2
mygbm <- function(x) gbm(x, 40, .03/1440)
ps <- rprices(mygbm, obs=100)

zatonovo/fractalrock documentation built on May 15, 2021, 7:28 p.m.