I need to generate one-minute bars out of one-day bars to test the performance of an algorithm (speed, memory usage, etc).

I don't need them to resemble real data, but they should be consistent with the one-day bars (e.g. the higher price of any of the minute bars for a day is the same as the high price of the one-minute bars, etc.)

Any ideas?

  • $\begingroup$ You're not able to get one-minute bars? Why not simulate one-minute and then construct simulated one-day bars using that information? At least that way it is consistent. $\endgroup$
    – John
    Jan 18 '13 at 19:36
  • $\begingroup$ This question got asked several times and I still do not get why anyone would ask thing. First, it is completely impossible to generate high frequency bars from low frequency bars. Then the randomness introduced in generating such higher frequency bars makes the boundaries imposed by the low frequency bars completely obsolete. Why does one need such boundary condition if one generates purely random data intra-day? Waste of time if you ask me. $\endgroup$
    – Matt
    Jan 19 '13 at 2:19

Perhaps construct a Brownian Bridge between the day's open and close, then scale it according to the day's high and low.

  • $\begingroup$ Thats exactly what I was looking for. Thank you Joshua. $\endgroup$
    – Victor
    Jan 18 '13 at 23:55
  • $\begingroup$ So you dont need open and close to be preserved? $\endgroup$
    – Quartz
    Jan 21 '13 at 12:20
  • $\begingroup$ @Quartz: Brownian bridge does preserve start and end - thus open and close. Brownian bridge is a Brownian process conditional on fixed start and end. Check out en.wikipedia.org/wiki/Brownian_bridge and of course one has to ad adapt this setting slightly. $\endgroup$
    – Ric
    Feb 4 '13 at 14:51
  • $\begingroup$ @Richard: of course BB preserves open and close, but if later a scaling is added that will be lost. $\endgroup$
    – Quartz
    Feb 5 '13 at 11:32
  • $\begingroup$ @Quartz Yes ... you are right ... I missed the scaling ... one would have to do something more advanced - sorry for my mistake. $\endgroup$
    – Ric
    Feb 5 '13 at 12:52

Regarding Joshua's inspired answer, I'm still not sure how you guarantee that scaling gives you the exact high and low values. I suppose that you could simulate until you get a result that is close enough. But that could be hard when, e.g., Open is near High and far from Low.

An alternative solution is to construct a Brownian Bridge between Open and High, High and Low, and Low and Close with probability p; construct a Brownian Bridge between Open and Low, Low and High, and High and Close with probability (1 - p); and make p a function of where Open falls inside the range and where close falls inside the range.

  • $\begingroup$ Sure. And the devil is in the details: you also need the conditional joint PDF of where Open & Close fall :-) $\endgroup$
    – Quartz
    Feb 6 '13 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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