Optimal Liquidation in a Finite Time Regime Switching Model with Permanent and Temporary Pricing Impact

In this paper we discuss the optimal liquidation over a finite time horizon until the exit time. The drift and diffusion terms of the asset price are general functions depending on all variables including control and market regime. There is also a local nonlinear transaction cost associated to the liquidation. The model deals with both the permanent impact and the temporary impact in a regime switching framework. The problem can be solved with the dynamic programming principle. The optimal value function is the unique continuous viscosity solution to the HJB equation and can be computed with the finite difference method.


Introduction
Optimal liquidation has attracted active research in recent years due to the liquidity risk. In a frictionless and competitive market an asset can be traded with any amount at any rate without affecting the market price of the asset. The optimal liquidation then becomes an optimal stopping problem which maximizes the expected liquidation value at the optimal stopping time. In an incomplete market with trading constraints on the volume and the rate and with the liquidation impact on the underlying asset price, the optimal liquidation is difficult to model and to solve.
Despite the wide recognition of the importance of the liquidity risk, there is no universal agreement on the definition of liquidity. In the academic literature the liquidity is usually defined in terms of the bid-ask spread and/or the transaction cost whereas in the practitioner literature the illiquidity is often viewed as the inability of buying and selling securities. Black [2] classifies the following four major properties of the liquidity: the immediacy of the transaction, the tightness of the spread, the resiliency of the market, and the depth of the market. The concept of liquidity can be summarized as the ability for traders to execute large trades rapidly at a price close to current market price. The liquidity risk refers to the loss stemming from the cost of liquidating a position.
Due to lack of universal agreement on the definition of liquidity, there are many different forms of mathematical characterizations. Apart from commonly used transaction cost and bid-ask spread and trading constraints (Cvitanic and Karatzas [5], Jouini [9], etc.), the other descriptions include, for example, that the order of a large investor adversely affects the stock price before being exercised (Bank and Baum [1]), that the market has a supply curve that depends on the order size of investors (Ç etin et al. [3]), that trading can only happen at jump times of a Cox process (Gassiat et al. [8]), that the asset price is affected by the permanent and temporary impact of liquidation (Schied and Schöneborn [15]), etc. Once the mathematical framework is chosen for the liquidity risk one can then study specific problems such as the arbitrage pricing theory, the optimal investment and consumption, etc., see [1,3,5,8,9,15] and references therein. This paper studies the optimal liquidation in the presence of liquidity risk. There are several variations in the problem formulation in the literature, including finite or infinite time horizon, continuous trading or optimal stopping, geometric Brownian motion (GBM) asset price process or Markov modulated process, etc. Pemy et al. [13] study the optimal liquidation over an infinite time horizon. The stock price follows a GBM process with an extra term that reflects the permanent impact of liquidation on the asset price and there is no temporary impact. It is a constrained control problem which implicitly assumes that the stock holdings will never be sold out for any admissible trading strategies. The value function is the unique continuous viscosity solution to the Hamilton-Jacobi-Bellman (HJB) equation (two state variables and no time variable). In the continuous time finite state Markov chain framework Pemy and Zhang [12] study an optimal stopping problem of liquidation in finite time horizon. Pemy et al. [14] discuss the optimal liquidation over an infinite time, similar to that in [13]. The main difference is that the asset price follows a GBM process in which the drift and diffusion coefficients are determined by market regimes and the temporary impact of liquidation is reflected in the payoff function and there is no permanent impact. The assumptions and the conclusions are basically the same as those in [13].
In this paper we discuss the optimal liquidation over a finite time horizon until the exit time. The drift and diffusion coefficients µ and σ of the asset price are general functions depending on all variables including control (see (2)), which implies the trading may cause the permanent impact on the asset price. There are also nonlinear transaction costs associated to the trading through the temporary pricing impact function φ and the block liquidation impact function g (see (7)). The model deals with both the permanent impact and the temporary impact in a regime switching framework. We can apply the dynamic programing principle to derive the HJB equation that involves time variable as well as state variables, which makes the proofs more involved than those in [13,14]. Our main contribution is that we show the optimal value function is the unique continuous viscosity solution to the HJB equation, which opens the way to solving the problem with the finite difference method.
The paper is organized as follows. Section 2 formulates the optimal liquidation problem and states the main results of the paper. Section 3 gives a numerical example. Section 4 proves that the optimal value function is continuous (Theorem 3). Section 5 proves that the value function is the viscosity solution to the HJB equation (Theorem 5). Section 6 proves the comparison theorem for the uniqueness of the viscosity solution (Theorem 6).

Model and Main Results
Let (Ω, F, P ) be a probability space and (F r ) 0≤r≤T be the natural filtration generated by a standard Brownian motion process W and a continuous time Markov chain process α, augmented by all P -null sets. Assume W and α are independent to each other. Assume that the Markov chain has a finite state space M = {1, . . . , m} and is generated by the generator Q = {q ij }, where q ij ≥ 0 for i, j ∈ M, j = i and m j=1 q ij = 0 for each i ∈ M. The transitional probability is given by for small time interval ∆ > 0. The continuous time Markov chain α(r) 0≤r≤T models the economic environment which affects the growth rate and the volatility of the asset price. Let r ∈ [t, T ] be the time variable, where T is the fixed terminal time and t ∈ [0, T ) is the starting time. Let S(r) 0≤r≤T denote the stock price and X(r) 0≤r≤T the number of shares of stock. Let u(r) 0≤r≤T denote the rate of selling the stock, which is a control variable decided by the trader. We call u = {u(r)} 0≤r≤T is admissible if it is progressively measurable and u(r) ∈ U for a compact set U ⊂ [0, ∞) for all t ≤ r ≤ T . The stock price S(r) follows a stochastic differential equation with regime switching dS(r) = µ(r, S(r), u(r), α(r))dr + σ(r, S(r), u(r), α(r))dW (r) (2) and the stock holding X(r) follows the dynamics dX(r) = −u(r)dr.
Since the drift and the diffusion terms of S are affected by the trading strategy u there is the permanent impact of liquidation on the asset price. Such an impact may be negligible for a small trader (when u is small) but can be significant for a large trader (when u is large). We implicitly assume that the asset price S(r) is positive for all t ≤ r ≤ T . A sufficient condition that guarantees this is that S follows a geometric Brownian motion process with drift and diffusion coefficients depending on time, control and Markov state. We denote by K some generic positive constant which may take different values at different places.
It can be shown, with Assumption 1, that for any admissible control process u ∈ U and any initial values (t, s, ) ∈ [0, T ) × (0, ∞) × M, there exists a unique solution, denoted by {S u t,s, (r), t ≤ r ≤ T }, to equation (2), and that the following inequalities hold: The proofs of (4), (5) and (6) can be found in Mao and Yuan [10] with some minor changes to include control processes, see [10], Theorem3.23, Theorem 3.24 and Lemma 3.3. Similarly, {X u t,x (r), t ≤ r ≤ T } denotes the stock holding and {α t, (r), t ≤ r ≤ T } the Markov chain process.
Suppose a trader starts from time t, endowed with initial values (X(t), S(t), α(t)) = (x, s, ) ∈ (0, ∞) × (0, ∞) × M. Define a stopping time This is the first time that X u t,x (r) exits from (0, ∞) before or at time T . Since the model is to study the liquidation strategy, the trader is only allowed to sell stock without buying back. When the number of shares reaches zero before time T the liquidation stops. Otherwise, it stops at time T .
The expected discounted total payoff associated with a strategy u ∈ U is defined by where β > 0 is a discount rate, φ a function measuring the temporary liquidation effect, g a function measuring the block liquidation effect, and E the conditional expectation given the information set F t which is equivalent to given X(t) = x, S(t) = s and α(t) = since the model is Markov. The first term is the expected discounted accumulated cash value from the stock liquidation and the second term is the expected discounted cash value from the block liquidation at time T for any remaining shares of the stock.
Note that in a completely liquid market φ(υ) = υ and g(x) = x, and that f (0) = 0 and f (0) = 1 imply f (x) is approximately equal to x when x is close to 0, which means when the trading rate u is small or the amount of stock X is small then there is essentially no transaction cost and the liquidity impact can be ignored. The objective of the trader is to maximize the expected discounted revenue from stock liquidation. The value function is defined by For υ ∈ U define operators L υ and Q of the value function V by and The HJB equation for the optimal control problem is, with the boundary condition V (t, 0, s, ) = 0 and the terminal condition It is easy to check that the value function is an increasing function with respect to the asset price and the stock holding. It also has the following continuity property.
Theorem 3. Assume Assumptions 1 and 2. Then the value function V (·, ·, ·, ) is continuous on Since we do not know if the value function V is continuously differentiable and cannot discuss the solution to the HJB equation in the classical sense, we need to introduce the concept of the viscosity solution to the HJB equation.

Definition 4. A system of continuous functions
is a viscosity subsolution (resp. supersolution) of the HJB equation (8) if, for any fixed ∈ M, The system of continuous functions V is a viscosity solution if it is both a viscosity subsolution and a viscosity supersolution.
We have the following result for the value function.
Theorem 5. Assume Assumptions 1 and 2. Then the value function V is a viscosity solution to the HJB equation (8).
One in general has to use some numerical scheme to find the value function. To ensure the numerical solution to the HJB equation is indeed the value function one has to show that the value function is the unique viscosity solution to the HJB equation, which can be achieved by the following comparison theorem. Theorem 6. Assume Assumptions 1 and 2. Let U be a viscosity subsolution and V a viscosity supersolution to the HJB equation (8) and satisfy the polynomial growth condition and U (T, The proofs of Theorems 3, 5, and 6 are given in Sections 4, 5, and 6, respectively. The proofs are technical and lengthy as one would expect with the viscosity solution method. The further complication in the proofs over the standard diffusion model is that we need to deal with the Markov chain process α and its relation with the diffusion process S.

A Numerical Example
In this section we give a numerical example to find the approximation of the value function and the optimal selling strategy. The finite difference method is one of the most common approximation schemes for viscosity solutions due to its well-known consistency, stability, convergence analysis, in particular in the presence of the monotonicity property, see [7] for numerical solutions of HJB equation and [12] for a regime switching optimal stopping problem which results in a system of HJB variational inequalities. We may apply the numerical scheme of [12] to solve our optimal liquidation problem. The numerical example is to provide a snapshot of the optimal trading strategy at a given specific time.
Assume that there are only two regimes. Regime 1 represents the strong economy and regime 2 the weak economy and assume that the stock price S(r) follows a GBM process with µ(r, s, u, α) = µ(α)s and σ(r, s, u, α) = σ(α)s. Define variables z = log s and τ = T − t and a function W (τ, x, z, ) = V (t, x, s, ). The HJB equation (8) becomes with the boundary condition W (τ, 0, z, ) = 0 and the terminal condition W (0, x, z, ) = g(x)e z .
To approximate the solution to (10) we discretize variables τ , x and z with stepsizes ∆τ, ∆x, ∆z, respectively. The value of W at a grid point (τ n , x i , z j ) in the regime is denoted by W n i,j ( ). The derivatives of W are approximated by Discretizing equation (10) and rearranging the terms, we have where , = 1, 2 and = . Assume that the temporary liquidation impact function is given by where α > 0, and the block liquidation impact function is given by Functions φ and g satisfy Assumption 2. In fact, g is constructed as a smooth approximation to a function f defined by Function f captures the block liquidation effect at time T but is not differentiable at x = 10 and 50 and does not satisfy Assumption 2. Data used for numerical tests are α = 0.005,  It is clear that the more shares one holds, the sooner and the more one wants to sell to avoid the potential large transaction cost during the whole period. The market regime determines at what level of stock holding one should start to sell. In a rising market (regime 1) the trader is willing to keep the stock for a longer period in the hope for a higher price, which results in a lower optimal selling rate, whereas in a falling market (regime 2) the trader wants to liquidate the stock quickly to avoid a lower price. This is consistent with the general market phenomenon. The optimal trading strategy is independent of initial asset price in the numerical test, which is not surprising as the asset price follows a GBM process and depends on the initial asset price linearly. In general, the optimal trading strategy should also depend on the asset price. The particular shape of the curve in Figure 1 is determined by the tradeoff between function φ that captures the liquidity effect from 'flow' trading and function g that reflects the transaction cost for the block liquidation at the terminal time. Note that if there is no temporary pricing impact on liquidation, i.e., φ(υ) = υ, then the optimal liquidation strategy is a "bang-bang" control with either no trading υ = 0 or selling at maximum rate υ = 100 due to the linear dependence of control υ in the Hamiltonian function.

Proof of Theorem 3
We first convert the original control problem into a problem without terminal bequest function. Since function g is continuously differentiable, we can apply Dynkin's formula to e β(τ0−t) g(X u t,x (τ 0 ))S u t,s, (τ 0 ) and rewrite the total payoff J as J(t, x, s, ; u) = g(x)s + E L r, X u t,x (r), S u t,s, (r), u(r), α t, (r) dr .
Since V (t, x, s, ) = V (t, x, s, ) + g(x)s, we know V (t, x, s, ) is continuous as long as V (t, x, s, ) is continuous. From now on in this section we work on the value function V .
To prove the continuity ofṼ we need to define some perturbed problems and show their corresponding value functions are continuous and converge quasi-uniformly to V , which establishes Theorem 3.
For 0 < < 1 define the stopping time The key here is to rule out zero from the compact setÛ after X(r) reaches zero. The admissible control set is the collection of all admissible controls, denoted by U . Note that when we only look at the control process before τ 0 , the two admissible control sets, U and U , are the same.
To simplify the notation denote by t,x (r))| and |g (X u t,x (r))| are bounded by some constant K x depending on x due to continuity of g and g . Assumptions 1 and 2 imply that, for t ≤ r ≤ T , and for some constant K x1 depending on x 1 .

Remark 7.
In the proof we need to estimate |L u t,x,s, (r)| several times for different x. One case is that x = − for 0 < < 1. Then X u t,x (r) ∈ [−1 − N T, 0] and constant K x can be replaced by a generic constant K independent of x. The other case is that x is within a distance d of another point x 1 . Then X u t,x (r) ∈ [x 1 − d − N T, x 1 + d] and constant K x can be written as K x1 depending on x 1 for all such x.
Since |e −a − e −b | ≤ |a − b| for any a, b ≥ 0, we have By the definition of V ,ρ and the relation | sup A − sup B| ≤ sup |A − B| we have where K x1,s1 is some constant depending on x 1 and s 1 . In the second last inequality we have used (13), (6), (4), (12), (16) and Remark 7. This shows that the auxiliary value function V ,ρ (t, x, s, ) is continuous in (x, s), uniformly in t.
Step 2. We prove that the auxiliary value function V ,ρ is continuous in t. Let 0 ≤ t 1 < t 2 ≤ T and (x, s, ) ∈ [0, ∞) × (0, ∞) × M. By the dynamic programming principle, for any δ > 0, there exists an admissible control u δ ∈ U such that Rearranging the above inequalities, we have (12) and (4) imply that . (14) and Remark 7 imply that E V ,ρ t 2 , X u δ t1,x (t 2 ), S u δ t1,s, (t 2 ), α t1, (t 2 ) ≤ E K x 1 + S u δ t1,s, (t 2 ) ≤ K x,s for some constant K x,s depending on x and s. Noting that the term inside the expectation of I 3 is zero when α t1, (t 2 ) = , using Cauchy-Schwartz inequality and combining the above inequality, we have Using (17) and (5), we have for some constant K x,s depending on x, s. The above estimates for I 1 , I 2 , I 3 show that they all tend to 0 as t 2 − t 1 tends to 0, independent of δ and control u δ but dependent on x and s. Therefore, The arbitrariness of δ confirms that V ,ρ (t, x, s, ) is continuous in t.
Combining the results of Steps 1 and 2, we conclude that V ,ρ (·, ·, ·, ) is continuous in (t, x, s) for each ∈ M.
By Lemmas 8 and 9, the auxiliary value function V ,ρ (t, x, s, ) converges quasi-uniformly to the value function V (t, x, s, ) as → 0 and ρ → 0 and V ,ρ (t, x, s, ) is continuous in (t, x, s), which shows that We have proved Theorem 3.
Theorem 12. For each ∈ M, the value function V = {V (t, x, s, )} ∈M is a viscosity subsolution of the HJB equation (8).
Since the value function V is both a viscosity subsolution and a viscosity supersolution, we conclude that it is a viscosity solution of the HJB equation (8). We have proved Theorem 5.

Proof of Theorem 6
In this section vectors (t, x, s) and (r, y, v) and their specific values such as (t,x,s) appear many times. To simplify the expressions we denote by x = (t, x, s) and y = (r, y, v). Their specific values are defined similarly, for example,x = (t,x,s).
To prove the uniqueness, we need an alternative definition of viscosity solution in terms of superjets and subjets. The second-order superjet of an upper-semicontinuous function U at a pointx ∈ Σ := [0, T )×(0, ∞)×(0, ∞), denoted by P 2,+ U (x), is defined as a set of elements (b,p,q,M ) ∈ R×R×R×R such that where e(x −x) = o(|t −t| + |x −x| + |s −s| 2 ) is a higher order error term. The limiting superjet is the set of elements (b, p, q, M ) ∈ R 4 for which there exists a sequence (x ) in Σ and The second-order subjet of a lower-semicontinuous function V at a pointx ∈ Σ, denoted by P 2,− V (x), is defined as in (39) with a greater than or equal (≥) inequality. The set P 2,− V (x) is defined similarly. Note that since x is a state variable superjets and subjects should normally also have second order terms with respect to x. However, since the HJB equation (8) only involves the first order derivative of the value function with respect to x, the second order expansion in x is not needed.
Assume that U is upper-semicontinuous and ϕ ∈ C 1,1,2 (Σ). Thenx ∈ Σ is a maximum point ). Similar conclusion holds for the minimum point and the subjet.
which is nonnegative as long as we choose the constant γ large enough such that (β + γ − c) > 0. Therefore, for any > 0, V (x, ) := V (x, ) + κ(x) is a supersolution to the HJB equation (8). To check this, let ϕ(x, ) be the test function for V (x, ). So ϕ(x, ) − κ(x) is the test function for the supersolution V (x, ). We have For each ∈ M, Ψ (·, ·, ) is continuous. Hence its maximum, denoted by M , over the compact set Σ 1 × Σ 1 can be attained at (x , y ). Assume that the maximum M := max ∈M M is attained at ∈ M and (x , y ). We have M ≤ M =Ψ (x , y , ) ≤ U (x , ) − V (y , ).
As → 0, the bounded sequence (x , y ) converges, up to a subsequence, to a limit (x,ȳ) ∈ Σ 1 × Σ 1 . By assumption, M is finite. For each ∈ M, the sequence (x , y ) converges, up to a subsequence, to its limit, respectively. Therefore, for small enough, =¯ for¯ ∈ M.