3

I have a project where I have been asked to use OHLC stock price data to simulate tick data (hourly or minute frequency is my choice) using random number generators and simulation in R. My constraint is that the data should be bound by the Low and High during the day. Which function in R can I use for starting such a project.. I can post code here as I make progress - any suggestions would be very helpful

4
  • Perhaps a place to start is ?Distributions as it outlines several different distributions, most/all of which have random number generators. You can also look at arima.sim() to simulate a time series data if the structure of the error terms are important to you.
    – Chase
    Feb 17, 2012 at 22:50
  • thanks @Chase, it sounds like arima.sim() might be a place for me to start Feb 17, 2012 at 23:38
  • If you only have open and close, that is easy: it is called a bridge (often a Brownian bridge, if the process was a Brownian motion, but that can be generalized). But if you have open, high, low and close, that does not look easy at all. It was discused, but not really answered, on quant.stackexchange. Feb 18, 2012 at 10:37
  • thanks @VincentZoonekynd, that was a helpful link. I wonder if i just did it as a bridge using open and close - will need to give it further thought Feb 19, 2012 at 4:37

1 Answer 1

0

Here is an example using a uniform distribution.

runif(NUMSAMP, min=LOW, max=HIGH)

Look at ?distribution for ideas on others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.