1 Introduction

Recently, there have been crucial developments in quantitative financial strategies to execute the orders driven in markets by computer programs with a very high speed (in microseconds). In particular, high-frequency trading is one of the major topics that attracts the attention excessively due to its benefits on market microstructure, being an interdisciplinary field including the hot topics, such as stochastic optimization, finance, economics and statistics. The market microstructure, which can be stated as the research on the strong trading mechanisms managed for the financial securities, has been equipped with the contributions by the books Hasbrouck (2007) and O’Hara (1997). A significant number of algorithmic trading strategies in markets has also been commenced with the appearance of high-frequency trading which is characterized as a less narrow set of trading strategies in the algorithmic trading class and a growing need for the quantitative approaches on the analysis and optimization techniques to develop the trading strategies.

In electronic markets, any trader can become a market maker who provides the liquidity to the markets in Limit Order Books (LOB); and market makers are allowed to submit the orders on both buy and sell sides of the market by the trading mechanisms. Deciding for the best bid and ask prices that a market maker sets up is a hard and complex problem in many aspects due to the fact that the problem should be tackled as a combined problem of the modeling the asset price dynamics and the optimal spreads. Fortunately, the stochastic control theory helps to handle such kind of optimization problem by seeking an optimal strategy in order to maximize the trader’s objective function and to face a dyadic problem for the high-frequency trading. The theory encourages the study of optimizing activities in financial markets as it allows to accomplish the complex optimization problems involving constraints that are consistent with the price dynamics while managing the inventory risk. In order to detect the optimal quotes in the market, it is, therefore, necessary to solve the corresponding nonlinear Hamilton-Jacobi-Bellman (HJB) equation for the optimal stochastic control problem. This is generally achieved by applying various root-finding algorithms that can handle the complexity and high-dimensionality of the equation. See for instance Bachouch et al. (2022) and Baldacci et al. (2019).

In the framework of the optimal trading strategy for high-frequency trading in a LOB, there have been many papers following early studies of Grossman and Miller (1988) and Ho and Stoll (1981). Avellaneda and Stoikov (2008) have revised the study of Ho and Stoll (1981) building a practical model that considers a single dealer trading a single stock facing with a stochastic demand modeled by a continuous time Poisson process. The literature on the optimal market making problem has been burgeoning since 2008 with the work of Avellaneda and Stoikov (2008), inspiring Guilbaud and Pham (2013) to derive a model involving limit and market orders with optimal stochastic spreads. Bayraktar and Ludkovski (2014) have considered the optimal liquidation problem where they model the order arrivals with intensities depending on the liquidation price. More advanced models have been developed with adverse selection effects and stronger market order dynamics, see for example the paper of Cartea et al. (2014). Guéant et al. (2013) have extended and formalized the results of Avellaneda and Stoikov (2008). Another extended market making model with inventory constraints has been provided by Fodra and Labadie (2012) who consider a general case of midprice by linear and exponential utility criteria and find closed-form solutions for the optimal spreads. Cartea and Jaimungal (2015) have proposed a solution to deal with the problem of including the market impact on the midprice and have worked on risk metrics for the high-frequency trading strategies they have developed. Moreover, Yang et al. (2020) have improved the existing models with Heston stochastic volatility model, to characterize the volatility of the stock price with price impact and, implemented an approximation method to solve the nonlinear HJB equation. They have considered a constant price impact using the same counting processes for both arrival and filled limit orders. More recently, Baldacci et al. (2021) have studied the optimal control problem for an option market maker with Heston model in an underlying asset using the vega approximation for the portfolio. For more developments in optimal market making literature, we refer the reader to Guéant (2017), Ahuja et al. (2016), Cartea et al. (2015, 2017), Guéant and Lehalle (2015), Nyström (2014) and Guéant et al. (2012).

The goal of this paper is first to propose an optimal quoting strategy that is adopted by the stochastic volatility, drift effect and market impact by the amount and type of the orders in the price dynamics. We also consider the case of the market impact occuring by the jumps in volatility dynamics. More precisely, we investigate an optimal trading strategy by these extended price modelings under different utility functions proposing two independent counting processes to express the market impact by the arrival and the filled limit orders motivated by Cartea and Jaimungal (2015). We derive the closed-form solutions for the optimal quotes and solve the corresponding nonlinear HJB equations using the finite difference discretization method which enables us to evaluate the spread values and derive the various simulation analyzes. Furthermore, we explore the risk and normality testings of the models depending on their strategies. Lastly, we compare the models that we have derived in this paper with existing optimal market making models in the literature under both quadratic and exponential utility functions.

The rest of the paper is organized as follows. In Sect. 2, we set the framework in continuous time and formulate the optimization problem in terms of the expected return of the trader. Section 3 is dedicated to the study of the stochastic control and Hamilton-Jacobi-Bellman equations for the model proposed in Sect. 2. In Sect. 3.2.1, we consider the case of the jumps in volatility of the price. In Sect. 5, we present numerical solutions under various conditions. Finally, Sect. 6 concludes the paper with an outlook. The paper is also equipped with an Appendix on how to use the method of finite differences for the numerical solution of the corresponding nonlinear differential equation.

2 A Market Making Optimization Problem in a Limit Order Book

We define a probability space \((\Omega ,\mathcal {F},\mathbb {P})\) with a sample space \(\Omega \), filtration \(\mathcal {F}\) and a probability measure \(\mathbb {P}\) for all random variables and stochastic processes.

To start, we set up a high-frequency trading model in order to gain from the expected profit by building trading strategies on limit buy and sell orders. The model we will explore is based on a stock price that is generated by Poisson processes with various intensities representing the different jump amounts to employ the adverse selection effects. The model also includes the stochastic volatility dynamics.

Assume that the midprice [or fundamental price Cartea and Jaimungal (2015)] \(S_t\) of the stock in the market follows the dynamics:

$$\begin{aligned} dS_t&=\mu dt+\sqrt{\nu _t} dB_t^1+{\varepsilon ^+} dM_t^+ - {\varepsilon ^-} dM_t^-, \nonumber \\ d\nu _t&=k(\theta -\nu _t)dt+\sigma \sqrt{\nu _t}dB_t^2, \\ dB_t^1 dB_t^2&=\rho dt, \nonumber \end{aligned}$$
(1)

which employs the Heston stochastic volatility model Heston (1993), where \(B_t^1\) and \(B_t^2\) are Wiener processes and \(\rho \in [-1,1]\) is the instantaneous correlation coefficient between them. Here, \(\mu \) is the constant drift term, \(\theta \) is the long-term variance parameter, k is the rate at which the stochastic volatility \(\nu _t\) reverts to \(\theta \), \(\sigma \) is the volatility of the volatility and \(\nu _t\ge 0\) follows a mean-reverting square root process. We should note that if the Feller’s condition, \(2k\theta \ge \sigma ^2\) Feller (1951), is satisfied, then the volatility process \(\nu _t\) becomes always positive. In the model, \(M_t^{\pm }\) are independent Poisson processes with intensities \(\lambda ^{\pm }\) which count the number of arrived market orders and \(\varepsilon ^\pm \) are the jump sizes in the midprice caused by the orders which are i.i.d. random variables with finite second moments having \(\mathbb {E}[\varepsilon ^\pm ]=\epsilon ^\pm \).

The model is constructed for the case of market making problem. Hence, we assume that there is a market maker who continuously proposes optimal bid and ask quotes at prices \(S_t-\delta _t^-\) and \(S_t+\delta _t^+\), where \(\delta _t^\pm \) are the related depths at which the market maker posts the limit orders.

The inventory of the market maker with an initial inventory \(q_0=0\) is restricted to be between upper and lower bounds during the trading session at any time t; particularly, \(q\in [\underline{q},\overline{q}]\) and it has the following dynamics:

$$\begin{aligned} q_t=q_0+N_t^{-}-N_t^{+}, \quad q_t\in \mathbb {Z}, \quad t \in [0,T], \end{aligned}$$

with maturity time T, where \(N_t^{-}\) and \(N_t^{+}\) are the two independent counting processes for the market orders that are filled by the buy and sell orders, respectively. The inventory changes with probability \(e^{-\kappa ^{\pm }\delta _t^{\pm }}\) for filled limit orders and \(\kappa ^\pm \) represents the exponential decay factor for the rate of filled orders. Hence, \(N_t^{\pm }\) is updated as 1 if the arriving order is a market order and is filled with the probability \(e^{-\kappa ^{\pm }\delta _t^{\pm }}\); otherwise \(N_t^{\pm }\) becomes zero. We should note that the processes \(M_t^{\pm }\) jump when the processes \(N_t^{\pm }\) jump since \(N_t^{\pm }\) are processes for filled orders. On the other hand, in case of \(M_t^{\pm }\) jump, the processes \(N_t^{\pm }\) jump only if the market order is sufficiently large to fill the limit order and the processes \(N_t^{\pm }\) are not Poisson.

Since the market maker trades continuously, the wealth process \(X_t\), the cash of the trader during any time t, has the stochastic dynamics as follows:

$$\begin{aligned} dX_t&=p_t^{+}dN_t^{+}-p_t^{-}dN_t^{-} \\&=(S_t+\delta _t^{+})dN_t^{+}-(S_t-\delta _t^{-})dN_t^{-}. \end{aligned}$$

Additionally, based on the current wealth, inventory and price of the stock at any time t, the profit and loss value of the trader can be calculated by \(x_t+q_t S_t\).

Supposing that the market orders arrive and are filled by limit orders, the rate of execution, \(\Lambda _t:\mathbb {R}\rightarrow \mathbb {R}^{+}\), can be written as

$$\begin{aligned} \Lambda _t^\pm (\delta _t^\pm )=\lambda ^\pm e^{-\kappa ^{\pm }\delta _t^{\pm }}. \end{aligned}$$
(2)

Now, we can define the market maker’s problem as a stochastic optimization model. The strategy of the market maker is to maximize the expected cash value at the maturity time T including a penalty on the inventories. By using the stochastic control approach, the value function for this maximization problem can be formalized as follows:

$$\begin{aligned} W(t,x,S,\nu ;q)=\sup _{(\delta _s^{\pm })_{t\le s \le T}\in \mathcal {A}_t}\mathbb {E}\left[ U(X_T,S_T;q_T)-\psi \sigma ^2\int _{t}^{T}q_s^{2}\nu _s ds\right] , \end{aligned}$$
(3)

where \(U(X_T,S_T;q_T)\) is the utility function, and

$$\begin{aligned} \mathcal {A}_t=\left\{ (\delta _s^{\pm *})_{t\le s \le T}\ge 0 : \delta _s^{\pm *} \text { is } \mathcal {F}\text {-predictable}\right\} \end{aligned}$$
(4)

is the set of admissible strategies on [tT] corresponding to all self-financing strategies. Here, \(\mathbb {E}[\cdot ]\) denotes the conditional expectation given \(X_{t^-}=x\), \(q_{t^-}=q\), \(S_{t^-}=S\) and \(\nu _{t^-}=\nu \) such that the inventories are bounded from above by \(\overline{q}>0\) and from below by \(\underline{q}<0\). In the admissible strategies, we force to have \(\lim \limits _{q \rightarrow \underline{q}}\delta _t^{+*}=+\infty \) and \(\lim \limits _{q \rightarrow \overline{q}}\delta _t^{-*}=+\infty \) for the boundaries of the inventory set.

The term \(\psi \) in (3) represents the constant to penalize the variations on [0, T] in the value function; and the component \(\psi \sigma ^2\mathbb {E}\left[ \int _{t}^{T}q_s^{2}\nu _s ds\right] \) is the penalty function on the inventories during the entire path of the strategy. This penalty term can be obtained by the variance of the total value of the market maker’s inventory ignoring the jumps and deterministic components of the midprice dynamics. Formally, we have

$$\begin{aligned} \text {Var}{\left( \int _{t}^{T}q_s dS_t\right) } =\mathbb {E}\left[ \left( \int _{t}^{T}q_s dS_t\right) ^2\right] =\mathbb {E}\left[ \int _{t}^{T}q_s^{2}\nu _s ds\right] , \end{aligned}$$

since \(\mathbb {E}\left[ \int _{t}^{T}q_s dS_t\right] =0\) by our assumption.

While the market maker wants to maximize her profit from the transactions over a finite time horizon, she also wants to keep her inventories under control and get rid of the remaining inventories at the final time T by the penalization terms.

3 Dynamic Programming Equation for the Value Function

Under the assumptions provided in Sect. 2 and assuming that \((S_t,M_t^\pm ,N_t^\pm )\) is Markovian, the optimization problem (3) can be solved using the stochastic control approach (Bates 2016; Björk 2012; Pham 2009). The solution will be based on two different choices of utility functions, quadratic and exponential, in the sequel.

3.1 Case 1: Quadratic utility function

We assume that the utility function is of the quadratic form, that is,

$$\begin{aligned} U(X_T,S_T;q_T)=X_T+q_TS_T+\eta (q_T), \quad \eta (q_T)=-\alpha q_T^2, \end{aligned}$$

where the function \(\eta (q_T)\) may be considered as a function that penalizes the leftover inventories at the maturity time with a constant execution cost parameter \(\alpha \). Note that this utility function is linear when \(\alpha =0\), and hence, the market maker becomes risk-neutral in such a case.

Thereby, one has the corresponding value function

$$\begin{aligned} W(t,x,S,\nu ;q)=\sup _{(\delta _s^{\pm })_{t\le s \le T}\in \mathcal {A}_t}\mathbb {E}\left[ X_T+q_TS_T+\eta (q_T)-\psi \sigma ^2\int _{t}^{T}q_s^{2}\nu _s ds\right] , \end{aligned}$$
(5)

which should be satisfied by the HJB equation.

Proposition 1

The value function (5) satisfies the HJB equation,

$$\begin{aligned}&\partial _t W+\mu \partial _{S} W+k(\theta -\nu )\partial _{\nu }W+\frac{1}{2}\nu \partial _{SS}W+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }W+\sigma \rho \nu \partial _{S\nu }W-\psi \nu q^2 \sigma ^2 \nonumber \\&\quad +\sup _{\delta _t^{+}}\Big \{\Lambda _t^{+}(\delta _t^+)\mathbb {E}\left[ W(t,x+(S_t+\delta _t^+),S_t+\varepsilon ^{+},\nu _t;q-1)-W(t,x,S_t,\nu _t;q)\right] \nonumber \\&\quad +(\lambda ^+ -\Lambda _t^{+}(\delta _t^+))\mathbb {E}\left[ W(t,x,S_t+\varepsilon ^{+},\nu _t;q)-W(t,x,S_t,\nu _t;q)\right] \Big \} \nonumber \\&\quad +\sup _{\delta _t^{-}}\Big \{\Lambda _t^{-}(\delta _t^-)\mathbb {E}\left[ W(t,x-(S_t-\delta _t^-),S_t-\varepsilon ^{-},\nu _t;q+1)-W(t,x,S_t,\nu _t;q)\right] \nonumber \\&\quad +(\lambda ^- -\Lambda _t^{-}(\delta _t^-))\mathbb {E}\left[ W(t,x,S_t-\varepsilon ^{-},\nu _t;q)-W(t,x,S_t,\nu _t;q)\right] \Big \}=0, \end{aligned}$$
(6)

with the final condition,

$$\begin{aligned} W(T,x,S,\nu ;q)=x+q(S-\alpha q), \end{aligned}$$
(7)

where \(\Lambda _t\) is given in (2) and the expectation is taken over the random variables \(\varepsilon ^\pm \) .

Proof

Here, we will show only the basic steps of the proof. For more details, one can refer to Fleming and Soner (2006) and Pham (2009).

It is clear that the value function (5) for \(\mathbb {R}^{+}\times \mathbb {R}^{n}\rightarrow \mathbb {R}\) is in the form of

$$\begin{aligned} \sup _{u_t\in \mathcal {A}_t}\mathbb {E}\left[ \int _{t}^{T}F(s,X_s^u,u_s) ds + G(X_s^u)\right] \end{aligned}$$

and that it is optimal when \(u_t=u(t,S_t)\) is the control process of the problem, \(\mathcal {A}_t\) is the set of the admissible strategies, F and G are the instantaneous and terminal reward functions, respectively.

We want to derive a partial differential equation (PDE) for the value function (5). Further, we fix \((t,x)\in (0,T)\times \mathbb {R}^{n}\) and choose any stopping time \(t+h<T\) where \(h>0\) is small enough. Then, we consider the expected utility function

$$\begin{aligned} \mathbb {E}_{t,x}\Big [\int _{t}^{t+h}F(s,X_s^u,u_s) ds\Big ]. \end{aligned}$$

It is trivial to have the inequality

$$\begin{aligned} W(t,x,S,\nu ;q)\ge \mathbb {E}_{t,x}\Big [\int _{t}^{t+h}F(s,X_s^u,u_s) ds + W(t+h,X_{t+h}^u,S,\nu ;q)\Big ]. \end{aligned}$$
(8)

By Itô’s formula, we also obtain

$$\begin{aligned} W(t+h,X_{t+h}^u,S,\nu ;q)&=W(t,x,S,\nu ;q) \\&+\int _{t}^{t+h}\left\{ \partial _t W(s,X_s^u,S,\nu ;q)+\mathcal {L}_tW(s,X_s^u,S,\nu ;q)\right\} ds \\&+\int _{t}^{t+h}\partial _xW(s,X_s^u,S,\nu ;q)dB_s^1. \end{aligned}$$

Plugging this into (8), we get

$$\begin{aligned} \mathbb {E}_{t,x}\Big [\int _t^{t+h}\left[ F(s,X_s^u,u_s) ds+\partial _tW(s,X_s^u,S,\nu ;q)+\mathcal {L}_t^u W(s,X_s^u,S,\nu ;q)\right] ds\Big ]\le 0, \end{aligned}$$
(9)

where \(\mathcal {L}_t^u\) is the infinitesimal generator for \(W(t,X_t^u,S,\nu ;q)\), given by

$$\begin{aligned} \mathcal {L}_tW(t,X_t^u,S,\nu ;q)&= \mu \partial _{S} W+k(\theta -\nu )\partial _{\nu }W+\frac{1}{2}\nu \partial _{SS}W+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }W+\sigma \rho \nu \partial _{S\nu }W. \end{aligned}$$

Dividing (9) by h and taking the limit as \(h\rightarrow 0\), we obtain

$$\begin{aligned} F(t,x,u)+\partial _tW(t,x,S,\nu ;q)+\mathcal {L}_t^u W(t,x,S,\nu ;q) \le 0. \end{aligned}$$
(10)

Since (10) holds for all \(u(t,x)=\hat{u}(t,x)\), finally we obtain the HJB equation which is explicitly given by (6):

$$\begin{aligned} \partial _t W+\sup _{u\in \mathcal {A}_t}\left\{ \mathcal {L}_t^u W(t,x,S,\nu ;q) + F(t,\nu _t,u)\right\}&=0, \\ W(T,x,S,\nu ;q)&=G(x). \end{aligned}$$

This completes the proof.

3.1.1 Deriving the optimal quotes

For the case of a quadratic utility function, we derive the optimal spreads for limit orders and observe their behaviors. For this purpose, we should obtain an appropriate solution to (6) with the final condition (7) and show that this solution verifies the value function (5).

Proposition 2

Let

$$\begin{aligned} W(t,x,S,\nu ;q)=x+q(S-\alpha q)+u(t,\nu ;q) \end{aligned}$$
(11)

be a solution to the HJB Eq. (6) which is suggested by the final condition (7) where u is a solution of the following equation:

$$\begin{aligned}&\psi \nu q^2 \sigma ^2-\mu q = \partial _{t}u+k(\theta -\nu )\partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u \nonumber \\&\quad +{\sup \limits _{\delta _t^+}}\lambda ^{+}\left\{ q\epsilon ^{+}+e^{-\kappa ^{+} \delta ^{+}}(\delta ^{+}-\epsilon ^{+}-\alpha (1-2q)+u(t,\nu ;q-1)-u(t,\nu ;q))\right\} \nonumber \\&\quad +\sup \limits _{\delta _t^-}\lambda ^{-}\left\{ -q\epsilon ^{-}+e^{-\kappa ^{-} \delta ^{-}}(\delta ^{-}-\epsilon ^{-}-\alpha (1+2q)+u(t,\nu ;q+1)-u(t,\nu ;q))\right\} \end{aligned}$$
(12)

for \(q\in [\underline{q},\overline{q}]\) with final condition \(u(T,\nu ;q)=0\). Then, the optimal feedback controls of (6) are given by

$$\begin{aligned} \begin{array}{l} \delta ^{+*}(t,\nu ;q)=\frac{1}{\kappa ^{+}}+\epsilon ^{+}+\alpha (1-2q)-u(t,\nu ;q-1)+u(t,\nu ;q) \quad \text {when} \quad q\ne \underline{q}, \\ \delta ^{-*}(t,\nu ;q)=\frac{1}{\kappa ^{-}}+\epsilon ^{-}+\alpha (1+2q)-u(t,\nu ;q+1)+u(t,\nu ;q) \quad \text {when} \quad q\ne \overline{q}. \end{array} \end{aligned}$$
(13)

Proof

We start with inserting the specified proposed solution (11) into (6) and substituting the intensity functions of the filled orders, which are \(\Lambda _t^\pm (\delta _t^\pm )=\lambda ^\pm e^{-\kappa ^{\pm }\delta _t^\pm }\). Then, (6) is reduced to (12).

Finally, applying the first order optimality conditions to the supremum terms in (12), the optimal choices of depths, given by (13), can be obtained in order to complete the proof.

Note that when the function \(u(t,\nu ;q)\) is independent of \(\nu \), the formulas given by (13) correspond to the optimal control results in Cartea and Jaimungal (2015).

We use the optimal spreads (13), derived in this section, to solve the nonlinear HJB Eq. (6). Therefore, inserting these optimal spreads into (12) yields the following nonlinear PDE for the verification:

$$\begin{aligned}\psi \nu q^2 \sigma ^2-\mu q &= \partial _{t}u+k(\theta -\nu )\partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u \nonumber \\&\quad +\lambda ^{+}\left[ q\epsilon ^{+}+\frac{1}{\kappa ^{+}}e^{-1-\kappa ^{+}(\epsilon ^{+}+\alpha (1-2q)-u(t,\nu ;q-1)+u(t,\nu ;q))}\right] \nonumber \\&+\lambda ^{-}\left[ -q\epsilon ^{-}+\frac{1}{\kappa ^{-}}e^{-1-\kappa ^{-}(\epsilon ^{-}+\alpha (1+2q)-u(t,\nu ;q+1)+u(t,\nu ;q))}\right] \end{aligned}$$
(14)

for \(q\in [\underline{q},\overline{q}]\) with the final condition \(u(T,\nu ;q)=0\).

We should also note that the behavior of the equation is changed at the boundary points of the inventory limits. Being \(q=\underline{q}\) means that the selling is forbidden for the market maker, since there will be no leftover inventories if the selling action happens. As a result, we have the HJB equation

$$\begin{aligned}&\psi \nu q^2 \sigma ^2-\mu q = \partial _{t}u+k(\theta -\nu )\partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u \nonumber \\&\quad +\lambda ^{-}\left[ -q\epsilon ^{-}+\frac{1}{\kappa ^{-}}e^{-1-\kappa ^{-}(\epsilon ^{-}+\alpha (1+2q)-u(t,\nu ;q+1)+u(t,\nu ;q))}\right] +\lambda ^{+}q\epsilon ^{+}. \end{aligned}$$
(15)

Therefore, in this case, we can only find the optimal buy spread \(\delta _t^{-*}\).

Similarly, in the case of \(q=\overline{q}\), buying is forbidden for the market maker. Thus, we have

$$\begin{aligned}&\psi \nu q^2 \sigma ^2-\mu q = \partial _{t}u+k(\theta -\nu )\partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u\nonumber \\&\quad +\lambda ^{+}\left[ q\epsilon ^{+}+\frac{1}{\kappa ^{+}}e^{-1-\kappa ^{+}(\epsilon ^{+}+\alpha (1-2q)-u(t,\nu ;q-1)+u(t,\nu ;q))}\right] -\lambda ^{-}q\epsilon ^{-}. \end{aligned}$$
(16)

We should recall that we impose the inventory \(q_t\) to be in a finite range \([\underline{q},\overline{q}]\) for the whole trading session.

Corollary 1

When \(\mu =0\), \(\lambda ^+=\lambda ^-=\lambda \), \(\epsilon ^+=\epsilon ^-=\epsilon \), \(\kappa ^+=\kappa ^-=\kappa \), the optimal spreads are symmetric in the sense that \(\delta ^{\pm *}(t,\nu ;q)=\delta ^{\mp *}(t,\nu ;-q)\).

Proof

Let \(\mu =0\), \(\lambda ^+=\lambda ^-=\lambda \), \(\epsilon ^+=\epsilon ^-=\epsilon \), \(\kappa ^+=\kappa ^-=\kappa \). Then, the system (14) is invariant under interchanging q with \(-q\). Thus, we have \(u(t,\nu ;q) = u(t,\nu ;-q)\) which leads \(\delta ^{\pm *}(t,\nu ;q)=\delta ^{\mp *}(t,\nu ;-q)\) by the optimal controls (13).

The computational difficulty to solve the Eqs. (14), (15) and (16) together arises, due to the fact that equations contain a discrete variable q with continuous variables t and \(\nu \). Further, u values at level \(q-1\), as well as \(q+1\), feed the u values at level q. Hence, to overcome this difficulty, we solve the nonlinear verification equation by applying finite difference discretization scheme backwards in time. For the details, see Appendix 1. After calculating \(u(t,\nu ;q)\), we can generate the optimal distances given by the formulas (13).

Remark 1

By the transformation \(u(t,\nu ;q)=\frac{1}{\kappa }\ln {\omega (t,\nu ;q)}\) with \(\varvec{\omega }(t,\nu ;q)=[\omega (t,\nu ;\overline{q}),\omega (t,\nu ;\overline{q}-1),\ldots ,\omega (t,\nu ;\underline{q})]'\) where \(\kappa ^+=\kappa ^-=\kappa \), storing all q’s into a vector and after some calculations; (14), (15), and (16) can be transformed into the following nonlinear system of PDEs

$$\begin{aligned} \varvec{\omega _t} + A \varvec{\omega _\nu } + B\varvec{\omega _{\nu \nu }} + C\varvec{\tilde{\omega}} + D\varvec{\omega } = \varvec{0}, \end{aligned}$$
(17)

where \(\varvec{\omega _t}\), \(\varvec{\omega _\nu }\), \(\varvec{\omega _{\nu \nu }}\) and \(\varvec{\tilde{\omega }}\) are \((\overline{q}-\underline{q}+1)\times 1\) vectors given by

$$\begin{aligned}&\varvec{\omega _t}=[\omega _t(t,\nu ;q)], \quad \varvec{\omega _\nu }=[\omega _\nu (t,\nu ;q)], \\ &\varvec{\omega _{\nu \nu }}=[\omega _{\nu \nu }(t,\nu ;q)], \quad \tilde{\varvec{\omega }}=\left[ \frac{(\omega _\nu (t,\nu ;q))^2}{\omega (t,\nu ;q)}\right] \end{aligned}$$

with \(q=\overline{q},\overline{q}-1, \ldots, \underline{q}+1,\underline{q}\) and,

$$\begin{aligned} A&= \begin{pmatrix} k(\theta -\nu ) &{} 0 &{} \cdots &{} 0 \\ 0 &{} k(\theta -\nu ) &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 0 &{} 0 &{} \cdots &{} k(\theta -\nu ) \end{pmatrix},&B&= \begin{pmatrix} \frac{1}{2}\sigma ^2\nu &{} 0 &{} \cdots &{} 0 \\ 0 &{} \frac{1}{2}\sigma ^2\nu &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 0 &{} 0 &{} \cdots &{} \frac{1}{2}\sigma ^2\nu \end{pmatrix}, \\ C&= \begin{pmatrix} -\frac{1}{2}\sigma ^2\nu &{} 0 &{} \cdots &{} 0 \\ 0 &{} -\frac{1}{2}\sigma ^2\nu &{} \cdots &{} 0 \\ \vdots &{} \vdots &{} \ddots &{} \vdots \\ 0 &{} 0 &{} \cdots &{} -\frac{1}{2}\sigma ^2\nu \end{pmatrix},&D&= \begin{pmatrix} a &{} b &{} 0 &{} \cdots &{} 0 &{} 0 \\ c &{} a &{} b &{} \cdots &{} 0 &{} 0 \\ \vdots &{} \vdots &{} \vdots &{} \ddots &{} \vdots &{} \vdots \\ 0 &{} 0 &{} 0 &{} \cdots &{} c &{} a \\ \end{pmatrix}, \end{aligned}$$

with the entries

$$\begin{aligned} a&=\mu q \kappa - \psi \nu q^2\sigma ^2\kappa +\lambda ^+q \epsilon ^+\kappa - \lambda ^-q \epsilon ^-\kappa , \\ b&=\lambda ^+ e^{-\kappa \left( \frac{1}{\kappa }+\epsilon ^+ + \alpha (1-2q)\right) }, \\ c&=\lambda ^- e^{-\kappa \left( \frac{1}{\kappa }+\epsilon ^- + \alpha (1+2q)\right) }. \end{aligned}$$

Remark 2

An important restriction arises on the negative spreads since the intensities are defined for all real numbers and the trader should keep the admissible strategies where the optimal spreads should be positive and finite. To avoid this situation, we add a constraint for \(\delta _t^{\pm *}\) and get the maximum value of the negative spreads with a very small positive number \(\delta ^*\):

$$\begin{aligned} \begin{array}{rcl} \delta ^{+*}(t,\nu ;q) &{}=&{} \max \left\{ \left( \frac{1}{\kappa ^{+}}+\epsilon ^{+}+\alpha (1-2q)-u(t,\nu ;q-1)+u(t,\nu ;q)\right) , \delta ^*\right\} \quad \text {when} \quad q\ne \underline{q}, \\ \delta ^{-*}(t,\nu ;q) &{}=&{} \max \left\{ \left( \frac{1}{\kappa ^{-}}+\epsilon ^{-}+\alpha (1+2q)-u(t,\nu ;q+1)+u(t,\nu ;q)\right) , \delta ^*\right\} \quad \text {when} \quad q\ne \overline{q}. \end{array} \end{aligned}$$

3.1.2 Verification argument

Now, we show that a solution \(u(t,\nu ;q)\) of (12) exists and is unique that should be guaranteed by the verification theorem so that this classical solution is the value function of the HJB equation and the spreads, defined by (13), are indeed the optimal ones.

Theorem 1

Let \(u(t,\nu ;q)\) be a solution to (12). Then, \(W(t,x,S,\nu ;q)=x+q(S-\alpha q)+u(t,\nu ;q)\) is the value function for the control problem (5) and, moreover, the optimal controls are given by (13).

Proof

The proof is very similar to the discussions presented in Cartea and Jaimungal (2015) and Guéant et al. (2013).

Let \(t\in [0,T]\), \((\delta _{s}^{\pm })_{t\le s \le T}\) be the admissible controls and \(W(t,x,S,\nu ;q)\) be the solution to the HJB Eq. (6). Consider the following processes for \(s\in [t,T]\):

$$\begin{aligned} dS_s^{t,S}&=\mu ds+\sqrt{\nu _s}dB_s^1+\varepsilon ^+ dM_s^+ - \varepsilon ^- dM_s^-, \quad S_t^{t,S}=S, \\ d\nu _s^{t,\nu }&=k(\theta -\nu _s)ds+\sigma \sqrt{\nu _s}dB_s^2, \quad \nu _t^{t,\nu }=\nu , \end{aligned}$$

as well as

$$\begin{aligned} dX_s^{t,x,\delta _{s}^{\pm }}&= (S_s+\delta _s^{+})dN_s^{+}-(S_s-\delta _s^{-})dN_s^{-}, \quad X_t^{t,x,\delta _{s}^{\pm }}=x, \\ dq_s^{t,q,\delta _{s}^{\pm }}&=dN_s^{-}-dN_s^{+}, \quad q_t^{t,q,\delta _{s}^{\pm }}=q, \end{aligned}$$

such that \( dB_s^1 dB_s^2 = \rho ds \), where \(M^\pm \) are independent Poisson processes with intensities \(\lambda ^\pm \) and \(N^\pm \) are independent counting processes with filled probabilities \(e^{-\kappa ^{\pm }\delta _{s}^{\pm }}\). The optimal bid and ask prices are

$$\begin{aligned} S_s^-=S_s-\delta _s^{-} \quad (q\ne \overline{q}) \quad \text {and} \quad S_s^+=S_s+\delta _s^{+} \quad (q\ne \underline{q}) \end{aligned}$$

where the optimal spreads are

$$\begin{aligned} \delta _s^{\pm *}=\frac{1}{\kappa ^{\pm }}+\epsilon ^{\pm }+\alpha (1\pm 2q)-u(s,\nu ;q\pm 1)+u(s,\nu ;q). \end{aligned}$$

Define

$$\begin{aligned} t_n=T\wedge \inf \{ s>t : \vert S_s-S\vert \ge n \\ \text { or } \vert N_s^+-N_t^+\vert \ge n \text { or } \vert N_s^--N_t^-\vert \ge n \\ \text { or } \vert M_s^--M_t^-\vert \ge n \text { or } \vert M_s^+-M_t^+\vert \ge n \} \end{aligned}$$

for a given \(n\in \mathbb {N}\). Let W be a sufficiently smooth solution to the HJB Eq. (6). Then, using Itô’s formula for W, we have

$$\begin{aligned}&W(t_n,X_{t_n^-}^{t,x,\delta _{s}^{\pm }},S_{t_n}^{t,S},\nu _{t_n}^{t,\nu };q_{t_n^-}^{t,q,\delta _{s}^{\pm }}) = W(t,x,S,\nu ;q)\nonumber \\&\quad +\int _t^{t_n} \Bigg [\partial _s u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})+k(\theta -\nu _s)\partial _\nu u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }}) +\frac{1}{2}\sigma ^2\nu _s \partial _{\nu \nu }u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})+\mu q_{s}\Bigg ]ds \nonumber \\&\quad +\int _t^{t_n} q_{s}\sqrt{\nu _{s}}dB_s^1+\int _t^{t_n} \sigma \sqrt{\nu _{s}}\partial _\nu u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})dB_s^2+\varepsilon ^+\int _t^{t_n} q_{s^-}dM_s^+ - \varepsilon ^-\int _t^{t_n} q_{s^-}dM_s^- \nonumber \\&\quad + \int _t^{t_n} \left[ \delta _s^{+} +2\alpha q_{s^-}-\alpha -\varepsilon ^+dM_s^+ +u(s,\nu _s;q_{s^-}^{q,\delta _s^{+}}-1)-u(s,\nu _s;q_{s^-}^{q,\delta _s^{+}})\right] dN_s^+ \nonumber \\&\quad + \int _t^{t_n} \left[ \delta _s^{-} -2\alpha q_{s^-}-\alpha -\varepsilon ^-dM_s^- +u(s,\nu _s;q_{s^-}^{q,\delta _s^{-}}+1)-u(s,\nu _s;q_{s^-}^{q,\delta _s^{-}})\right] dN_s^-. \end{aligned}$$
(18)

Note that W is continuous and positive on a compact set, thus it has a lower bound. We know that \(\delta _{s}^{\pm }\) are bounded from below and \(\delta _s^{+}\rightarrow +\infty \) (\(\delta _s^{-}\rightarrow +\infty \)) as \(q_s\rightarrow \underline{q}\) (\(q_s\rightarrow \overline{q}\)). Hence, all the terms in stochastic integrals in (18) are bounded. By Dynkin’s formula Dynkin (1965) , we get

$$\begin{aligned}&\mathbb {E}\left[ W(t_n,X_{t_n^-}^{t,x,\delta _{s}^{\pm }},S_{t_n}^{t,S},\nu _{t_n}^{t,\nu };q_{t_n^-}^{t,q,\delta _{s}^{\pm }})\right] = W(t,x,S,\nu ;q) \\&\quad +\mathbb {E}\Bigg [\int _t^{t_n}\Bigg (\partial _s u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})+k(\theta -\nu _s)\partial _\nu u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})+\frac{1}{2}\sigma ^2\nu _s \partial _{\nu \nu }u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }}) \\&\quad + q_{s^-}(\mu +\epsilon ^+ - \epsilon ^-) +\lambda ^+\left( \delta _s^{+} +2\alpha q_{s^-}-\alpha -\epsilon ^+ +u(s,\nu _s;q_{s^-}^{q,\delta _s^{+}}-1)-u(s,\nu _s;q_{s^-}^{q,\delta _s^{+}})\right) \\&\quad +\lambda ^-\left( \delta _s^{-} -2\alpha q_{s^-}-\alpha -\epsilon ^- +u(s,\nu _s;q_{s^-}^{q,\delta _s^{-}}+1)-u(s,\nu _s;q_{s^-}^{q,\delta _s^{-}})\right) \Bigg )ds\Bigg ]. \end{aligned}$$

Now, by the dominated convergence theorem Klebaner (2005), it can be seen that

$$\begin{aligned}&\lim _{n\rightarrow \infty }\mathbb {E}\left[ W(t_n,X_{t_n^-}^{t,x,\delta _{s}^{\pm }},S_{t_n}^{t,S},\nu _{t_n}^{t,\nu };q_{t_n^-}^{t,q,\delta _{s}^{\pm }})\right] = \mathbb {E}\left[ W(T,X_{T}^{t,x,\delta _{s}^{\pm }},S_{T}^{t,S},\nu _{T}^{t,\nu };q_{T}^{t,q,\delta _{s}^{\pm }})\right] \\&\quad = W(t,x,S,\nu ;q) +\mathbb {E}\Bigg [\int _t^{T}\Bigg (\partial _s u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})+k(\theta -\nu _s)\partial _\nu u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})\\&\qquad +\frac{1}{2}\sigma ^2\nu _s \partial _{\nu \nu }u(s,\nu _{s}^{t,\nu };q_{s}^{t,q,\delta _{s}^{\pm }})+q_{s^-}(\mu +\epsilon ^+ - \epsilon ^-) \\&\qquad +\lambda ^+\left( \delta _s^{+} +2\alpha q_{s^-}-\alpha -\epsilon ^+ +u(s,\nu _s;q_{s^-}^{q,\delta _s^{+}}-1)-u(s,\nu _s;q_{s^-}^{q,\delta _s^{+}})\right) \\&\qquad +\lambda ^-\left( \delta _s^{-} -2\alpha q_{s^-}-\alpha -\epsilon ^- +u(s,\nu _s;q_{s^-}^{q,\delta _s^{-}}+1)-u(s,\nu _s;q_{s^-}^{q,\delta _s^{-}})\right) \Bigg )ds\Bigg ], \end{aligned}$$

which holds for all the admissible controls \((\delta _{s}^{\pm })_{t\le s \le T}\).

Using the fact that W solves that the HJB Eq. (6) and similar arguments in Cartea and Jaimungal (2015), we have

$$\begin{aligned} \mathbb {E}\left[ W(T,X_{T}^{t,x,\delta _{s}^{\pm }},S_{T}^{t,S},\nu _{T}^{t,\nu };q_{T}^{t,q,\delta _{s}^{\pm }})\right]&\le W(t,x,S,\nu ;q)+\psi \sigma ^2\mathbb {E}\left[ \int _t^T(q_s^{q,\delta _{s}^{\pm }})^2 \nu _s^{q,\delta _{s}^{\pm }} ds\right] . \end{aligned}$$

Therefore, we have

$$\begin{aligned}&\sup \limits _{\delta _{s}^{\pm }\in \mathcal {A}_s}\mathbb {E}\left[ X_{T}^{t,x,\delta _{s}^{\pm }}+q_{T}^{t,q,\delta _{s}^{\pm }}(S_T-\alpha q_{T}^{t,q,\delta _{s}^{\pm }})-\psi \sigma ^2 \int _t^T(q_s^{q,\delta _{s}^{\pm }})^2 \nu _s^{q,\delta _{s}^{\pm }} ds \right] \\&\quad \le W(t,x,S,\nu ;q) = \mathbb {E}\left[ X_{T}^{t,x,\delta _{s}^{\pm }}+q_{T}^{t,q,\delta _{s}^{\pm }}(S_T-\alpha q_{T}^{t,q,\delta _{s}^{\pm }})-\psi \sigma ^2 \int _t^T(q_s^{q,\delta _{s}^{\pm }})^2 \nu _s^{q,\delta _{s}^{\pm }} ds \right] . \end{aligned}$$

Hence, this proves that \(W(t,x,S,\nu ;q)\) is the value function of the optimization problem (5) and the \(\delta _t^{\pm *}\) given by (13) are the admissible optimal controls.

3.2 Case 2: Exponential utility function

The case of exponential utility function have been investigated earlier by Avellaneda and Stoikov(2008), Guéant et al. (2013), and Fodra and Labadie (2012) for several types of midprice dynamics. In this section, we illustrate the results for the midprice model given by (1). Assume that the utility function is exponential having a degree of risk aversion for the investor with the following related value function:

$$\begin{aligned} W(t,x,S,\nu ;q)=\sup _{(\delta _s^{\pm })_{t\le s \le T}\in \mathcal {A}_t}\mathbb {E}\left[ -e^{-\gamma (X_T+q_T S_T+\eta (q_T))}\right] , \end{aligned}$$
(19)

where \(\eta (q_T)=-\alpha q_T^2\). In this case, we assume that \(\psi =0\). Now, we display out the corresponding HJB equation of the value function (19).

Proposition 3

The value function (19) satisfies the following HJB equation,

$$\begin{aligned}&\partial _t W+\mu \partial _{S} W+k(\theta -\nu )\partial _{\nu }W+\frac{1}{2}\nu \partial _{SS}W+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }W+\sigma \rho \nu \partial _{S\nu }W\nonumber \\&\quad +\sup _{\delta _t^{+}}\Big \{\Lambda _t^{+}(\delta _t^+)\mathbb {E}\left[ W(t,x+(S_t+\delta _t^+),S_t+\varepsilon ^{+},\nu _t;q-1)-W(t,x,S_t,\nu _t;q)\right] \nonumber \\&\quad +(\lambda ^+ -\Lambda _t^{+}(\delta _t^+))\mathbb {E}\left[ W(t,x,S_t+\varepsilon ^{+},\nu _t;q)-W(t,x,S_t,\nu _t;q)\right] \Big \}\nonumber \\&\quad +\sup _{\delta _t^{-}}\Big \{\Lambda _t^{-}(\delta _t^-)\mathbb {E}\left[ W(t,x-(S_t-\delta _t^-),S_t-\varepsilon ^{-},\nu _t;q+1)-W(t,x,S_t,\nu _t;q)\right] \nonumber \\&\quad +(\lambda ^- -\Lambda _t^{-}(\delta _t^-))\mathbb {E}\left[ W(t,x,S_t-\varepsilon ^{-},\nu _t;q)-W(t,x,S_t,\nu _t;q)\right] \Big \}=0, \end{aligned}$$
(20)

with the final condition,

$$\begin{aligned} W(T,x,S,\nu ;q)=-e^{-\gamma (x+q(S-\alpha q))}. \end{aligned}$$
(21)

Proof

The proof is similar to the proof of Proposition 1.

3.2.1 Solution of the HJB equation

For the case of exponential utility function, now we explore the results of optimal controls obtained by solving the HJB Eq. (20).

Proposition 4

Let

$$\begin{aligned} W(t,x,S,\nu ;q)=-e^{-\gamma (x+q(S-\alpha q)+u(t,\nu ;q))} \end{aligned}$$
(22)

be a solution to the HJB Eq. (20) which is suggested by the final condition (21). Then, the optimal feedback controls of (20) are given by

$$\begin{aligned} \begin{array}{l} \delta ^{+*}(t,\nu ;q)=\frac{1}{\gamma }\ln \left( 1+\frac{\gamma }{\kappa ^+}\right) +\epsilon ^{+}+\alpha (1-2q)-u(t,\nu ;q-1)+u(t,\nu ;q) \quad \text {when} \quad q\ne \underline{q}, \\ \delta ^{-*}(t,\nu ;q)=\frac{1}{\gamma }\ln \left( 1+\frac{\gamma }{\kappa ^-}\right) +\epsilon ^{-}+\alpha (1+2q)-u(t,\nu ;q+1)+u(t,\nu ;q) \quad \text {when} \quad q\ne \overline{q}. \end{array} \end{aligned}$$
(23)

Proof

First, inserting the suggested solution (22) into (20) with the functions of filled orders, (20) is reduced to

$$\begin{aligned}&e^{-\gamma (x+q(S-\alpha q)+u(t,\nu ;q))} \nonumber \\&\quad \times \left[ \gamma \partial _t u+\mu \gamma q-\frac{1}{2}\gamma ^2 q^2\nu +\left( k(\theta -\nu )\gamma -\sigma \rho \gamma ^2 q\nu \right) \partial _{\nu }u+\frac{1}{2}\sigma ^2\gamma \nu \partial _{\nu \nu }u-\frac{1}{2}\sigma ^2\gamma ^2\nu (\partial _{\nu }u)^2\right] \nonumber \\&\quad +{\sup \limits _{\delta _t^+}}\; \lambda ^{+}\Big \{e^{-\gamma (x+q(S-\alpha q)+q\epsilon ^{+}+u(t,\nu ;q))}(e^{-\kappa ^+ \delta ^+}-1)+e^{-\gamma (x+q(S-\alpha q)+u(t,\nu ;q))} \nonumber \\&\quad -e^{-\kappa ^+ \delta ^+}e^{-\gamma (x+q(S-\alpha q)+q\epsilon ^+ +\delta ^+ -\epsilon ^+ + \alpha (2q-1)+u(t,\nu ;q-1))}\Big \}\nonumber \\&\quad +{\sup \limits _{\delta _t^-}}\; \lambda ^{-}\Big \{e^{-\gamma (x+q(S-\alpha q)-q\epsilon ^{-}+u(t,\nu ;q))}(e^{-\kappa ^- \delta ^-}-1)+e^{-\gamma (x+q(S-\alpha q)+u(t,\nu ;q))}\nonumber \\&\quad -e^{-\kappa ^- \delta ^-}e^{-\gamma (x+q(S-\alpha q)-q\epsilon ^- +\delta ^- -\epsilon ^- - \alpha (2q+1)+u(t,\nu ;q+1))}\Big \}=0 \end{aligned}$$
(24)

for \(q\in [\underline{q},\overline{q}]\) with final condition \(u(T,\nu ;q)=0\). Similar to the proof of Proposition 2, the optimal spreads (23) can be found by the first order optimality conditions.

Substituting the optimal spreads into (24) yields the verification equation,

$$\begin{aligned}&\frac{1}{2}\gamma q^2\nu -\mu q = \partial _t u+\left( k(\theta -\nu )-\sigma \rho \gamma q\nu \right) \partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u-\frac{1}{2}\sigma ^2\gamma \nu (\partial _{\nu }u)^2 \nonumber \\&\quad +\lambda ^{+}\left\{ e^{-\gamma q \epsilon ^+}e^{-\kappa ^+\left( \frac{1}{\gamma }\ln \left( 1+\frac{\gamma }{\kappa ^+}\right) +\epsilon ^+ + \alpha (1-2q)+u(t,\nu ;q)-u(t,\nu ;q-1)\right) }\frac{1}{\gamma +\kappa ^+}+\frac{1}{\gamma }\left( 1-e^{-\gamma q \epsilon ^+}\right) \right\} \nonumber \\&\quad +\lambda ^{-}\left\{ e^{\gamma q \epsilon ^-}e^{-\kappa ^-\left( \frac{1}{\gamma }\ln \left( 1+\frac{\gamma }{\kappa ^-}\right) +\epsilon ^- + \alpha (1+2q)+u(t,\nu ;q)-u(t,\nu ;q+1)\right) }\frac{1}{\gamma +\kappa ^-}+\frac{1}{\gamma }\left( 1-e^{\gamma q \epsilon ^-}\right) \right\} \end{aligned}$$
(25)

for \(q\in [\underline{q},\overline{q}]\) with final condition \(u(T,\nu ;q)=0\). Then, the following theorem holds true.

Theorem 2

Let \(u(t,\nu ;q)\) be a solution to (24). Then, \(W(t,x,S,\nu ;q)=-e^{-\gamma (x+q(S-\alpha q)+u(t,\nu ;q))}\) is the value function for the control problem (19) and, moreover, the optimal controls are given by (23).

Proof

The proof can be carried out using the similar techniques as in Theorem 1.

4 Effect of the Jumps in Volatility in a LOB model

Now, as another extension of a stock price impact on optimal market making problem, we work on the problem that the stochastic volatility of the asset is affected by the arrival of market orders and perform this case on the optimal trading prices. The models in literature assume that the stock price is followed by mostly Brownian motion with constant volatility, and in the cases of stochastic volatility, they consider only a diffusive volatility. Picking up the volatility as diffusive is highly permanent but this dynamics can allow the increments to increase only by a sequence of normally distributions. On the other hand, models with jumps in volatility are more persistent as the jumps fill in the gap between the stock prices and diffusive volatility supplying quick moves to increase the volatility and experiments show that diffusive volatility without jumps causes misdefined effects on prices Eraker et al. (2003).

Therefore, we consider that the volatility of the asset is stochastic and impacted by the orders including the jump processes:

$$\begin{aligned} dS_t&=\mu dt+\sqrt{\nu _t} dB_t^1, \nonumber \\ d\nu _t&=k(\theta -\nu _t)dt+\sigma \sqrt{\nu _t}dB_t^2 +\varepsilon ^+ dM_t^+ - \varepsilon ^- dM_t^-, \\ dB_t^1 dB_t^2&=\rho dt, \nonumber \end{aligned}$$
(26)

with the same assumptions and quadratic utility function as in Case 1 in Sect. 3. Therefore, the corresponding HJB equation can be obtained by applying the stochastic control approach.

Proposition 5

The value function (5) satisfies the HJB equation,

$$\begin{aligned}&\partial _t W+\mu \partial _{S} W+k(\theta -\nu )\partial _{\nu }W+\frac{1}{2}\nu \partial _{SS}W+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }W+\sigma \rho \nu \partial _{S\nu }W-\psi \nu q^2 \sigma ^2 \nonumber \\&\quad +\sup _{\delta _t^{+}}\Big \{\Lambda _t^{+}(\delta _t^+)\mathbb {E}\left[ W(t,x+(S_t+\delta _t^+),S_t,\nu _t+\varepsilon ^{+};q-1)-W(t,x,S_t,\nu _t;q)\right] \nonumber \\&\quad +(\lambda ^+ -\Lambda _t^{+}(\delta _t^+))\mathbb {E}\left[ W(t,x,S_t,\nu _t+\varepsilon ^{+};q)-W(t,x,S_t,\nu _t;q)\right] \Big \} \nonumber \\&\quad +\sup _{\delta _t^{-}}\Big \{\Lambda _t^{-}(\delta _t^-)\mathbb {E}\left[ W(t,x-(S_t-\delta _t^-),S_t,\nu _t-\varepsilon ^{-};q+1)-W(t,x,S_t,\nu _t;q)\right] \nonumber \\&\quad +(\lambda ^- -\Lambda _t^{-}(\delta _t^-))\mathbb {E}\left[ W(t,x,S_t,\nu _t-\varepsilon ^{-};q)-W(t,x,S_t,\nu _t;q)\right] \Big \}=0, \end{aligned}$$
(27)

with the final condition,

$$\begin{aligned} W(T,x,S,\nu ;q)=x+q(S-\alpha q). \end{aligned}$$

Proof

The proof is similar to the proof of Proposition 1.

Proposition 6

The optimal spreads related to the problem (27) are given by

$$\begin{aligned} \begin{array}{l} \delta ^{+*}(t,\nu ;q)=\frac{1}{\kappa ^+}+\alpha (1-2q)-u(t,\nu +\epsilon ^+;q-1)+u(t,\nu +\epsilon ^+;q) \quad \text {when} \quad q\ne \underline{q}, \\ \delta ^{-*}(t,\nu ;q)=\frac{1}{\kappa ^-}+\alpha (1+2q)-u(t,\nu -\epsilon ^-;q+1)+u(t,\nu -\epsilon ^-;q) \quad \text {when} \quad q\ne \overline{q}. \end{array} \end{aligned}$$
(28)

Proof

Using the suggested solution (11) for the HJB Eq. (27), it can be deduced that

$$\begin{aligned}&\psi \nu q^2 \sigma ^2-\mu q = \partial _{t}u+k(\theta -\nu )\partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u \nonumber \\&\quad +{\sup \limits _{\delta _t^+}}\; \lambda ^{+}\Big \{[u(t,\nu +\epsilon ^+;q)-u(t,\nu ;q)]\nonumber \\&\quad +e^{-\kappa ^{+} \delta ^{+}}(\delta ^{+}-\alpha (1-2q)+u(t,\nu +\epsilon ^+;q-1)-u(t,\nu +\epsilon ^+;q))\Big \} \nonumber \\&\quad +\sup \limits _{\delta _t^-}\; \lambda ^{-}\Big \{[u(t,\nu -\epsilon ^-;q)-u(t,\nu ;q)] \nonumber \\&\quad +e^{-\kappa ^{-} \delta ^{-}}(\delta ^{-}-\alpha (1+2q)+u(t,\nu -\epsilon ^-;q+1)-u(t,\nu -\epsilon ^-;q))\Big \} \end{aligned}$$
(29)

for \(q\in [\underline{q},\overline{q}]\) with final condition \(u(T,\nu ;q)=0\).

Hence, the optimal spreads (28) which maximize the supremums in the verification Eq. (30) can be properly defined to conclude the proof.

Furthermore, the verification equation that we will calculate the solution \(u(t,\nu ;q)\) with can be interpreted as

$$\begin{aligned}&\psi \nu q^2 \sigma ^2-\mu q= \partial _{t}u+k(\theta -\nu )\partial _{\nu }u+\frac{1}{2}\sigma ^2\nu \partial _{\nu \nu }u \nonumber \\&\quad +\lambda ^{+}\left\{ [u(t,\nu +\epsilon ^+;q)-u(t,\nu ;q)]+\frac{1}{\kappa ^+}e^{-1-\kappa ^{+}(\alpha (1-2q)-u(t,\nu +\epsilon ^+;q-1)+u(t,\nu +\epsilon ^+;q))}\right\} \nonumber \\&\quad +\lambda ^{-}\Big \{[u(t,\nu -\epsilon ^-;q)-u(t,\nu ;q)]+\frac{1}{\kappa ^-}e^{-1-\kappa ^{-}(\alpha (1+2q)-u(t,\nu -\epsilon ^-;q+1)+u(t,\nu -\epsilon ^-;q)}\Big \} \end{aligned}$$
(30)

for \(q\in [\underline{q},\overline{q}]\) with final condition \(u(T,\nu ;q)=0\).

5 Numerical Results

In this section, we provide the numerical results regarding on the solution of the market making problem and explore the behavior of the optimal controls \(\delta ^{+*}\) and \(\delta ^{-*}\) for various cases. We conduct the implementations of the models for a high-frequency trading and thus we consider the maturity time T as 10 s. The parameters that we use in the following analyzes are given in Table 1. Hence, the simulations in this part are executed using the parameters in Table 1 and solving the verification Eqs. (14), (25) and (30) for \(q\in [\underline{q},\overline{q}]\) with final condition \(u(T,\nu ;q)=0\).

Table 1 The parameters

5.1 Results with the quadratic utility function

This part intends to show the numerical experiments and the behaviour of the market maker under the results given in Sect. 3.1.

Figure 1 displays the solution of the value function \(u(t,\nu ;q)\) for a fixed inventory level q and a representation of the asset volatility which are obtained from one simulation.

Fig. 1
figure 1

Solution of \(u(t,\nu ;q)\) for \(q=0\) and a path of the simulated asset volatility

Figure 2 illustrates the optimal prices for \(q=-4\), \(q=0\) and \(q=4\) where each of them are obtained from one simulation and it shows that how the optimal prices calculated by the spread formulas in (13) change by our model. It is observed that the optimal spreads have different asymmetries for different level of the inventories. For example, the strategy is followed as that the trader buys an asset with lower spread and closer price to the midprice while she sells the asset putting higher sell spread and farther price when \(q=-4\). Here, S denotes the midprice of the stock which is obtained by the process (1) while “bid and ask” denote the optimal bid and ask prices which are obtained by \(S-\delta ^-\) and \(S+\delta ^+\).

Fig. 2
figure 2

Optimal prices for \(q=-4\), \(q=0\) and \(q=4\)

Figure 3 depicts one simulation of the profit and loss function of the market maker at any time t during the trading session in the left panel. The profit and loss performance of the trading is displayed by the cash level histogram in the left panel. It is observed from Fig. 3 that the strategy is profitable even when there are adverse selection effects in the model due to the expectations of the jumps.

Fig. 3
figure 3

A simulated path and histogram of the profit and loss function

In Fig. 4, some simulated paths of the inventory process and the average of these simulations can be seen for \(q\in [-5,5]\) and \(q\in [-10,10]\) while the other parameters are fixed as in Table 1. In the left figures, randomly chosen 10 paths of the inventory process are observed. The right figures illustrate all simulated paths with the average of these simulations. It is observed that the inventory processes change for each trade and the summarized pattern tends to revert to zero as the time approaches to the end of the trade. The figure clearly shows that the trade ends at some time between \(t=2\) and \(t=3\) when \(q\in [-5,5]\). We observe this result because the trader’s allowed inventory bound is restricted on a small range, so the inventories may not revert to zero at the end of the trade and she may have to pay the liquidation cost for the remaining inventories. Therefore, we provide the plots for \(q\in [-10,10]\) in order to see the time evolution of the process for larger inventory bounds.

Fig. 4
figure 4

Randomly chosen simulated paths of the inventory (on the left panels) and all simulated paths of inventory with the average (on the right panels)

In Fig. 5, we can see the optimal spreads \(\delta ^+\) and \(\delta ^-\) for the trader depending on the each inventory levels with a given liquidation parameter \(\alpha =0.01\). This is a small inventory-risk aversion value but is enough to force the inventory process to revert to zero at the end of the trading.

Fig. 5
figure 5

Optimal spreads \(\delta ^+\) and \(\delta ^-\)

On the negative inventory levels, \(\delta ^+\) values are larger when \(t<T\) since she is unable to sell when the inventory approaches to the minimum admitted level \(\underline{q}\), so that the trader may want to sell her assets only if she receives a large premium for selling on these levels. As t approaches to T, it is observed that the optimal sell spreads decrease since she wants to get rid off her assets rather than paying for the liquidation cost at the end of the trading. On the positive inventory levels, the qualitative behavior of the trader is just the opposite of the idea for the negative inventory levels. In this case, the trader wants to reduce the number of shares in her hand. Because if she still has the assets when the time approaches to the maturity time of the trade, then either she will have to sell them with lower price or pay for the liquidation cost at the end. The probability of selling the assets at maturity time is higher than that for the time far away from T. Therefore, the trader increases the selling spreads on the positive inventory levels as the time is almost close to T. Similar interpretation can be adapted for the optimal buy spread \(\delta ^-\) (see Fig. 5b).

Figure 6 depicts the trading intensities \(\lambda ^\pm e^{-\kappa ^{\pm }\delta _t^{\pm }}\) for each of the inventory level. It is observed that the thickness of the market prices is correlated with the trading intensity inversely. As a larger trading intensity decreases the market impact in execution which leads a decrease in price movements; it causes a lower price that is presented in Fig. 6.

Fig. 6
figure 6

Trading intensities for \(\delta ^+\) and \(\delta ^-\)

Figure 7 presents the \(\delta ^+\) and \(\delta ^-\) results when the arrival of market orders is asymmetric. The intensities \(\lambda ^\pm \) of the jump processes in asset price give us the information about the number of market order arrivals. For \(\lambda ^+=2\) and \(\lambda ^-=1\) while the other parameters are fixed to those in Table 1, we see that there are more buy market orders arriving, thus the optimal filled sell spreads are larger for all inventory levels comparing to the case when the arrival of market orders is symmetric.

Fig. 7
figure 7

Optimal spreads \(\delta ^+\) and \(\delta ^-\) for \(\lambda ^+=2\) and \(\lambda ^-=1\)

Figure 8 display how \(\delta ^+\) and \(\delta ^-\) are affected by the amount of different jump increments \(\epsilon ^+\) and \(\epsilon ^-\) keeping the rest of the parameters are fixed. A larger \(\epsilon ^+\) increment means that more buy market orders arrived and are filled by sell orders which causes larger spreads.

Fig. 8
figure 8

Optimal spreads \(\delta ^+\) and \(\delta ^-\) for \(\epsilon ^+=0.008\) and \(\epsilon ^-=0.004\)

For all simulations, it is observed in Table 2 that, when we compare our strategy with a benchmark strategy that is symmetric around the midprice independently of inventory as done in Avellaneda and Stoikov (2008), profit of the strategy is less than that of the symmetric strategy where the average spreads are calculated by \(\frac{\delta ^+ +\delta ^-}{2}\) with the optimal spreads \(\delta ^{\pm }\) obtained by (13). On the other hand, the results show that our strategy has a lower standard deviation. It can be also seen that the inventory of the trader reverts to zero more quickly than the symmetric strategy and the standard deviation of the inventory is produced less in the strategy.

Table 2 Comparison of the strategy with symmetric strategy

Note that when we have \(\varepsilon ^+=\varepsilon ^-=0\) in the model, then it reduces to the Heston stochastic volatility model without jumps:

$$\begin{aligned}&dS_t=\mu dt+\sqrt{\nu _t} dB_t^1, \nonumber \\&d\nu _t=k(\theta -\nu _t)dt+\sigma \sqrt{\nu _t}dB_t^2, \\&dB_t^1 dB_t^2=\rho dt. \nonumber \end{aligned}$$
(31)

We thereby observe that the optimal spread values are higher in the model with jumps (1) than those of the model without jumps (31); hence the adverse selection effect on a model with stochastic volatility is more profitable. The average spread is 1.0403 by the model (1) while it is 1.0322 by the model without jumps. In Table 3, it is obviously seen that the model with jumps produces larger sell spreads rather than the model without jumps.

Table 3 Comparison of two models with jumps and without jumps by the sell spread value \(\delta ^+(0,\nu _0;q)\)

5.1.1 Comparative statistics

In this section, we investigate the comparative statistics results of the model that we introduce in the previous section.

Table 4 shows some significant statistical properties of the strategy in terms of its terminal wealth. The Sharpe ratio which is the return per unit risk, i.e., mean over the standard deviation, is found to be 1.0156 for the profit and loss of the trader expressing that we have an attractive trading performance. We also reveal the skewness and kurtosis parameters to discover the degree of the normality violation of the distribution. The skewness characterizes the lack of symmetry that gets the importance because of the fact that the statistical theory generally uses the normal distribution assumption. Meanwhile, the kurtosis refers to the sharpness and height of the central peak of the distribution. By the skewness and kurtosis values given in the table, we refer that the profit and loss function for this trading session has a normal distribution since they lie in the acceptable range for normality. Figure 9 depicts the histogram of the inventory. Accordingly, we may conclude that the inventory has the normal distribution.

Table 4 Statistics of profit-loss (PnL) and inventory functions
Fig. 9
figure 9

Histogram of inventory

By the statistics of the spread \(\delta ^+ + \delta ^-\), as we observe in Table 5 obtained from all simulations, it can be deduced that the Sharpe ratio attracts the trader as it is very high since the standard deviation is very low while it has a good expected return. Moreover, the spread can also be considered to be normally distributed due to its skewness and kurtosis values.

Table 5 Statistics of spread

5.1.2 Sensitivity to parameters

As we have discussed the behaviors of the optimal spreads and some statistical properties of wealth and inventory processes of the trading in previous part of this section, now we carry out the dependency and sensitivity of the parameters to the solution of the optimization problem and explore the results in this part.

5.1.2.1 Effects of \(\alpha \)

Now, we work on the dependency of the optimal spreads with respect to the liquidation cost \(\alpha \). Numerically, we observe that the optimal spreads behave in different sense when t approaches to the final trading time with an increasing values of \(\alpha \). Since this parameter refers to the liquidation cost for the remaining inventories, the trader changes her behaviour at the end of the trade session when \(\alpha \) increases. We carry out the simulations with \(\alpha \in \{0,0.001,0.01\}\) while the other parameters are kept the same as in the Table 1.

We investigate the effect of \(\alpha \) on the optimal spreads by choosing three specific trading time; those are when \(t=0\), \(t=5\), and \(t=10\), since the behaviour of the trader changes with the trade time in terms of the liquidation cost. In this analysis, we explore the results for all inventory levels and \(\nu _0\).

At time \(t=0\), our results show that the change of the optimal spreads does not follow a monotonic way. On the other hand, at time \(t=5\) and \(t=10\), we observe the following behaviour of the optimal spreads:

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\partial \delta _t^+}{\partial \alpha }>0, \quad \frac{\partial \delta _t^-}{\partial \alpha }<0, &{} \quad q< 0, \\ \frac{\partial \delta _t^+}{\partial \alpha }>0, \quad \frac{\partial \delta _t^-}{\partial \alpha }>0, &{} \quad q = 0, \\ \frac{\partial \delta _t^+}{\partial \alpha }<0, \quad \frac{\partial \delta _t^-}{\partial \alpha }>0, &{} \quad q > 0. \end{array} \right. \end{aligned}$$
(32)

This result makes sense since the trader should also cover the liquidation cost while selling her assets when \(q<0\), for example. On the other hand, the optimal sell spreads get to decrease when \(q>0\) since it is optimal to post lower ask prices in order not to have any remaining inventories and pay for the liquidation cost. Therefore, we notice that as time passes and approaches to the final time, the trader behaves monotonically for an increased value of \(\alpha \) on the positive and negative inventory levels.

5.1.2.2 Effects of \(\mu \)

By the interpretation of the drift constant and its effect on the prices and spreads, we expect the dependence on \(\mu \) as

$$\begin{aligned} \frac{\partial \delta _t^+}{\partial \mu }>0, \quad \frac{\partial \delta _t^-}{\partial \mu }<0 \end{aligned}$$
(33)

for all q. We implement our numerical simulations with changing drift constant \(\mu \) in the set of values \(\{-0.01,0.01,0.02\}\) as the other parameters in Table 1 remain the same.

In Table 6, we observe that the optimal prices increase when the drift parameter \(\mu \) increases as the trader expects the price to move up, she sends the orders at higher prices to get profit from the price increase which meets with our expectation.

Table 6 Effects of \(\mu \) on \(\delta ^+ (0,\nu _0;q)\)
5.1.2.3 Effects of \(\psi \)

Turning to the constant \(\psi \) to penalize the variations, it can be seen that the optimal quotes increase when the risk of penalizing volatilities. Eventually, since the trader wants to cover her cost for the variations during the trading, the increase of optimal prices make sense to cover these costs by these amounts. Hence, the following behavior on optimal spreads is expected:

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\partial \delta _t^+}{\partial \psi }>0, \quad \frac{\partial \delta _t^-}{\partial \psi }<0, &{} \quad q< 0, \\ \frac{\partial \delta _t^+}{\partial \psi }<0, \quad \frac{\partial \delta _t^-}{\partial \psi }>0, &{} \quad q = 0, \\ \frac{\partial \delta _t^+}{\partial \psi }<0, \quad \frac{\partial \delta _t^-}{\partial \psi }>0, &{} \quad q > 0. \end{array} \right. \end{aligned}$$
(34)

As we execute our calculations with changing \(\psi \) parameter as \(\psi \in \{0,0.01,0.02\}\) while keeping the other parameters same as in the Table 1, our above expectation matches with the solutions obtained and be seen Table 7.

Table 7 Effects of \(\psi \) on \(\delta ^+ (0,\nu _0;q)\)
5.1.2.4 Effects of k

This is the mean reversion adjustment rate on the volatility of the model. A large value of k means that the volatility will revert to the average mean faster which increases the optimal spreads for \(q>0\) and reduces them for \(q<0\).

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\partial \delta _t^+}{\partial k}>0, \quad \frac{\partial \delta _t^-}{\partial k}<0, &{} \quad q< 0, \\ \frac{\partial \delta _t^+}{\partial k}>0, \quad \frac{\partial \delta _t^-}{\partial k}>0, &{} \quad q = 0, \\ \frac{\partial \delta _t^+}{\partial k}<0, \quad \frac{\partial \delta _t^-}{\partial k}>0, &{} \quad q > 0. \end{array} \right. \end{aligned}$$
(35)

In our numerical observations, we take \(k\in \{1,2,3\}\) while we do not change the rest of the parameters in Table 1 and we observe our expectations in solutions which can be tracked by Table 8, in coherence with (35).

Table 8 Effects of k on \(\delta ^+ (0,\nu _0;q)\)

In the model, since k is just in multiplication with long-term variance parameter \(\theta \), the impact of \(\theta \) on the optimal quotes will have just the opposite effect of when k is employed.

5.1.2.5 Effects of \(\sigma \)

Concerning \(\sigma \), the dependence of optimal spreads is very obvious because a large variance causes an uncertainty and price risk. To reduce this risk and for the higher cost of the variations, the trader increases the prices of the orders. The following result is expected when dependency of \(\sigma \) is considered:

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\partial \delta _t^+}{\partial \sigma }>0, \quad \frac{\partial \delta _t^-}{\partial \sigma }<0, &{} \quad q< 0, \\ \frac{\partial \delta _t^+}{\partial \sigma }<0, \quad \frac{\partial \delta _t^-}{\partial \sigma }>0, &{} \quad q > 0. \end{array} \right. \end{aligned}$$
(36)

In our numerical simulations, we take \(\sigma \) as \(\sigma \in \{0.1,0.3,0.5\}\) while keeping the other parameters same as in the Table 1 and we see that our expectation on changing \(\sigma \) values is met as shown in Table 9.

Table 9 Effects of \(\sigma \) on \(\delta ^+ (0,\nu _0;q)\)

5.1.3 Approaching terminal time strategy

It is worth mentioning that the trader changes her qualitative behavior depending on the liquidation and penalizing variations of the constants and her positions on inventories as the time approaches to maturity.

For the parameters \(\alpha =0\), \(\psi \in \{0,0.1\}\) when \(\epsilon ^\pm =\epsilon , \kappa ^\pm =\kappa \) and keeping the rest of the parameters same, we observe the following behavior for the optimal spreads:

$$\begin{aligned} \left\{ \begin{array}{ll} \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^+}{\partial t}>0, \quad \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^-}{\partial t}<0, &{} \quad q> 0, \\ \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^+}{\partial t}<0, \quad \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^-}{\partial t}>0, &{} \quad q \le 0. \end{array} \right. \end{aligned}$$

Figure  10 represents the behavior of the trader for \(\alpha =0, \psi =0\) when the strategy approaches to terminal time. In this case, since there is no penalizing parameters, it is easy to understand that the spreads converge to a specific value when \(t\rightarrow T\).

Fig. 10
figure 10

Optimal spreads \(\delta ^+\) and \(\delta ^-\) for \(\alpha =0, \psi =0\)

Remark 3

Note that when \(\alpha =0\), all the optimal spreads converge to the value of \(\frac{1}{\kappa ^\pm }+\epsilon ^\pm \) as \(u(t,\nu ;q)-u(t,\nu ;q\pm 1)\) tends to zero.

Now, we test the effect of the existing liquidation penalty parameter with the penalty of the variations on the optimal spreads. For being \(\alpha =0.1, \psi \in \{0,0.1\}\) when \(\epsilon ^\pm =\epsilon , \kappa ^\pm =\kappa \) having same values of the other parameters, the following observation can be tested:

$$\begin{aligned} \left\{ \begin{array}{ll} \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^+}{\partial t}<0, \quad \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^-}{\partial t}>0, &{} \quad q> 0, \\ \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^+}{\partial t}>0, \quad \lim \limits _{t\rightarrow T}\frac{\partial \delta _t^-}{\partial t}<0, &{} \quad q < 0. \end{array} \right. \end{aligned}$$
(37)

Figure 11 highlights how the trader behaves when there is liquidation and variations penalty factor with of \(\alpha =0.1\) and \(\psi =0.1\) while the strategy approaches to the terminal time. In this case, the trader should be more cautious since she may have to pay for the liquidating and running variations if she still has the assets at maturity time. Therefore, she increases the optimal sell spreads when \(q<0\) to cover these costs; on the other hand, she reduces the spreads as she is not willing to pay the costs when she has enough assets at hand. It is noticed that the model is efficient as the trader can pay for the liquidation cost until to \(\alpha =0.1\) parameter value without any difficulty.

Fig. 11
figure 11

Optimal spreads \(\delta ^+\) and \(\delta ^-\) for \(\alpha =0.1, \psi =0.1\)

5.2 Results with the exponential utility function

In this part, the experiment is constructed to discuss the results for \(\delta ^+ (0,\nu _0;q)\) depending of different risk aversion degrees \(\gamma \) in the set of values \(\{0.0001,0.001,0.01\}\) with the same parameters given in Table 1.

The parameter \(\gamma \) shows the risk-averse degree of the investor. When \(\gamma \) increases, the risk-averse degree of the investor increases. Consequently, she will sell the assets with a lower price on the positive inventory levels to reduce both the price risk and liquidation risk. On the other hand, she does not face with the liquidation risk on the negative inventory levels but wants to receive higher amount for selling the assets.

Table 10 displays the results for the performance of the strategy with a liquidation parameter \(\alpha =0.01\). Thereby, we observe the following behavior of the investor:

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\partial \delta _t^+}{\partial \gamma }>0, \quad \frac{\partial \delta _t^-}{\partial \gamma }<0, &{} \quad q \le 0, \\ \frac{\partial \delta _t^+}{\partial \gamma }<0, \quad \frac{\partial \delta _t^-}{\partial \gamma }>0, &{} \quad q > 0. \end{array} \right. \end{aligned}$$
(38)

By the numerical experiments, we can conclude that the above behavior of the optimal spreads with different values of \(\gamma \) is observed in Table 10.

Table 10 Effects of \(\gamma \) on \(\delta ^+ (0,\nu _0;q)\)

5.3 Results of the model with jumps in volatility

Numerical experiments for this case are carried out by linear interpolation and extrapolation in order to calculate the value functions \(u(t,\nu +\epsilon ^+;q)\) and \(u(t,\nu -\epsilon ^-;q)\). In order to recall the models easier, we call the model studied in in Case 1 in Sect. 3 with stock price dynamics (1) as “Model 1” and the model with the dynamics (26) “Model 2”.

Figure 12 illustrates \(\delta ^+ (t,\nu _0;0)\) and \(\delta ^- (t,\nu _0;0)\) values for Model 1 and Model 2. It is observed that the Model 1 which has jumps in stocks has a slightly wider \(\delta ^+\) values. We note that bid-ask spread for Model 1 is 1.0402 while it is 1.0328 for Model 2 given the other parameters in Table 1.

Fig. 12
figure 12

Comparison of Model 1 and Model 2

Table 11 which is obtained from all simulations depicts the results of these two strategies. We can see that when the jumps occur in volatility, it causes not only larger profits but also larger standard deviation of the profit and loss function.

Table 11 Comparison of the strategies Model 1 and Model 2

5.4 Comparison with existing models

In this section, we compare the existing optimal market making models based on the stock price impacts with the models that we introduce in the previous sections. Numerical experiments are carried out on two different types of utility functions, i.e., quadratic and exponential utility functions.

We give the results for the value function

$$\begin{aligned} W(t,x,S,\nu ;q)=\sup _{(\delta _s^{\pm })_{t\le s \le T}\in \mathcal {A}_t}\mathbb {E}\left( X_T+q_T(S_T-\alpha q_T)-\psi \sigma ^2\mathbb {E}\left[ \int _{t}^{T}q_s^2\nu _s ds |\, \mathcal {F}_t\right] \right) , \end{aligned}$$

and for the stock price dynamics which are provided in each model definition.

In this part, we operate the simulations under the quadratic utility function for all introduced models here for the comparison purposes, although they have been defined with different utility criteria and solved under the different settings in their original papers.

Model a::

The model with the stock price dynamics \(dS_t=\sigma dB_t\) which is introduced by Avellaneda and Stoikov (2008).

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\psi =0.1\), and \(\sigma =0.1\).

Model b::

The model with the stock price dynamics \(dS_t=\sigma dB_t+\varepsilon ^+dM_t-\varepsilon ^+dM_t\) that is handled in Cartea and Jaimungal (2015).

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\epsilon ^\pm =0.004\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\psi =0.1\), and \(\sigma =0.1\).

Model c::

This is governed by

$$\begin{aligned} dS_t&=\mu dt+\sqrt{\nu _t} dB_t^1+\varepsilon ^+ dM_t^+ - \varepsilon ^- dM_t^-, \\ d\nu _t&=k(\theta -\nu _t)dt+\sigma \sqrt{\nu _t}dB_t^2, \\ dB_t^1 dB_t^2&=\rho dt. \end{aligned}$$

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\epsilon ^\pm =0.004\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\psi =0.1\), \(\sigma =0.01\), \(\mu =0.01\), \(k=1\), \(\theta =1\), and \(\rho =-0.8\).

Model d::

This is governed by

$$\begin{aligned} dS_t&=\mu dt+\sqrt{\nu _t} dB_t^1, \\ d\nu _t&=k(\theta -\nu _t)dt+\sigma \sqrt{\nu _t}dB_t^2 +\varepsilon ^+ dM_t^+ - \varepsilon ^- dM_t^-, \\ dB_t^1 dB_t^2&=\rho dt. \end{aligned}$$

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\epsilon ^\pm =0.004\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\psi =0.1\), \(\sigma =0.01\), \(\mu =0.01\), \(k=1\), \(\theta =1\), and \(\rho =-0.8\).

Table 12 obtained from all simulations illustrates that the traders using the Model c have relatively higher return but also relatively a higher standard deviation comparing to other models. The performances of Sharpe ratios of each models indicates that the stock price models with stochastic volatility based on a quadratic utility function produces more attractive portfolios than the other models. It is demonstrated that the Model d has a Gaussian normal distribution while the others are positively skewed.

Table 12 Statistical comparison for PnL and inventory under the quadratic utility function

The next experiment is carried out for the value function

$$\begin{aligned} W(t,x,S,\nu ;q)=\sup _{(\delta _s^{\pm })_{t\le s \le T}\in \mathcal {A}_t}\mathbb {E}\left[ -e^{-\gamma (X_T+q_T (S_T-\alpha q_T))}\right] , \end{aligned}$$

using the exponential utility function and the results are provided for the following models.

Model A::

The model with the stock price dynamics \(dS_t=\sigma dB_t\) that is introduced by Avellaneda and Stoikov (2008) and handled by quadratic approximation approach..

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\gamma =0.01\), and \(\sigma =0.1\).

Model B::

The model with the stock price dynamics \(dS_t=\sigma dB_t+\varepsilon ^+dM_t-\varepsilon ^+dM_t\) that is introduced with quadratic utility function and solved by providing a closed-form solution.

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\epsilon ^\pm =0.004\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\gamma =0.01\), and \(\sigma =0.1\).

Model C::

The model is governed by

$$\begin{aligned} dS_t&=\mu dt+\sqrt{\nu _t} dB_t^1+\varepsilon ^+ dM_t^+ - \varepsilon ^- dM_t^-, \\ d\nu _t&=k(\theta -\nu _t)dt+\sigma \sqrt{\nu _t}dB_t^2, \\ dB_t^1 dB_t^2&=\rho dt. \end{aligned}$$

The parameters are \(T=10\), \(q\in [-5,5]\), \(\lambda ^\pm =2\), \(\epsilon ^\pm =0.004\), \(\alpha =0.01\), \(\kappa ^\pm =2\), \(\gamma =0.01\), \(\sigma =0.01\), \(\mu =0.01\), \(k=1\), \(\theta =1\), and \(\rho =-0.8\).

Table 13 which is achieved from all simulations demonstrates that the Model C which is the stock price modeling with stochastic volatility, has relatively larger expected return, but also a relatively larger standard deviation. Meanwhile, the other stock price modelings in Table 13 produce higher Sharpe ratios.

Table 13 Statistical comparison for PnL and inventory under the exponential utility function

6 Conclusion

In this paper, we investigated the high-frequency trading strategies for a market maker using a mean-reverting stochastic volatility models that involve the influence of both arrival and filled market orders of the underlying asset. First, we design a model with variable utilities where the effects of the jumps corresponding to the orders are introduced in returns of the asset and generate optimal bid and ask prices for trading. Then, we develop another, but novel, approach considering an underlying asset model with jumps in stochastic volatility. Such an extension allows one to fit the implied volatility smile better in practice.

In order to analyze the experimental results, we work on the models that we have derived using different metrics. It is salient to mention that the market maker modifies her qualitative behavior in various situations, i.e., changing inventory levels, utility functions. By our numerical results, we deduce that the jump effects and comparative statistics metrics provide us with the information for the traders to gain expected profits. For instance, the model given by (1) has a considerable Sharpe ratio and inventory management with a lower standard deviation comparing to the symmetric strategy. Besides, we further quantify the effects of a variety of parameters in models on the bid and ask spreads and observe that the trader follows different strategies on positive and negative inventory levels, separately. The strategy derived by the model (1), for instance, illustrates that when time is approaching to the terminal horizon, the optimal spreads converge to a fixed, constant value. Furthermore, in case of the jumps in volatility, it is observed that a higher profit can be obtained but with a larger standard deviation.

Consequently, we support our findings by comparing the models proposed within this research with the stock price impact models existing in literature. Last but not least, we have substantially improved the performances of a market maker with the proposed models.