rTrades {RMOPI}R Documentation

Simulate Multivariate Stock Trade Data

Description

Simulate multivariate stock trade data with assumption that each stock price following Geometric Brownian Motion (GBM). And these prices are interconnected.

Usage

rTrades(
  name,
  time,
  start = c(1000, 1000),
  mu = rep(1e-04, 2),
  sigma = matrix(c(2e-04, 1e-04, 1e-04, 2e-04), 2, 2),
  digits = 2
)

Arguments

name

vector of names

time

time vector of time, must be "Date" type

start

vector of start positions

mu

vector of mu

sigma

vector of sigma

digits

integer deciding the number of deciamal places

Value

A list of stock trade data with Open, High, Low and Close

Examples

date <- as.Date("2015-01-01") + days(0:29)
rTrades(c("swan", "bear"), date)

[Package RMOPI version 1.1 Index]