BI-DIRECTIONAL GRID ABSORPTION BARRIER CONSTRAINED STOCHASTIC PROCESSES WITH APPLICATIONS IN FINANCE & INVESTMENT

How to cite this paper: Taranto, A., & Khan, S. (2020). Bi-directional grid absorption barrier constrained stochastic processes with applications in finance & investment. Risk Governance and Control: Financial Markets & Institutions, 10 (


INTRODUCTION
Bi-directional grid constrained (BGC) stochastic processes originate from the world of finance and, in particular, algorithmic trading strategies and dynamic hedging.They are a class of stochastic processes belonging to game theory, probability theory, and combinatorics.BGC was first studied academically by the authors of this paper, Taranto and Khan (2020) and this paper builds on that research.The grid trading problem (GTP) in its simplest form involves the triggering of both a long and a short order (instantly forming a hedge) at each equally spaced grid levels, at, above and below the initial price rate  0 .The pending orders wait until they are triggered by the current rate   and then become market orders.In this sense, GTP reflects many of the characteristics in the up and down movements of the markets.  refers to the price rate of any instrument such as foreign exchange (FX), commodities, shares, indexes, and derivatives.As   evolves over time, assumed without any loss of generality for the mathematical purposes of this research to be discrete random walks, then the grid orders are triggered.Equivalently express as 1-dimensional simple Brownian motion (SBM), the process becomes constrained by how many losing trades that it accumulates along the way, as shown in Figure 1.
Since markets are range-bound most of the time (Treynor & Ferguson, 1985) or trending with a relatively high amount of volatility (Neely, Weller, & Dittmar, 1997), such a stochastic system can grow in profit over time   .However, if a strong trend emerges with relatively little volatility, then the system can suddenly become ruined when the equity   ≤ 0. To see this, we note that the losses accumulate via the triangular number series ( + 1)/2 for every grid level  traversed, especially evident in Figure 1c.The fact that we set   < 0 → 0, means that an implicit absorption barrier exists at   ≤ 0.
An immediate reference problem that comes to mind when examining the GTP is the gambler's ruin problem (GRP).The GRP, defined formally in the literature review section, involves one of the most popular betting strategies, the so-called Martingale strategy (not to be confused with Martingales of probability theory).In its simplest form, this involves the gambler winning $1 from the casino if a coin is facing up (U) and losing $1 if the coin is facing down (D).When the gambler is faced with one or more consecutive losing moves, they double their bet, 2  for every ∑    =1 , as shown in Figure 2. It is clear that such a strategy would eventually always work if a fair coin was involved as sooner or later, one's coin side would come up, depending on the size of one's bankroll and the casino's betting limits.It is even more clear if the coin was biased towards one's chosen coin side.However, since the gambler does not have access to infinite capital and that the casino has a betting limit, ruin is almost surely inevitable (Shoesmith, 1986).It is an example of what has recently become known as the Taleb distribution (Wolf, 2008), i.e., a strategy that appears low-risk in the short term, bringing in small profits, but which will periodically experience extreme losses.In some respects, the GRP has many parallels with the GTP, only the ultimate fate of the GTP is not so easy to prove, and so to claim that the GTP is a doomed GRP strategy would be naive.
When one does hit a series of losses, doubling the bet each time, one's final bet will be far greater than the small wins one would obtain when the system works in one's favor.
The hypothesis of this research paper is that by introducing an absorption barrier above  0 =  0 , then: H1: The probability of ruin will be significantly reduced.
H2: The expected number of steps (before the ruin barrier is reached) will be significantly increased.
To verify these hypotheses, two novel corresponding theorems are proposed and proved by leveraging various GRP theorems as they form a very useful and relevant base case.
The structure of this paper is as follows.Section 2 reviews the relevant literature.Section 3 analyses the methodology that has been used to conduct empirical research.Section 4 presents the results and the associated discussion.Section 5 concludes the research and paves the way for future research.Section 6 catalogues all the supporting references.

LITERATURE REVIEW
The origin of random walks with absorbing barriers dates back to the GRP proposed by Pascal to Fermat in 1656 (Edwards, 1983).These stochastic processes have been applied to game theory (Feller, 1968) and conditional Markov chains of this type have also been applied to biology and branching processes (Ferrari, Martinez, & Picco, 1992), molecular physics (Novikov, Fieremans, Jensen, & Helpern, 2011), medicine (Bell, 1976) and queuing theory (Böhm & Gopal, 1991), to name a few.Weesakul (1961) discussed the classical problem of random walk restricted between a reflecting and an absorbing barrier.Lehner (1963) studies a one-dimensional random walk with a partially reflecting barrier using combinatorial methods.Gupta (1966) introduces the concept of a multiple function barrier (MFB) where a state can absorb, reflect, let through or hold for a moment.Dua, Khadilkar, and Sen (1976) defined the bivariate generating functions of the probabilities of a particle reaching a certain state under different conditions.Percus (1985) considers an asymmetric random walk, with one or two boundaries, on a one-dimensional lattice.El-Shehawey (2000) obtains absorption probabilities at the boundaries for a random walk between one or two partially absorbing boundaries as well as the conditional mean for the number of steps before stopping given the absorption at a specified barrier, using conditional probabilities.
Having reviewed the literature of random walks with barriers, we now focus on the original random walk with a barrier, the GRP.The GRP regards the game of two players engaging in a series of independent and identical bets up until one of them goes bankrupt, viz.ruined.The first formulation of the gambler's ruin problem had always been credited to the work of Huygens (1657), only because his correspondence, which mentions his source, was not published until 1888.For more on the historical background to this problem and its time-limited extension, we refer, for instance, to the notes in Ethier (2010) and the references therein.The general "gambler's ruin formula", which regards the chances of each player winning, was shown by Abraham de Moivre (1710).A derivation of this formula may be found in Feller (1968), where the technique of expanding rational functions in partial fractions is employed.Different formulae for this were obtained afterward by Montmort, Nicolaus Bernoulli, as well as Joseph-Louis Lagrange.
In terms of the GTP, to the best of the authors' knowledge, there is no formal academic definition of grid trading available within all the references on the subject matter (Mitchell, 2018;DuPloy, 2008DuPloy, , 2010;;Harris, 1998;King, 2010King, , 2015; Admiral Markets, 2017; Forex Strategies Work, 2018).These are not rigorous journal papers but instead informal blog posts or software user manuals.Even if there were any academic worthy results found on grid trading, there is a general reluctance for traders to publish any trading innovation that will help other traders and potentially erode their own trading edge.
Despite this, grid trading can be expressed academically as a discrete form of the dynamic mean-variance hedging and mean-variance portfolio optimization problem (Schweizer, 2010; Biagini, Guasoni, & Pratelli, 2000; Thomson, 2005).There are many reasons why arm would undertake a hedge (Nzioka & Maseki, 2017), ranging from minimizing the market risk of one of its client's trades by trading in the opposite direction (Kiio & Jagongo, 2017), through to minimize the loss on a wrong trade by correcting the new trade's direction whilst keeping the old trade still open until a more opportune time (Stulz, 2013).In the case of grid trading, it can be considered as a form of hedging of multiple positions simultaneously over time, for the generation of trading profits (Álvarez-Díez, Alfaro-Cid, & Fernández-Blanco, 2016).
Another academic framework for grid trading is the consideration of the series of open losing trades in a grid system as a portfolio of stocks.This is because a grid trading session involves a basket of winning and losing trades that can be likened to a portfolio of winning and losing shares or stocks.The Merton problem -a question about optimal portfolio selection and consumption in continuous time -is indeed ubiquitous throughout the mathematical finance literature.Since Merton's seminal paper (1971), many variants of the original problem have been put forward and extensively studied to address various issues arising from economics.Fleming and Hernández-Hernández (2003), for example, considered the case of optimal investment in the presence of stochastic volatility.Davis and Norman (1990), Dumas and Luciano (1991), and more recent, Muhle-Karbe and co-authors (Czichowsky, Muhle-Karbe, & Schachermayer, 2012; Guasoni & Muhle-Karbe, 2012; Muhle-Karbe & Liu, 2012) addressed optimal portfolio selection under transaction costs.Rogers and Stapleton (2002) considered optimal investment under time-lagged trading.Vila and Zariphopoulou (1997) studied optimal consumption and portfolio choice with borrowing constraints.The effects of different types of habit formation on optimal investment and consumption strategies have been explored in Ingersoll (1992) and Munk (2008).

METHODOLOGY
The methodology addresses the two main objectives of this research paper: 1. Probability of ruin under absorption barriers for both GRP and GTP.

Expected number of steps under absorption barriers for both GRP and GTP.
Remark: Hedging may seem to some readers as a false strategy with no benefit because the two trades cancel each other out, and each trade has a transaction cost.However, in the FX markets, a 2 percentage in point (PIP) spread is negligible in relation to a 100 PIP profit target.In grid trading, having 100 PIP grid levels also makes the spread negligible so much so that is can be eliminated from the formulas without any loss in generality.Outside of FX markets, grid trading can be applied where either one can naturally go short, or where one can synthetically go short via the use of derivatives, such as using contracts for difference (CFDs) in share trading (which natively only allows going long).Solid lines depict trades in loss that are held until they reach their TP, closed down when the loss becomes "too large" or finally if an account is ruined.

Probability of ruin
This section introduces two absorption barriers, where one stops either at a profit target or at the ruin.Lemma 1: GRP absorption barrier probability of ruin.A gambler begins with $k and repeatedly plays a game after which they may win $1 with probability p or lose $1 with probability  = 1-.The gambler will stop playing if their fortune reaches $0 or $N.Then the probability of ruin is: Proof: Please see Feller (1968) for a proof of this lemma.We plot equation ( 1) for GRP in Figure 3 for when p ≠ q because that is the case with GTP as p, q change over time.
We notice that the stochastic system is "sensitive" to changes in the probability .If the coin is too biased towards the gambler, then the probability of ruin decays rapidly to zero.We now deduce the corresponding lemma for GTP as follows.
Lemma 2. GTP probability of ruin: A trader begins with $ and trades repeatedly after which they may win $1 with probability  or lose $1 with probability  = 1-.As the trader traverses to the grid level , the trader will stop playing if their equity reaches $0 or $N.Then the probability of ruin is: Proof: Let   be the probability that the trader is ruined if the initial equity is   = .Then we can condition this probability on the first trade as follows (utilising the Law of Total Probability with the partitioning of win or lose), This is a second-order homogeneous difference equation.We look for solutions of the form where ,  ≠ 0. This has a solution  1,2 = { 1−  , 1} provided that  ≠ 1/2, this gives 2 different solutions.We have: We have that the trader stops trading if either their equity reaches $0 or $N.So, we have the following boundary conditions: = 0 This gives the final solution for the probability of GTP ruin by substituting equation (6) into equation (3) giving, Substituting our expressions of P and Q in terms of x into equation (5) gives: ) ) ) (8) which, after some algebra gives the desired result, completing the proof.
To analyse the significance of this novel theorem, we plot its values in Figure 4.By comparing Figure 4 for GTP with Figure 3 for GRP, we see that Figure 4 is a vertical reflection of Figure 3.We also note that equation ( 8) is the probability of ruin in terms of grid levels  and is now independent upon , , , .

Expected number of steps
We can now ask the question "How many times is the gambler expected to be able to gamble until they stop?".The solution can be approached in a similar manner as the probability calculation in the previous section.Namely, conditioning on the first gamble.

Theorem 1. GRP expected number of steps: The expected number of steps or times a gambler is able to gamble until they stop, either in ruin (at $0) or in profit (at $𝑁), is given by equation (9).
Proof: Please see Orosi (2017), Boccio (2012) for a proof of this theorem.This is shown in Figure 5 for the typical case when  ≠ 1/2.Notes: As the gambler has more and more initial funds available n, in relation to the House's funds, then the expected number of steps before ruin, decays slowly.It decays exponentially if the Gambler has more funds than the Broker, which in this case is  = 100.This highlights that for GRP, the importance of starting with a higher initial capital amount does not have as much of a significant impact on the number of steps (or coin bets).
We now propose and prove the GTP expected number of steps for when  ≠ 1/2 since this is the case in trading, in Theorem 2.

Theorem 2. GTP expected number of trades: The expected number of times or trades a trader is able to trade until they stop, either in ruin (as $0) or in profit (at $𝑁), is given by:
Proof: Let   be the expected number of steps until the trader's equity reaches either $0 or $ if the equity starts at $.We then condition on the first trade as follows: where   = Expected steps from  and ,  are the probabilities in terms of the traversed grid-level .

𝑃 × 𝐸 𝑛+1 − 𝐸 𝑛 + 𝑄 × 𝐸 𝑛−1 = −1
Unlike in the previous section, this is a heterogeneous equation.A solution to this equation can be written in the form:   =   +   .We first find a solution to the homogeneous equation (  ) and a solution to the heterogeneous equation (  ).As before, let   =   , where  is constant.We have,  Notes: As the trader has more and more initial funds available n, in relation to the broker's funds, in this case, N = 100, then the expected number of steps before ruin, starts at zero, as having very little initial capital leads to ruin very quickly.As the trader's initial funds grow, then the expected number of steps grows linearly as the grid trading system can last longer.As the trader's initial funds approach the broker's initial funds, then the expected number of steps decays suddenly towards zero, although this time, it is not due to ruin but due to reaching the profit target.This highlights that for GTP, the importance of starting with a higher initial capital amount does indeed have a significant impact on the number of steps (or trades).
Figure 6 shows the interrelationship between grid-level , the expected number of trades, the trader's profit target  and the trader's initial capital of .
In terms of alternative research methods, rather than discrete finite difference equations (FDEs) used in this paper, one could also use the continuous stochastic differential equations (SDEs) to obtain results that support a more "real-time" analysis.One could also adopt a combinatorial approach to arrive at the same conclusion as an alternative proof or pave the way for future research.

RESULTS AND DISCUSSION
Having explored the theoretical models for the probability of ruin and for the expected number of steps, both under absorption barrier constraints, we now explore the simulation results.

Probability of ruin
We establish a baseline by simulating 10,000 sample paths of discrete random walks (DRW) with barrier absorption for a Monte Carlo analysis, as shown in Figure 7(a) with the resulting density in Figure 7(b).This comprises a typical retail trader's initial deposit of $10,000 USD and a target of doubling their account within one year.From Figure 7(a), we see that the mean path (in bold black) has no significant slope or drift.Having established a simulation base, we can see the impact of the absorption barriers on the distribution for GRP.
We can see that from Figure 8(a) that this particular set of 50 simulations results in a mean upward growth path (in bold red), even though the risk of ruin is still present and indeed there are paths that end up (and remain) in ruin.This is even more pronounced in Figure 8(b) where the more statistically significant 1000 simulations are used to produce the density plot.It highlights that many paths reached the target $ relatively quickly, were absorbed, and hence resulted in a greater density at $ than at $0.Having simulated the GRP, the next set of results simulates the GTP, to compare whether GTP is more or less risky than GRP under barrier absorption.The simulation results concur with the previous sections of this paper, namely that GTP is less risky than the GRP and this is shown in Figure 9. Notice that the GTP exponential mean path (in bold green) has a steeper slope than GRP's mean path, without necessarily having a positive drift in the underlying Rt time series.
Figure 9(a) shows that the GTP sample paths tend not to reach the upper barrier as quickly as the GRP paths, even though the average curve has a steeper gradient and is exponential.It also shows that GTP has many more paths that reach the upper barrier.Figure 9(b) confirms this, where the density at the upper barrier is greater than at the lower barrier.That said, the upper barrier density is narrower than the GRP density, even though this may be more difficult to see when the two densities are superimposed over one another.

Expected number of steps
The following simulation results complement the theoretical methodology section of the expected number of steps theory, and is shown above in Figure 7.
One extension to the GTP with absorption barrier is the use of cycles, in which the batch of winning and losing trades are all closed down when either   reaches the upper barrier or when   ≥   .Since the balance   only keeps track of the profit from closed trades, it is the equity that keeps track of the profit from open trades (both winning and losing).When the current equity grows more than some previous equity   ≥  −1 then it makes sense to capitalize on the increase in profit by either closing all losing trades or closing all trades.This then allows a new upper barrier to be set forming a new cycle and significantly reduces the local or short-term probability of ruin, as all losing trades are closed.Whilst this refinement can not eliminate the risk of ruin in the long term, it allows the grid constrained system to operate for a much longer period of time, as shown in the next example.
Example 1: Figure 10 shows how, unlike the GRP, grid trading can withstand prolonged drawdown periods of losing trades, which can lead to the possibility that enough profitable trades can occur to bring the system back into profit   >  0 , into equilibrium   =   .Whilst GRP losses are almost binary -where they are either on a sharp trajectory towards ruin or quickly recover its losses -GTP's losses are more difficult to interpret, analyse and act upon as one loses some visibility over what it will take to return it into profit under such prolonged drawdown periods.Despite this, the theoretical modelling and the resulting Monte Carlo simulations show that GTP can withstand more losing trades than GRP's losing tosses.
Another benefit of the number of steps results is that if a firm has a certain conservative profit target for the year, then they can set a smaller upper barrier  −  to that value, which is more likely to be achieved than some unrealistic high level.Firms can also set a bigger lower barrier from $0 to some higher value $, such as a maximum drawdown (MaxDD) constraint.This means that a firm can choose to close down trading if there is, say a 10% loss, so that ruin does not need to be unnecessarily "achieved".This makes this research much more beneficial than just a theoretical exercise, showing that grid trading can be a robust engine for further research in trading algorithms.

CONCLUSION
This paper has extended the gambler's ruin problem (GRP) to the more complex (bi-directional) grid trading problem (GTP).Two new theorems of grid trading are proposed and proved, which demonstrate that GTP will ultimately ruin the trader (just like in the GRP) albeit at a significantly slower rate.Under these more favourable conditions of GTP, we have shown that semimartingale strategies of grid trading can outperform the martingale strategies of GRP.This reduced ruin rate provides traders and investment firms more time to grow their equity and observe less sudden drops to equity due to large losses accumulated via GRP's martingale approach.One reason for this, other than the drift and volatility in the underlying rate   and its impact on GTP's equity   is that GTP has effectively diversified its risk into multiple losing trades -some of which will become profitable -whereas GRP concentrates its risk into one losing toss(es) of a coin.
Whilst the risk of ruin is ever-present in trading and investment management and cannot be eliminated no matter how sophisticated one can make one's trading strategy, GTP paves the way forward for future research.By simply adding a stop loss on large losing trades, or closing down the system periodically to reduce risk, we show that the GTP provides many possible ways to increase ROI whilst minimizing drawdown risk.
This paper proves that the probability of ruin for GRP is reduced in the GTP approach.This extends the GRP by taking it out of the world of casinos and into the more flexible world of financial markets, where one can control which trades one opens and closes at which point in time, including how much gearing and leverage one deploys.
This research also proves that the expected number of steps (before reaching a barrier) is significantly higher for GTP reaching ruin than is the case for GRP, showing that GTP is more profitable.We also introduced two absorption barriers, one at zero equity (ruin) and one at a specified profit target .
It is also recommended that cycles be adopted, where various trades are strategically closed down when a profit target barrier is reached, to ensure that the system is less likely to end in ruin.This is a common finding that resonates with our earlier research on grid trading.
Despite these novel results in grid trading, we have adopted a discrete stochastic framework, using a binomial lattice model (BLM).Future research in this field should also consider the continuous stochastic framework of stochastic differential equations (SDEs).The use of such Itô calculus supports more granular and real-time usage in real-life trading room applications that require fast trade execution.Banks and financial institutions can thus not only minimize market risk in their hedging operations with this future research work but can also generate a profit due to the dynamic hedging trades that GTP can deliver.

Figure 2 .
Figure 2. Three discrete random walks on a binomial lattice model for GRP

Figure 3 .
Figure 3. GRP lemma for the probability of ruin

( 5 )
Using these boundary conditions, we can solve for A and B. Using equation (4) gives,

Figure 4 .
Figure 4. GTP lemma for the probability of ruin

Figure 5 .
Figure 5. GRP expected number of steps

Figure 6 .
Figure 6.GTP Expected Number of Steps

Figure 7 .
Figure 7. Monte Carlo simulations of DRW with barrier absorption (a) 50 simulations of DRW with barrier absorption

Figure 8 .
Figure 8. Monte Carlo simulations of GRP with barrier absorption (a) 50 GRP simulations with barrier absorption

Figure 9 .
Figure 9. Monte Carlo simulations of GTP with barrier absorption (a) 50 GTP simulations with barrier absorption