**1. Introduction**

The aim of this paper is to derive closed-form expressions for the joint Laplace transform (4) of the first time to a fixed drawdown occurring before a fixed drawup of the diffusion-type process *X* and its running maximum and minimum *S* and *Q* defined in (1)–(2) considered up to a random exponentially distributed time *η*, which is independent of the driving standard Brownian motion. We consider a model for the diffusion-type process *X* with the coefficients being regular functions of the current values of the process *X* itself as well as of its running maximum and minimum *S* and *Q*. The value function in (4) provides the Laplace transform of the value function in (6) which is the joint Laplace transform of the same random variables representing functionals of the diffusion-type process *X* stopped before a fixed time. We derive a closed-form solution to the equivalent inhomogeneous ordinary differential boundary-value problem for the value of the joint Laplace transform as a stopping problem for the resulting three-dimensional continuous Markov process (*<sup>X</sup>*, *S*, *Q*). This result can therefore be interpreted as the computation of the probability characteristics of the random variables associated with the take-profit and stop-loss values of a market trader on a fixed-time interval. The problem of computation of the Laplace transform of the same random times and variables in a model in which the coefficients of the original diffusion-type process depend on the current values of the running maximum and minimum as well as on the maximum drawdown and maximum drawup was explicitly solved in Gapeev and Rodosthenous (2015) on the infinite time interval. Other functionals of diffusion processes evaluated at independent exponential times were computed in Borodin and Salminen (Borodin and Salminen 2002, Part II) among others.

The joint Laplace transform of the first time at which a Brownian motion with linear drift hits a given drawdown value and the running maximum stopped at the same time was computed by Taylor (1975). The joint distribution of the same random variables was obtained by Lehoczky (1977). The mean value and the density of the maximum drawdown of a Brownian motion with linear drift were explicitly derived by (Douady et al. 2000; Magdon-Ismail et al. 2004), respectively. More recently, Pospisil et al. (2009) computed the probability of the event that the drawdown of a one-dimensional diffusion reaches a fixed value occurs before the drawup of the same process reaches another fixed value. Mijatovi´c and Pistorius (2012) obtained the distribution laws of the first-passage times of spectrally positive and negative Lévy processes over constant levels and derived explicit expressions for several related characteristics for the drawdowns and drawups in those models. An extensive overview of various probabilistic and practically applied aspects of drawdowns such as the speed of market crashes and others was recently provided in the monograph of Zhang (2018).

The diffusion-type processes can be considered as immediate generalisations of the diffusion processes particularly arising in the so-called local volatility models introduced by Dupire (1997), where the local drift and diffusion coefficients depend only on the running value of the original process. Other generalisations of the original processes with diffusion coefficients depending on the running values of the initial processes and their running minima were constructed by Forde (2011) for given joint laws of the terminal level and supremum at an independent exponential time (see also Forde et al. 2013; Zhang 2014) for other important probability characteristics of processes of such type). The valuation functional equations for general functional path-dependent volatility models were derived in (Cont and Fournié 2013; Fournié 2010), who also considered the sensitivity analysis of path-dependent financial derivative securities. Henry-Labordère (2009) and Ren et al. (2007), among others, considered the option pricing and calibration problems in models of stochastic interest rates and volatility based on diffusion-type processes with tractable path-dependent coefficients.

Optimal stopping problems for running maxima of some diffusion processes were studied by (Jacka 1991; Dubins et al. 1993; Peskir 1998; Peskir and Shiryaev 2006, chp. V) among others. Discounted optimal stopping problems for certain payoff functions depending on the current values of the running maxima of geometric Brownian motions were initiated by (Shepp and Shiryaev 1993, 1994) and then taken further by (Pedersen 2000; Guo and Shepp 2001; Guo and Zervos 2010, Glover et al. 2013; Rodosthenous and Zervos 2017) among others. Moreover, Peskir (2012, 2014) studied optimal stopping problems for three-dimensional Markov processes having the initial diffusion process as well as its maximum and minimum as state space components. Other three-dimensional optimal stopping problems for continuous Markov processes of such type were studied in (Gapeev and Rodosthenous 2014, 2016) among others. The main feature of the resulting optimal stopping problems and their equivalent free-boundary problems was the application of the normal-reflection conditions for the value functions at the edges of the multi-dimensional state spaces to derive systems of first-order nonlinear ordinary differential equations for the optimal stopping boundaries depending on the current values of the running extremal processes. Optimal stopping problems for diffusion and spectrally negative Lévy processes on random time intervals were considered in (Carr 1998; Avram et al. 2004; Agarwal et al. 2016) among others. It turned out that the resulting value functions and optimal stopping boundaries in models with exponentially distributed time horizons independent of the underlying processes are analytically more tractable than those obtained in models with fixed time horizons. Other optimal stopping problems for exponentially distributed time horizons which are dependent of the underlying Lévy process were recently considered in Rodosthenous and Zhang (2018).

Glattfelder et al. (2011) suggested a new paradigm, the directional changes, that summarises the price dynamics in the financial market. Unlike interval based summary along the physical time, the new paradigm summarizes the price movements along the intrinsic time scale of the market that is driven by the events in the market. The events in the market are identified by the a priori defined significant percentage of price moves known as thresholds. For a given threshold, the price movements are summarised by identifying the local price extremes from where there has been a percentage drop

(or rise) in price that accedes the threshold. The process of price drop (or rise) from a local price extreme to the point where the price is dropped (risen) by the threshold is defined as directional change event. The price movement that continues after directional change event in the same direction beyond the threshold is considered as overshoot. Roughly speaking, directional changes and overshoots summarise the upward or downward trends in the market according to the prescribed thresholds. It is obvious that the summary of the directional changes is depending on the selected threshold. Using the high frequency foreign exchange data, in Glattfelder et al. (2011) scaling laws were demonstrated in intrinsic times for the variables like average times that are taken for directional changes, event thresholds, average overshoots, etc. The authors of Glattfelder et al. (2011) have identified 12 scaling laws across 13 currency pairs that are consistent over varying time intervals. The scaling laws throw light on market physics of moving prices. Each scaling law encapsulates certain stylised facts of the market. The scaling law that describes the relationship between the directional change and overshoot sections of the total price move has drawn quite a lot of attention. Even though the empirical evidence of the scaling laws is demonstrated in the literature (see, e.g., Bakhach et al. 2018; Bakhach et al. 2018; Tsang et al. 2017), the required theoretical framework is not developed yet. We believe that the present work on first hitting times for drawdowns and drawups on diffusion-type processes on random time horizons throws light on the underlying theoretical aspects of the scaling laws that are presented in financial data.

The paper is organised as follows. In Section 2, we introduce the setting and notation of the model with a three-dimensional continuous Markov process, whose state space components are the original process and its running maximum and minimum processes. We define the value function of the joint Laplace transform of the first time to a fixed drawdown occurring before the first time of a fixed drawup and an independent exponential time together with the running maximum and minimum processes stopped at the earliest of those times. In Section 3, we obtain a closed-form solution to the associated inhomogeneous ordinary differential boundary-value problem and show that the value function represents a linear combination of the solutions to the systems of first-order partial differential equations which arise from the application of the normal-reflection conditions for this function at the edges of the three-dimensional state space. We also illustrate the results on several examples of the original processes representing locally a Brownian motion with drift, or a mean-reverting Ornstein-Uhlenbeck process, or the logarithm of a Feller square root process. In Section 4, we formulate the result of the paper and prove that the solution to the boundary-value problem provides the required joint Laplace transform.
