powered by
Simulate multivariate stock trade data with assumption that each stock price following Geometric Brownian Motion (GBM). And these prices are interconnected.
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 )
A list of stock trade data with Open, High, Low and Close
vector of names
time vector of time, must be "Date" type
vector of start positions
vector of mu
mu
vector of sigma
sigma
integer deciding the number of deciamal places
date <- as.Date("2015-01-01") + days(0:29) rTrades(c("swan", "bear"), date)
Run the code above in your browser using DataLab