Simulating Stock's close, high and low prices

I am testing a model in which I need to simulate closing, high and low prices (i.e. 3 dimensions of prices) of any given stock. Using the simple Geometric Brownion Motion equation I can easily simulate the closing stock price (i.e single dimension) at each step. However I am totally confused how to simulate the other 2 dimensions i.e high and low in such a manner that they dipict the possible price movement of the stock?

• Simply stimulate intra-period price movements and take high, low and close of that. E.g. simulate every Minute of the day. Feb 9 '15 at 5:54

I use straightforward approach:

1. Generate "returns";
2. Make cumulative sum of returns from Step 1;
3. Take any Nth (N should be "big enough") point for series obtained on Step 2. That would be "closes";
4. Then take max and min between "closes" = highs and lows.

In R:

n <- 10000 # quantity of "ticks" inside 1 day
m <- 200 # number of days
rets <- rnorm(n*m)
price <- cumsum(rets) + 1000 # start from "big" figure, so that "price" stays positive
price.daily <- matrix(price, byrow = T, nrow = m, ncol = n)

ohlc <- data.frame(open = price.daily[,1],
high = apply(price.daily, 1, max),
low = apply(price.daily, 1, min),
close = price.daily[,n])

Frankly, I'm not sure if I'am right from the methodological point of view. So, would be interesting to have some feedback.

• Hey!! Thanks for your reply. I might be misunderstanding your reply, but I want to calculate high and low at each node. Not of the whole period. what I mean is for example I want to simulate stock prices of google for a period of 1 year and each day is my single node. Then for simulation I want close, high and low of each day (each node).
– Amit
Feb 9 '15 at 3:03
• He is proposing just to generate stock prices with more nodes (multiple nodes per day), and just calculate the open, high and low from them. There is an additional decision you will have to make - how many nodes (or how big volatility) will you simulate during the night (between close and open) so that they differ. Feb 9 '15 at 11:33
• Are there any gaps in geometric Brownian motion? Feb 9 '15 at 11:40
• From the other hand, if pricing process spreads beyond "closing call", there must be gap between any adjacent close and open. It should be proportional to the length of the period that we assume pricing process to be running but not covered by "trading hours". This is exactly the things I do not know correct answer. Feb 9 '15 at 11:44