I'm using monte carlo simulation to model stock paths and measure risk, but I was wondering if there is a way to simulate the full bar/candle chart with open, high, low and close prices , as I'm only simulating the stock path with close prices.

  • 2
    $\begingroup$ easy, just simulate the intraday movements and calculate the charts from there. $\endgroup$
    – MD-Tech
    Commented Jul 24, 2018 at 15:30
  • $\begingroup$ Why not doing one simulation for each ohlc? Other option would be to convert ohlc back into an ordered one column data series.. $\endgroup$
    – trbck
    Commented Jul 24, 2018 at 16:09
  • $\begingroup$ It might be nice to generate the bars directly, potentially saves computation. I would think very carefully before using that as an input to something else though. $\endgroup$
    – Bob Jansen
    Commented Jul 24, 2018 at 16:51
  • $\begingroup$ Are you just trying to synthesize pricing data? If so why not just use real data? $\endgroup$ Commented Jul 24, 2018 at 23:54
  • $\begingroup$ what do you need it for? depending on your answer, suggestions on how to create the levels will vary. $\endgroup$
    – will
    Commented Mar 2, 2020 at 22:34

1 Answer 1


Some time ago I wrote an Octave C++ function to do just what you want and blogged about it on my blog. The link to the relevant post is https://dekalogblog.blogspot.com/2011/08/creation-of-synthetic-data.html where the code is freely available.

This might give you some ideas about how you might code a similar function for yourself.


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.