Constructing Intraday Paths That Match Daily OHLC Values
Summary
The document discusses generating higher-frequency price paths that pass through known daily observations and reproduce each day’s open, high, low, and close. It formalizes the task as constructing a stochastic increment with a specified endpoint, maximum, and minimum. A suggested approach divides the path into stages that reach the high, reach the low, and finish at the close; Brownian bridges are proposed to add randomness while satisfying fixed endpoints. Another answer describes reflection-principle constructions, including repeated reflections to enforce both extrema and the closing value.
The responses emphasize that this construction is mathematically involved and caution against using synthetic intraday paths for backtesting. Daily OHLC data do not reveal the actual path or the high-frequency mechanisms that produced it, so matching those summary values does not make simulated intraday data realistic. The document mentions controlling distributional moments as an interest, but it does not give a method for doing so or present empirical validation of the proposed path algorithms.
Key ideas
- A constrained intraday path must match the close while attaining the specified high and low within the period.
- Brownian bridges can provide random paths between fixed endpoint values.
- A staged construction can arrange for the path to reach the high, then the low, and finally the close.
- Reflection principles offer a more involved way to construct paths subject to extrema constraints.
- Matching daily OHLC values does not recover realistic high-frequency dynamics, limiting backtesting use.
Tags
Full text
# How to create a Stochastic Process through pre specified points?
# How to create a Stochastic Process through pre specified points?
I want to create a random (quasi random) process which goes through pre determined points and constraints. E.g. I have a daily price series but want to generate intra-day prices with the same OHLC properties.
Also I am exploring the possibility to control of the moments (mean, variance, skew, kurtosis, ...) of the process also.
Main problem here is I have low frequency data (daily) from which I want to construct high frequency data, going though all the lower frequency sampling points.
## Answer by SRKX (score 6, accepted)
https://quant.stackexchange.com/a/2572
> I have low frequency data (daily) from which I want to construct high frequency data, going though all the lower frequency sampling points.
Bad idea in my opinion. I don't really know why you really want to do this (what's are you going to do with the generated data). If it's for backtesting purposes, it's a really bad idea as there are so many mechanisms that occur at HF, it wouldn't be realistic.
Back to your question on "constrained" Stochastic Process. Mathematically, the question is as follows:
Let the $\text{OLHC} = \{o,l,h,c\} $ be the open-low-high-close over a period $\Delta t$.
You would have to create a process $X$ which represents the increment of a process $Y$ such that $Y_{t+\Delta t}=X_{\Delta t}+Y_t$ with
$X_0=0$
$X_{\Delta t}=c-Y_t=Y_{t+1}-Y_t$
$\max_{s \in \left[0;\Delta t\right]}(X_s)=h-Y_t$
$\min_{s \in \left[0;\Delta t\right]}(X_s)=l-Y_t$
And this is quite complicated to do. I believe you wouldn't be able to use a "straightforward" process.
The biggest task would be to make sure that $X$ hits the high and low. To do so, you could try and "split" $X$ in 3 phases represented by 3 processes:
- go and hit the high
- go and hit the low
- reach the close.
You could try and play around with these processes (inverting the two first ones to randomize a bit more).
An idea has been provided in answer (that was then deleted) for a model for each of these three processes: a Brownian Bridge.You can look at the general case at the bottom of the article, it suits your needs.
But again, I don't think it's a really good idea to do so.
## Answer by wsw (score 4)
https://quant.stackexchange.com/a/4447
I think a simple solution is to try to construct a Brownian motion $W_t$ through known points (e.g., $W_0 = W_1 = 0$); it is also known as a Brownian Bridge [ http://en.wikipedia.org/wiki/Brownian_bridge ].
See also question 3 in http://www.math.nyu.edu/faculty/goodman/teaching/StochCalc2012/assignments/assignment4.pdf .
## Answer by Hans (score 1)
https://quant.stackexchange.com/a/9777
Suppose the logarithm of the price follows a standard Brownian bridge from $O$ to $C$ hitting high (maximum) of $H$ and low (minimum) of $L$ on the way. The paths can be constructed with the application of the reflection principle.
Take first the simpler task of constructing Brownian paths with OHC property. We start with a Brownian bridge connecting the opening price $O$ at opening time $t=0$ with price $2H-C$ at closing time $t=1$. Amongst the paths constructed, delete the ones cross below $H$ from above after having crossed above $H$ from below for the first time. For each of the remaining path, reflect the part beyond the stopping time of first crossing $H$ around $H$.
The original task can be accomplished by repeatedly and carefully applying the exact same principle of reflection. The algorithm is a bit more complicated though. We divide all the path into disjoint subsets be sequence of hitting time of $H$ and $L$ between the opening point $O$ (let's set the price of $O$ at $0$ and starts at time $0$ and ends at time $1$) and closing point $C$. In the following description of the algorithm, I am going to sacrifice rigour for sake of descriptive simplicity --- until someone asks questions and ask me to filling th details. A path possessing the required property will start from $0$ and alternatingly hit $H$ and $L$ then end at $C$. Let $h_k$ be the stopping time of the path hitting price $H$ for the $k$'th time after the path hits $L$. So between $O$ and $C$, the set of hitting time sequences in order of occurrence is $\{(h_1,l_1),(h_1,l_1,h_2),(h_1,l_1,h_2,l_2),...\}$ union with $\{(l_1,h_1),(l_1,h_1,l_2),(l_1,h_1,l_2,h_2),...\}$.
The paths generating each hitting time sequence correspond to a subset of Brownian bridges emanating from $0$ and ending at different price points $p$ at time $t=1$ with density proportional to $e^{-p^2}$. Let $k$ run through all natural numbers. For $(l_1,h_1,...,l_k,h_k)$, the Brownian bridge ends at $p=C-2k(H-L)$; for sequence $(l_1,h_1,...,l_k)$ it ends at $p=-C-2k(H-L)+2H$; for $(h_1,l_1,h_2,l_2,...,h_k,l_k)$, it ends at $p=C+2k(H-L)$; for $(h_1,l_1,h_2,l_2,...,h_k)$, it ends at $p=-C+2(k-1)(H-L)+2H$. Amongst all the Brownian bridge paths thus constructed any path hitting any price line in the set $B=\{H+i(H-L): i\in \mathbf Z\}$ for consecutively the second time is eliminated.
Now fold or reflect all thus constructed along the price lines of $\{H+i(H-L): i\in \mathbf Z\}$. The paths thus formed are those required.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.