Learn R Programming

RMOPI (version 1.1)

rTrade: Simulate stock trade data

Description

Simulate stock trade data with assumption that the stock price following Geometric Brownian Motion (GBM).

Usage

rTrade(time, start = 100, mu = 1e-04, sigma = 2e-04)

Value

Stock trade data with Open, High, Low and Close

Arguments

time

time vector of time, must be a "Date" type variable

start

the start position

mu

the mu parameter of GBM

sigma

the sigma parameter of GBM

Examples

Run this code
date <- as.Date("2015-01-01") + days(0:29)
rTrade(date)

Run the code above in your browser using DataLab