A Trading Execution Model Based on Mean Field Games and Optimal Control

We present a trading execution model that describes the behaviour of a big trader and of a multitude of retail traders operating on the shares of a risky asset. The retail traders are modeled as a population of “conservative” investors that: 1) behave in a similar way, 2) try to avoid abrupt changes in their trading strategies, 3) want to limit the risk due to the fact of having open positions on the asset shares, 4) in the long run want to have a given position on the asset shares. The big trader wants to maximize the revenue resulting from the action of buying or selling a (large) block of asset shares in a given time interval. The behaviour of the retail traders and of the big trader is modeled using respectively a mean field game model and an optimal control problem. These models are coupled by the asset share price dynamic equation. The trading execution strategy adopted by the retail traders is obtained solving the mean field game model. This strategy is used to formulate the optimal control problem that determines the behaviour of the big trader. The previous mathematical models are solved using the dynamic programming principle. In some special cases explicit solutions of the previous models are found. An extensive numerical study of the trading execution model proposed is presented. The interested reader is referred to the website: http://www.econ.univpm.it/recchioni/finance/w19 to find material including animations, an interactive application and an app that helps the understanding of the paper. A general reference to the work of the authors and of their coauthors in mathematical finance is the website: http://www.econ.univpm.it/recchioni/finance.


Introduction
In recent years technology innovation, deregulation policies and ubiquitous availability of Internet connections have determined the emergence of new forms of trading in the financial markets.These forms of trading give the possibility to the investor of operating in the market without the help of traditional brokers and offer the opportunity of using huge data sets and sophisticated mathematical models to support investment decisions.Automated trading tools, sometimes called algorithmic trading tools, have been developed to support the investors in their decision process and to execute their orders.We restrict our attention to the algorithmic trading tools used to determine trading execution strategies.Algorithmic trading tools are available even to retail investors, however the interest in finding how to execute orders involving large blocks of shares is limited to institutional investors, such as banks, insurance companies, mutual funds, and to very wealthy individuals.We refer to these investors as big traders and to their orders as large orders.The execution of large orders influences market prices, while the execution of the orders of a retail trader does not affect market prices.This is due to the limited size of these orders.The retail traders influence market prices only through their collective behaviour.Ad hoc algorithmic trading tools have been developed to determine the trading execution strategies of large orders.In this paper we present a mathematical model that can be used to build one of these tools.
Many authors have addressed the problem of modeling the behaviour of a big trader and of the asset share price during the execution of a large order.Usually it is assumed that the trading execution strategies of large orders satisfy the following conditions: 1) maximization of the revenue resulting from the order execution (or minimization of the trading cost), 2) minimization of the risk deriving from possible delays in the order execution.These two goals can be conflicting and in many circumstances it is necessary to find a compromise between them.Usually the models developed to determine the execution strategies of large orders do not consider explicitly the presence in the market of retail traders.The only trading activity studied in these models is the trading activity of the big trader.In fact the models synthesize the behaviour of the market (including the behaviour of the retail traders) in the asset share price dynamic equation.This last equation describes the "asset share price in absence of trading" and the effect on the asset share price of the trading activity of the big trader.The expression "asset share price in absence of trading" sounds strange, however it is of common use and means: the asset share price determined by the trading activity that is not studied explicitly in the model.Let us discuss briefly the scientific literature on this subject.
In 1998 Bertsimas and Lo [1] presented a discrete time trading model describing a trader that must buy a block of asset shares in an assigned time interval minimizing the expected value of the trading cost.The asset share price is modeled as a discrete arithmetic random walk that depends linearly from the number of asset shares bought/sold by the trader.This linear term models the permanent market impact on the asset share price of the trading activity of the big trader.In [1] the problem of determining the order optimal trading execution strategy is modeled as a dynamic optimization problem.
In 2000 Almgren and Chriss [2] introduced a discrete time trading model and considered the situation where a trader must liquidate an initial holding of an asset in an assigned time interval.The trading cost is defined as the difference between the value of the initial holding at the time when the order execution begins and the final revenue for the trader at the end of the order execution.In [2] it is assumed that the trader acts minimizing the expected value of the trading cost subject to a constraint on the variance of the trading cost.Moreover it is assumed that the dynamics of the asset share price depends on the number of shares sold by the trader.In fact the dynamics of the asset share price is modeled as a discrete arithmetic random walk that depends linearly from the average trading rate of the trader.This linear term represents the instantaneous market impact of the trading activity of the big trader on the asset share price.The optimal trading execution strategy of the trader is the solution of a mean variance optimization problem.In [3] Almgren has extended the results presented in [2] to the continuous time case and has modeled the instantaneous market impact of the trading activity of the big trader on the asset share price as a nonlinear function of the trading rate.Moreover in [3] the asset share price dynamics is modeled as an arithmetic random walk whose variance depends from the trading rate.In some special cases explicit formulae for the resulting optimal trading execution strategies are found.In [4] a stochastic version of the problem studied in [3] is considered.
Gatheral and Schied [5] modified the model discussed in [4] considering as cost functional of the control problem studied the expected value of the sum of the trading cost and of a time averaged "value at risk" associated to the trading execution strategy.The robustness of the model presented in [5] is established in [6].
In [7] Ankirchner, Blanchet Scalliet and Eyraud Loisel proposed a variant of the stochastic trading execution model studied in [4] and [5].They assumed that the Brownian motion that describes the asset share price dynamics in absence of trading has a non zero drift and that the trading rate of the big trader is a square integrable stochastic process.The drift term of the asset share price dynamics can be interpreted as the directional view of the trader about the asset share price (i.e. the bullish or bearish attitude of the trader about the asset share price).This drift term is assumed to be a linear function of the asset share price.The optimal trading execution strategy solution of the model proposed in [7] is a Gaussian process that becomes a deterministic function of time when the drift term of the asset share price dynamics is constant.
In the papers mentioned above (with the exception of [1]) given the order of buying or selling a certain number of asset shares in an assigned time interval the problem of determining the corresponding optimal trading execution strategy is reduced to a dynamic optimization problem or to an optimal control problem.The control variable of these problems is the trading rate of order execution.Sometimes the trading rate is called rhythm of the order execution.In the previous models the optimal trading rate is determined without considering explicitly the transactions volume on the asset shares during the order execution.However it is easily understood that in the reality of the financial markets the impact of a trade on the asset share price depends from the transactions volume on the asset share during the trade.Guéant in [8] is the first author that considers the dependence of the optimal trading rate from the transactions volume.He assumes that the trading rate of the trader is proportional to the transactions volume and that the transactions volume is a continuous deterministic function of time.In this case the control variable of the model is the proportionality factor between the trading rate of the trader and the transactions volume on the asset share (i.e. the fraction of the transactions volume generated by the trader) as a function of time.This proportionality factor is called participation rate of the trader to the (asset shares) market.The model studied in [8] considers as utility function the expected value of the Constant Absolute Risk Aversion (CARA) function.The CARA function is the exponential of the final revenue minus the final cost of the trade.Finally in [9] Guéant introduces a model that can substitute Almgren's model [3].In this model the trading execution strategy is a Poisson process whose intensity depends from the transactions volume.
In this paper we study a market consisting of one traded asset where a multitude of retail traders and a big trader operate.The big trader executes large orders.The retail traders are investors that belong to a population of individuals having the following features: aversion to the risk of holding open positions on the asset shares, desire to behave like the other retail traders, desire to avoid abrupt changes in trading strategies and desire to have in the long run a given position on the asset shares.The trading position of a retail trader is the number of asset shares held by the retail trader.The behaviour of a retail trader on the market is described by its trading position as a function of time.We assume that only the trading position of the entire population of the retail traders contributes with its mean value to determine the asset share price.This is due to the fact that individually the retail traders execute orders of limited size that do not influence the asset share price.We adopt a mean field game model to describe the behaviour of the retail traders.That is the (time) dynamics of the individual trading positions of the retail traders is substituted with a "mean dynamics" satisfied by the trading position of a "mean retail trader".This "mean dynamics" is defined by the mean field equation of the mathematical model of the dynamics of the individual trading positions of the retail traders.In this way the problem of modeling the behaviour of the retail traders is greatly simplified.In fact instead of a multitude of equations necessary to describe the trading positions of the retail traders individually in the mean field game model we use only one "mean field equation" that describes the trading position of the "mean retail trader".That is the behaviour of the retail traders is described using a mean field game model.The mean field game models have been introduced by Lasry and Lions in [10].These models have been used in many contexts to study populations of interacting rational agents.For example pedestrian crowds [11], exhaustible resources productions [12], technical innovation processes [13] and supply demand equilibrium prices of assets [14] or of commodities [15] have been studied using mean field game models.A wide review of problems that can be approached using this type of models is contained in [16].The mean field game model that describes the behaviour of the retail traders uses as control variable the trading rate of the retail traders (in the "mean field" approximation).The utility function of this model is the sum of four terms.The first term expresses the fact that the retail traders want to adopt similar strategies and depends from the probability distribution of the trading position of the retail traders (in the "mean field" approximation).The second term expresses the fact that the retail traders try to avoid abrupt changes of their trading strategies and depends from the trading rate of the retail traders (in the "mean field" approximation).The third term expresses the fact that the retail traders try to avoid the risk associated to the fact of having open positions on the asset shares and depends from the number of asset shares held by the retail traders as a function of time (in the "mean field" approximation).The fourth term expresses the fact that in the long run the retail traders want to have a given position on the asset shares and depends from the number of asset shares held by the retail traders at the final time of the game (in the "mean field" approximation).The stochastic differential equation that defines the dynamics of the trading position of the retail traders (in the "mean field" approximation) and its initial condition are the constraints of the mean field game model studied.To simplify the exposition from now on instead of specifying retail traders in the "mean field approximation" we will simply say retail traders without specification.The mean field game model that describes the behaviour of the retail traders is studied using the dynamic programming principle.The first order necessary optimality condition of this model is a system of partial differential equations made of the Hamilton Jacobi Bellman equation satisfied by the value function of the mean field game and of the forward Kolmogorov equation satisfied by the probability density function of the trading position of the retail traders.The condition that establishes the relation between the optimal trading rate and the value function of the game couples these two partial differential equations.This system of partial differential equations is equipped with an initial and a final condition.The solution of this problem determines the optimal trading execution strategy of the retail traders.Under some assumptions, following Kalman [17] it is possible to reduce the problem of solving the system of partial differential equations mentioned above to the problem of solving a constrained two point boundary value problem for a system of six Riccati ordinary differential equations.Explicit and numerical solutions of this constrained two point boundary value problem are studied.
Let us turn our attention to the behaviour of the big trader.To fix the ideas we study the liquidation problem, that is the problem of executing the order of selling a (large) number of asset shares in a prescribed time interval.It is easy to see how to rephrase the solution of the liquidation problem presented later to consider the problem of buying a (large) number of shares in a prescribed time interval.The goal pursued by the big trader is to sell a given block of asset shares in the time interval assigned maximizing the expected value of the revenue resulting from the sale.The big trader pursues this goal choosing its trading rate as a function of time.That is the trading rate is the control variable of the optimal control problem that describes the behaviour of the big trader.At any given time the instantaneous revenue of the sale is the product of the asset share price times the number of shares sold at that time.The revenue of the sale is the integral in time of the instantaneous revenue over the time interval assigned to execute the trade.As already said the asset share price is described by the asset share price dynamic equation.Let us discuss briefly this last equation.This equation couples the mathematical models that describe the retail traders and the big trader.In absence of trading the asset share price dynamics is assumed to be an arithmetic Brownian motion.The trading activity generated by the retail traders and/or by the big trader influences the asset share price.For example as expected when the big trader and the "majority" of the retail traders are buyers the asset share price tends to increase, conversely when the big trader and the "majority" of the retail traders are sellers the asset share price tends to decrease.Mathematically these intuitive facts are modeled with a simple generalization of the asset share price dynamic equation introduced by Almgren in [3].We assume that the asset share price is the sum of four terms, that is: the asset share price in absence of trading, the instantaneous impact factor of the trading activity of the retail traders, the instantaneous impact factor of the trading activity of the big trader and the permanent impact factor of the trading activity of the big trader.The instantaneous impact factor of the trading activity of the retail traders is assumed to be proportional to the expected value of their trading execution rate.This last term is not present in the asset share price dynamic equation used in [3].The remaining three terms of the asset share price dynamic equation of our model are already present in the asset price equation used in [3].Note that the assumption that the asset share price depends from the trading execution strategy of the retail traders and the choice made of the big trader objective function imply that the behaviour of the big trader depends from the behaviour of the retail traders.That is in order to find the optimal trading execution strategy of the big trader it is necessary first to solve the mean field game model associated to the retail traders to determine their optimal trading execution strategy.In our model the dependence of the behaviour of the retail traders from the trading activity of the big trader is not considered.In fact it is reasonable to assume that in many circumstances the retail traders are not aware of the trading activity of the big trader.The problem of determining the optimal trading execution strategy of the big trader is translated in a linear quadratic optimal control problem whose control variable is the trading rate of the big trader and whose utility function is the final revenue of the trade.The solution of the Hamilton Jacobi Bellman equation associated to this optimal control problem is reduced [17] to the solution of a system of Riccati ordinary differential equations with a final condition.Under some hypotheses an explicit formula for the optimal trading execution strategy of the big trader is derived.Finally we present an extensive numerical study of the trading execution model developed.This numerical study shows several interesting facts.In particular the study shows that the mean field game model considered provides a setting where different kinds of retail traders can be represented.For example we show that retail traders classified in the jargon of the financial markets as "buy and hold investors" or as "short term investors" can be represented in the model.For the convenience of the reader let us recall the meaning of these expressions.The buy and hold investors are investors that buy and then hold the asset bought for a long time period betting on the increment of the asset value due to its fundamentals.These investors do not like to change their positions in the market regardless of the market fluctuations.Conversely the short term investors are investors that open and close their positions within a relatively short time period to exploit movements of the asset share price.The short term investors do not like the risk associated to the fact of having open positions on the asset shares.Their different behaviours determine different effects on the asset share price dynamics.It follows that the optimal trading execution strategy of the big trader changes as a consequence of the fact that the retail traders are buy and hold investors or are short term investors.Several numerical examples are studied in detail to show the versatility of the model presented.
The interested reader is referred to the website: http://www.econ.univpm.it/recchioni/finance/w19 to find material including animations, an interactive application and an app that helps the understanding of the paper.A general reference to the work of the authors and of their coauthors in mathematical finance is the website: http://www.econ.univpm.it/recchioni/finance.
The paper is organized as follows.In Section 2 we define the trading execution model studied, that is we define the mean field game model associated to the retail traders, the asset share price dynamic equation and the optimal control problem associated to the big trader.In Section 3 we solve the mean field game model.In Section 4 we solve the optimal control problem.In Section 5 we present a numerical study of the trading execution model developed in Sections 2, 3 and 4.

The Trading Execution Model
Let  be the set of real numbers, t be a real variable that denotes time and 1 T ∈  be a positive number.We assume that 1 T is the time horizon of the mean field game model that describes the behaviour of the retail traders.This means that the mean field game model is solved for .Recall that when we write retail traders we always mean retail traders in the "mean field approximation".We assume that the stochastic process t , satisfies the following stochastic differential equation: with initial condition: where [ ] , is a standard Wiener process such that 0 0 , is its stochastic differential.The initial condition 0 x  is a known random variable whose probability density function is denoted with  .The function α that appears in (1) is the trading rate of the retail traders and is the control variable of the mean field game model considered.Equation ( 1) is the "mean field equation" announced in the Introduction that defines the dynamics of the trading position of the "mean retail trader" that is used to describe the multitude of the retail traders in the "mean field approximation".

For
we denote with ( ) , m t x , x ∈  , the probability density function of the random variable t x solution of (1), (2).The function ( ) , satisfies the forward Kolmogorov equation associated to (1): with the initial condition implied by ( 2): Recall that in (3) the function α is not a known coefficient, α is the control variable that must be deter- mined as solution of the mean field game model.The fact that 0 m is a probability density function implies that the function m solution of ( 3), ( 4) is a probability density function as a function of denote the expected value of , ⋅ and 1  be the set of the square integrable processes on [ ] This means that the real stochastic process  if and only if ( ) , be the trading rate of Equation ( 1) we assume that 1 α ∈  .Given the real parameters 0 λ > , 0 θ ≥ and a ∈  we consider the following problem: ( ) subject to the constraints ( 1)-( 4).The model ( 5), ( 6), ( 1)-( 4) is the mean field game model used to describe the behaviour of the retail traders.This means that the retail traders adopt the trading execution strategy t , whose rate 5), ( 6), ( 1)-( 4).The parameter λ is called risk aversion parameter.Note that the constraints (3), ( 4) are consequences of the constraints (1), (2) and that they can be omitted when (1), (2) are imposed.However we prefer to mention (3), (4) explicitly in the statement of the previous problem in order to emphasize the role of ( ) (6).The functional ( ) called utility function or cost functional of the mean field game model and is the sum of four terms.The first one: expresses the fact that the retail traders want to behave in a similar way, the second one: expresses the fact that the retail traders try to avoid abrupt changes of their trading strategies, the third one: ( ) ( ) ( ) expresses the fact that in the long run (that is at time 1 t T = ) the retail traders want to have a given position on the asset shares (that is the position a ∈ ).The choice of the term ( ) , in (6) instead of a more general term such as, for example, ( ) ( ) a suitable (real valued) function, is essential in Sec- tion 3 to solve elementarily the mean field game model ( 5), ( 6), ( 1)-( 4) when ( ) 0 m x , x ∈  , is a Gaussian probability density function.Note that in the utility function ( ) Equations ( 1), (3).Now let us discuss the mathematical model that describes the behaviour of the big trader.Let 2 T ∈  be a positive number such that 2 1 T T ≤ and 0 Y > be a positive integer that represents the number of asset shares held by the big trader at time 0 t = .We consider the problem of determining the optimal trading execution strategy that implements the order of selling Y asset shares in the time interval [ ] 2 0,T .This order is called liquidation order since consists in the order of liquidating the position on the asset shares held by the big trader at time 0 , be the number of asset shares held by the big trader at time t , is solution of the following differential equation: with initial condition: and final condition: where in (7) [ ]   is a continuous function that represents the trading rate of the big trader.Note that the differential Equation (7), that describes the dynamics of the trading strategy of the big trader, is the equation used by Almgren [3] in similar circumstances.We assume that the initial value problem (7)  , solution of ( 7)-( 9) whose derivative ( ) 0, L T .We assume that ( ) is the set of the admissible trading execution strategies of the optimal control problem that defines the behaviour of the big trader.Let us define the utility function of the control problem that determines the behaviour of the big trader.This is done introducing the asset share price dynamic equation.
We use as asset share price dynamic equation a simple generalization of the equation introduced by Almgren in [3].Let t S be the asset share price at time t is a real stochastic process defined as follows: , 0, where T are considered it can be tolerated, see [3] [5].In fact in this case from the as- sumption 0 0 0 S > with probability one it follows that the probability of having negative prices in the time interval [ ] 2 0,T is small and can be made arbitrarily small taking 2 T small enough.The asset share price dy- namic equation of Almgren's model [3] is obtained from (10) choosing 1 0 η = and has the same undesired property of (10).The terms 1 t M η and 2 t η β represent respectively the instantaneous market impact at time t , of the trading activity of the retail traders and of the big trader.The term , of the trading activity of the big trader.The choice of the term , to model the effect on the asset share price of the trading activity of the retail traders reflects the assumptions stated in the Introduction.In fact in the Introduction we have assumed that individually the retail traders execute small orders that do not influence the asset share price, these orders influence the asset share price only through the expected value of their trading rates, that is through the term . Note that the expected value of the trading rate of the mean retail trader , can be imagined as being proportional to the expected value of the trading rate of the multitude of the retail traders.The situation is different for the big trader.The big trader executes large orders and the trading rate t , of a large order influences the asset share price directly.In (10) this influence is modeled through the terms 2 t η β and ( ) , be a trading execution strategy that satisfies ( 7)- (9).It is easy to see that when the big trader adopts the trading execution strategy , and the asset share price dynamics is described by (10), (11) the expected final revenue (i.e. the expected revenue at time 2 t T = ) for the big trader resulting from the sale of Y asset shares in the time interval [ ] 2 0,T is: Let us take a closer look to (12).Integrating ( 12) by parts and using (7) we have: ( ) Note that the assumption [ ] ( ) is well defined and finite.From (13) we have: The optimal trading execution strategy of the big trader is the strategy that maximizes the expected final revenue of the big trader ( 14) subject to the constraints ( 7)- (9).That is the problem of finding the optimal trading execution strategy of the big trader consists in solving the following optimal control problem: where: subject to the constraints ( 7)- (9).Note that in (16) we have dropped the term ( ) that appears in (14).In fact this term does not depend from the control variable β and can be dropped from the objective function ( 14) without changing the solution of the control problem considered.The optimal control problem ( 15), ( 16), ( 7)-( 9) is a linear quadratic optimal control problem.For later convenience note that the utility function , defined in (16) does not depend from 2 ζ and that the presence of 16) determines how the behaviour of the retail traders influences the behaviour of the big trader.
Therefore the optimal trading execution strategy of the retail traders can be determined solving the following system of partial differential equations, see [10]: where the function ( ) . This last condition couples the Equations ( 20), (21).The system (20), ( 21) with the condition u x is equipped with a final condition on u in 1 t T = and an initial condition on m in 0 t = that is: Equations ( 20), ( 21) with the conditions u x , (23) are a system of nonlinear partial differential equations with an initial and a final condition.This system expresses the first order necessary optimality condition of the mean field game model ( 5), ( 6), ( 1)-( 4).Once known the solution of this system of partial differential equations the optimal trading rate of the retail traders solution of problem ( 5), ( 6), ( 1)-( 4) is determined by the condition: We look for elementary solutions of problem (20), (21) with the conditions u x , (23).In analogy with the work of Kalman [17] we formulate some hypotheses that make possible to reduce the solution of problem (20), (21) with the conditions u x , (23) to the solution of a constrained two point boundary value problem for a system of six Riccati ordinary differential equations.The choice of the logarithm function in the first addendum of ( 6) and as a consequence the presence of the logarithm function on the right hand side of (20) are crucial to operate this reduction.Let X be a random variable and let ( ) , N ⋅  be the Gaussian probability distribution of mean ⋅ and stan- dard deviation  .The notation ( ) ψ > and let: ( ) ( ) i.e. let ( ) , ( 23) is given by: where the functions ( ) , are solution of the following two point boundary value problem: ( ) [ ] [ ] ( ) [ ] ( ) [ ] ( ) [ ] ( ) and satisfy condition (47).In fact, as shown later, in order to guarantee that ( ) , defined in (26) is a Gaussian probability density function it is necessary that the functions ( ) , satisfy condition (47).Note that (47) implies 0, < ) 47) is a constraint imposed to the solution of (28)-(39).The equations (28)-(39) are a system of six Riccati ordinary differential equations in six unknowns defined for equipped with three initial conditions in 0 t = and three final conditions in , , , where u is given by (25) and k is a function to be determined.We have: [ ] [ ] [ ] Substituting ( 40)-( 43) in (21) we have: In (44) we choose ( ) , where ( ) , are functions to be determined.It is easy to see that with the previous choices from ( 20) and (44) we have ( 28)-( 39) where Note that when m is given by ( 26) and ( ) , we have: Imposing that ( ) , from (45) it follows that: that is: Equation (47) implies that ( ) and guarantees that the function m given by ( 26) is a Gaussian probability density function in x for , (23) when 0 m is a Gaussian proba- bility density function.Proposition 3.1 shows that when (28)-(39) has a solution that satisfies (47) from the hypothesis ( ) it follows that the probability density function ( ) , ( 23) can be chosen as the Gaussian probability density function (26) with mean: and variance: that is in this case we have: ( ) , given by ( 48), (49).In this Section and in Section 4 we assume that the system (28)-(39) has a solution that satisfies (47).In Section 5 we discuss briefly the validity of this assumption and in some test cases we determine a solution of (28)-(39) that satisfies (47).In [18] Guéant studies the stationary version of problem (20), (21) with the conditions u x 23) and finds a solution given by the functions x ∈  , is a polynomial of degree two in x and ( ) m x , x ∈  , is a Gaussian probability density function.From (25) it follows that: is the solution of (1), (2) when α is given by (50).Therefore when (50) holds we have: and ( ) , be the solution of problem ( 20), ( 21) with the conditions u x , (23) determined in Proposition 3.1 that we assume to exist.We have ( ) , where: ( ) The functions
Moreover let , be the expected value of the optimal trading execution rate of the retail traders, defined in (51), we have: [ ] Proof Differentiating (48) with respect to t we have: [ ] from (55) it follows that: [ ]  35), (39), ( 55), (56) imply that Equation (57) can be equipped with the following boundary conditions: ( ) It is easy to see that the function ( 52) is the solution of ( 57)-(59).Finally substituting (52) in (56) we determine , as solution of the first order ordinary differential Equation (56) with the final condition ( ) that follows from (58), ( 59).An elementary computation shows that the function ( 54) is the solution of (56) that satisfies this last final condition.Formula (54) shows that , depends from 0 µ but does not depend from σ .Note that when 0 , so that from ( ) we have: ( ) moreover from ( 57)-( 59) when 0 λ = we have: ( ) . That is when 0 , is constant, and t

The Optimal Trading Execution Strategy of the Big Trader
Let us consider the optimal control problems ( 15), ( 16), ( 7)-( 9).The value function ( ) of problems ( 15), ( 16), ( 7)-( 9) is the maximum of the objective function subject to the constraint ( 7), ( 9) and: Note that we have: The function ), , ( is the solution of the following Hamilton Jacobi Bellman equation: , , , 0, , 0, with the final condition: is the Hamiltonian function of problem ( 15), ( 16), ( 7)- (9).Note that the right hand side of (64) is not a real valued function.The final condition (64) must be interpreted as prescribing the ( ) a trading rate that does not satisfy (9), is a rate that at time 2 t T = has not achieved the goal of liquidating in the time interval [ ] 2 0,T the position of Y asset shares held by the big trader at time 0 t = .To this rate the final conditions (64) attributes an infinite cost, or equivalently attributes a revenue equal to minus infinity.In this sense the final condition (64) translates to the value function v the condition (9) imposed to the trading execution strategy , . Therefore in order to find the optimal trading execution strategy of the big trader we must solve the following Hamilton Jacobi Bellman equation: with final condition (64), where , is given by (54).In fact from the knowledge of the value function v solution of ( 65), (64) we can determine the optimal control t , solution of( 15), ( 16), ( 7)-( 9), using the relation: , solution of ( 7)-( 9).
We have: , and , be given respectively by ( 52) and ( 54), the value function solution of problem ( 65), (64) can be chosen as: , , , 0, v t y a t b t y c t y where ( ) a t , ( ) b t , ( ) , are given by: , 0, This means that the optimal trading execution rate of the big trader is: where in (70 , is the solution of ( 7)-( 9) when in (7) , is given by (70).Proof Let ( ) , be given by (66), we impose that ( ) (65), (64).It follows that the coefficients ( ) a t , ( ) b t , ( ) , that define the function v through (66), must satisfy the system of ordinary differential equations and the final conditions that follow: ( ) [ ] ( ) , is given by (54).The final conditions contained in (76) must be interpreted as prescribing ( ) . It is easy to see that the functions (67)-( 69) satisfy ( 71)-( 76).
Moreover the optimal trading execution rate of the big trader is given by: ( ) ( ) That is we have Equation (70).Substituting (70) in (7) and imposing (8) we determine the optimal trading execution strategy of the big trader t , as solution of the following differential equation: with initial condition: Note that the fact that ˆt  9) is a consequence of the choice of β made, that is of the choice , given by (70).

Numerical Experiments
We begin the numerical study of the trading execution model presented in the previous Sections discussing the problem of the existence of solutions of the mean field game problem ( 5), ( 6), ( 1)-( 4) of the form suggested in Propositions 3.1, 3.2.The existence of this kind of solutions is equivalent to the assumption that the two point boundary value problem (28)-(39) has a solution that satisfies (47).It is easy to see that the existence of a solution of the two point boundary value problem (28)-(39) that satisfies (47) depends from the existence of a solution of the two point boundary value problem (32), (33), (38), (39) such that ( ) . In fact when the two point boundary value problem (32), (33), (38), (39) has a solution ( ) 52), (54) it follows that we can find: ( ) ( ) , using Equation (51), ( 52), ( using Equation (47) and finally ( ) 0 c t , using Equations (28), (29).Conversely when the two point boundary value problem (32), (33), (38), (39) does not have a solution, such that ( ) , the solution of (20), (21) with the conditions u x (23) constructed in Propositions 3.1, 3.2 does not exist.The study of the existence problem of the solution of the two point boundary value problem (32), (33), ( 38), (39) from the mathematical point of view is beyond our purposes here.In the numerical experiments presented in this Section we proceed as follows: first of all the two point boundary value problem (32), (33), (38), (39) is solved numerically using the shooting method (see [19]) and the condition 0, < ) When this is done successfully from the solution of (32), (33), (38), (39) that satisfies ( ) , found numerically we determine the solution of (28)-( 31), (34)-(37).Let us study the trading execution model developed in Sections 2, 3 and 4. We present four study cases.In these study cases we use a generalized version of the mean field game problem (5), ( 6), ( 1)-( 4) where the utility function defined in ( 6) is substituted with a new utility function that depends from some new parameters.Let us explain in detail the choices made.We recall that the utility function defined in (6) is the sum of the following terms: As already explained in Sections 2 and 3 the second and the third term in different ways express the fact that the retail traders are risk adverse.Maximizing (6) the retail traders pursue three goals.The first one is the desire of adopting similar strategies (i.e. the desire of the retail traders of not being alone in the market).This goal is pursued making big the term x a θ − −  are weighted in a predetermined way.However to show the versatility of the model developed in the previous Sections in the study cases presented in this Section it is convenient to introduce a new utility function containing two parameters not present in (6), that is: the parameter w that regulates the relative weights of the terms ( ) ( ) ( ) and the parameter ξ that regulates the relative weights of the terms ( ) That is in this Section we consider the utility function: ( instead of the utility function , U λ θ defined in (6).Note that in (80) we choose , w ξ ∈ , and that the parameter 2 θ of (8) replaces the parameter θ of (6).For simplicity in (80) we exclude the choices 0 w = and/or 0 ξ = from the possible choices of the parameter values.In fact when in (80) we have 0 w = and/or 0 ξ = the resulting mean field game problem is degenerate.That is the choices 0 w = and/or 0 ξ = in (80) correspond to a problem with a non convex Hamiltonian, that is correspond to a degenerate problem.For simplicity we avoid degenerate problems.Note that ( ) ( ) is the utility function (6) with 0.5 λ = When the utility function ( 6) is substituted with the utility function (80) and instead of the problem studied in Section 3 we consider the problem of maximizing (80) subject to the constraints ( 1)-( 4) some obvious changes must be made to the statement of Proposition 3.1, to the optimal trading execution rate (50) and to the results derived in Proposition 3.2.However it is easy to see that the analysis of the problem of maximizing (6) subject to the constraints (1)-( 4) carried out in Section 3 can be extended to the problem of maximizing (80) subject to the constraints (1)-(4).To keep the exposition simple we leave to the reader the effort of working out these details.
Let us point out that the aversion to abrupt position changes and the possession of stable positions in the asset shares are typical habits of the so called buy and hold investors.Instead the so called short term investors do not like to have stable positions in the asset shares.This last kind of investors open and close their positions within a relatively short time period to exploit short term movements of the asset share price.Based on these facts we argue that the utility function (80) when ξ is close to one describes buy and hold investors while when ξ is close to zero describes short term investors.Moreover it is easy to see that the parameter ( ] 0,1 w ∈ measures the desire of the retail traders of behaving in a similar way.This desire decreases when w increases.
In the study cases that follow we consider the solution of the problem: , , w U ξ θ is given by (80) subject to the constraints (1)-( 4) when w , ( ] θ ≥ , a ∈  , and we study how the solution of the previous problem influences the trading execution strategy adopted by the big trader to implement the liquidation order. In the first study case we analyze the behaviour of the retail traders and we choose ξ ∈ we consider the optimal trading execution strategy of the retail traders solution of problems (80), ( 81), ( 1)-( 4) determined with the technique presented in Section 3. The optimal trading execution strategy solution of the previous mean field game problem can be defined through the Gaussian probability density function ( ) , of the trading position of the retail traders t . Moreover from the knowledge of ( ) , we can deduce the expected value of the optimal trading execution rate of the retail traders , given by (54).Using the notation of Section 3 we have: ( ) , depends from w and ξ while t µ and , depend from ξ but are independent of w .Given the choice of the parameter values stated above Figure 1, Figure 2 show the functions t µ ,  .In particular Figure 3, Figure 4 show that when ( ] , increases, that is when ( ] 0,1 w ∈ increases the retail traders adopt more diversified trading positions in the asset shares market.This is coherent with the understanding that increasing w decreases the desire of the retail traders of having similar strategies. In the second, third and fourth study cases we study the behaviour of the big trader during the execution of a liquidation order, that is we consider the solution of the optimal control problem (15), ( 16), ( 7)- (9).In particular we study the dependence of the behaviour of the big trader from the behaviour of the retail traders determined solving problem (81), (80), ( 1)-( 4).In the study cases presented we assume that the number of asset shares held by the big trader at time 0 t = is 2 Y = and that the final time within which the sale of the Y asset shares must be completed is 2 0.5 T = .Recall that the time horizon of the mean field game problem that describes the retail traders is chosen as 1 1 T = .We choose 1 10 η = , 2 1 η = in (16).Recall that (16) does not depend from 2 ζ .
We solve the differential Equation ( 7) with the initial condition (8).Recall that in (7)   that corresponds to the trading rate: Note that when , defined in (82) satisfies (9), that is we have 2 2

ˆ0
T T y y = = .Moreover when 1 0 η = that is when the behaviour of the retail traders does not contribute to the asset share price equation, the optimal trading execution strategy of the big trader resulting from (82), (83) is: ( ) . This strategy corresponds to the sale of the Y asset shares held at time 0 t = with constant trading rate , during the time interval [ ] 2 0,T .That is the strategy determined using the model developed in the previous Sections when 1 0 η = coincides with the optimal trading execution strategy of a risk neutral trader found by Almgren in [2].It is easy to see that the instantaneous market impact of the trading activity of the retail traders introduced in Equation ( 10 are "sellers" of the asset shares.Recall that when 1 0 η ≠ the trading activity of the retail traders influences the asset share price dynamics through the term 1 t M η of the asset share price equation and, as a consequence, influences the optimal trading execution strategy of the big trader. In the second study case we choose   80), ( 1)-( 4) corresponds to the solution of problems ( 5), ( 6), ( 1)-(4) with 0.5 λ = Recall that we have chosen 1 10 η = .Figure 5 shows the optimal trading execution strategy of the big trader resulting from the formulae presented in Section 4 for .In this case we obtain as optimal trading execution strategy of the big trader the optimal trading execution strategy of the risk neutral trader found by Almgren in [2] (i.e.selling with constant rate, this is the straight line segment shown in Figure 5).When 0 θ = and 0 0 µ > we have 0 , that is the "majority" of the retail traders have long positions on the asset shares and d 0 d t M t ≥ that is the "majority" of the retail traders are buyers of the asset shares in the time [ ] 2 0, t T ∈ can be negative.That is the big trader can use short selling to maximize the revenue resulting from the execution of the liquidation order.Moreover Figure 6, Figure 7 show the optimal trading execution strategy of the big trader when the absolute value of 0 µ increases.Figure 6, Figure 7 show that when the absolute value of 0 µ increases the influence of the behaviour of the retail traders on the asset share price dynamics increases and as a consequence the influence of the behaviour of the retail traders on the optimal trading execution strategy of the big trader increases.That is the optimal trading execution strategy of the big trader becomes respectively more concave (Figure 6) or more convex (Figure 7) whe 0 µ increases and 0 0 µ > or 0 µ increases and 0 0 µ < .
In the third study case in the mean field game model that describes the retail traders we assume 0 θ = .

w =
, 0 5 µ = and we study the corresponding optimal trading execution strategy of the big trader when ξ varies in ( ] 0,1 .The remaining parameters of the trading execution model have the same values than in the second study case.We recall that when 0 θ = and 0 0 µ > we have 0 0,T the "majority" of traders are long on the asset shares and are buyers, the asset share price tends to increase, and the big trader expects rising prices of the asset shares.The value assigned to ( ] 0,1 ξ ∈ distinguishes the retail traders in buy and hold investors ( ξ close to one) and short term investors ( ξ close to zero).When ( ] 0,1 ξ ∈ is close to zero (i.e. the retail traders are short term investors) the short term character of the retail traders amplifies the bullish direction of the market in comparison to the bullish direction of the market induced in the same circumstances by buy and hold retail traders ( ξ close to one).As a consequence in presence of short term retail traders the big trader enhances the choice of moving the sale of the asset shares at the end of the time interval [ ] 2 0,T .On the other hand when ( ] 0,1 ξ ∈ is close to one (i.e. the retails traders are buy and hold investors) the buy and hold character of the retail traders reduces the rise of the asset share price induced by the retail traders in comparison to the rise induced by the short term retail traders in similar circumstances.As a consequence in presence of buy and hold retail traders the big trader mitigates the choice of moving the sale of the asset shares at the end of the time interval [ ] 2 0,T .That is leaving unchanged the other parameters of the numerical experiment (i.e.0 θ = , 0 0 µ > ) the trading execution strategy of the big trader should be less concave in presence of retail traders that are buy and hold investors than in presence of retail traders that are short term investors.A similar analysis can be carried out to deduce the behaviour of the big trader suggested by the model when 0 θ = and 0 0 µ < .Figure 8 shows the optimal trading execution strategy of the big trader when 0 θ = , 0 5 µ = , 0.5 w = and 0.4, 0.7 ξ = .Figure 9 shows the optimal trading execution strategy of the big trader when 0 θ = , 0 5 µ = − , 0.5 w = and 0.4, 0.7 ξ = .Figure 8, Figure 9 confirm quantitatively the previous qualitative analysis.
In the fourth study case we assume 1 θ = and 0.5 in the mean field game model that describes the retail traders and we study the corresponding optimal trading execution strategy of the big trader as a function of   of the retail traders from being buyers of the asset shares when t is close to zero become sellers of the asset shares when t is close to 2 T .Figure 11 shows the optimal trading execution strategy of the big trader corresponding to the behaviour of the retail traders shown in Figure 10. Figure 11 shows that the big trader as a consequence of the behaviour of the retail traders initially waits to sell his shares, this is coherent with the fact that at the beginning the retail traders are buyers.However later, when the retail traders become sellers and the asset share price tends to decrease, Figure 11 shows that the big trader changes strategy and tries to anticipate the sale at the beginning of the time   interval that remains to conclude the execution of the liquidation order.That is the optimal trading execution strategy of the big trader t    when t is close to 2 T Figure 13 shows the optimal trading execution strategy of the big trader corresponding to the behaviour of the retail traders shown in Figure 12. Figure 13 shows that the big trader as a consequence of the behaviour of the retail traders when t is close to zero anticipates the sale of his shares coherently with the fact that the retail traders are sellers.Later when t is close to 2 T , Figure 13 shows that the retail traders become buyers and the asset share price tends to increase, as a consequence the big trader waits to sell his asset shares at the end of the time interval that remains to conclude the execution of the liquidation order.That is Figure 13 shows that the optimal trading execution strategy of the big trader t , from being a convex function of t when t is close to zero becomes a concave function of t when t is close to 2 T and that the saddle point of t , is located at the value of t that corresponds to the zero of the function t µ ,  The interested reader is referred to the website: http://www.econ.univpm.it/recchioni/finance/w19 to find material including animations, an interactive application and an app that helps the understanding of this paper.A general reference to the work of the authors and of their coauthors in mathematical finance is the website: http://www.econ.univpm.it/recchioni/finance. and

.
We assume that the initial value problem (1), (2) has a unique solution when


expresses the fact that the retail traders do not like the risk associated to the fact of having open positions on the asset shares, and the fourth one: solution of the two point boundary value problem (28)-(39) that satisfies (47) may or may not exist.When it does not exist the attempt of building a solution of problem (20), (21) with the conditions u ), (23), based on (25)-(27) fails.Conversely when there exist the formulae (25)-(27) and the solution of the constrained two point boundary value problem discussed above gives an elementary solution of problem (20) (21) with the conditions u x α


of the utility function.The second goal is the desire of avoiding risk.This goal is pursued making big the term this term the risk aversion is declined in two ways: aversion to abrupt changes of trading strategies expressed goal is the desire of having a position on the asset shares close to a in the long run (i.e. is at time1 t T = ).This last goal is pursued making big the term to keep the formulae deduced in Sections 3 and 4 as simple as possible in the utility function(6) the four terms that the impact of the trading activity of the retail traders on the asset share price when 0.7 ξ = is smaller than when 0.3 ξ =.This is coherent with the fact that when 0.7 ξ = the retail traders are (mainly) buy and hold investors that hold stable open positions of the asset shares and that retail traders of this kind do not like to change abruptly their trading strategies.Conversely when 0.3 ξ = the retail traders are (mainly) short term investors that prefer to open and close their positions in a relatively small time period rather than holding stable open positions of the asset shares.

Figure 3 ,
Figure 4 show the function 2

Figure 2
Figure 2. The function

Figure 4 .
Figure 4.The function 2 field game model that describes the retail traders and we study the corresponding optimal trading execution strategy of the big trader as a function of 0 µ and t , the solution of the mean field game problem (81), (

Figure 5 .
Figure 5. Optimal trading execution strategy of the big trader

interval [ ] 2 0 2 0 2 0 2 0 2 0] 2 0Figure 7 .
,T and the asset share price tends to increase in the time interval [ ] ,T .This determines the behaviour of the big trader.In fact in this case the big trader waits to sell his shares at the end of the time interval [ ] ,T assigned to execute the liquidation order, even more the big trader buys asset shares at the beginning of the time interval [ ] 2 0,T assigned to execute the liquidation order (i.e.we have t y Y > when t is close to zero) to take advantage of the expected rise of the asset share price in the time interval [ ] 2 0,T induced by the behaviour of the retail traders.That is in this case the trading execution strategy t big trader is a concave function that connects the points ( ) 0,Y , ( ) the "majority" of the retail traders have short positions on the asset shares (and d 0 d t M t < that is the "majority" of the retail traders are sellers of the asset shares in the time interval [ ] ,T ) and the asset share price tends to decrease in the time interval[ ] ,T .This fact induces the big trader to anticipate the sale of his asset shares at the beginning of the time interval [ ,T to limit losses due to the expected fall of the asset share price in the time interval [ ] 2 0,T induced by the behaviour of the retail traders.That is in this case the trading execution strategy t Note that Figure5, Figure7show that during the liquidation order t y ,

Figure 6 .
Figure 6.Optimal trading execution strategy of the big trader

Figure 7 .
Figure 7. Optimal trading execution strategy of the big trader

0µ
, a and t ,

Figure 10
shows the function t µ ,

Figure 8 .
Figure 8. Optimal trading execution strategy of the big trader

Figure 9 .
Figure 9. Optimal trading execution strategy of the big trader

Figure 10
Figure 10.The function

Figure 11 ,
from being a concave function of t when t is close to zero becomes a convex function of t when t is close to 2 T and the saddle point of t value of t that corresponds to the zero of the function t µ , in the time interval [ ] 2 0,T , in fact the function t µ , negative in a neighborhood of 0 t = becomes positive in a neighborhood of 2 t T = .That is in the time interval [ ] 2 0,T the "majority" of the retail traders from being sellers of the asset shares when t is close to zero become buyers of the asset shares

Figure 11 .
Figure 11.Optimal trading execution strategy of the big trader

Figure 12
Figure 12.The function

Figure 13 .
Figure 13.Optimal trading execution strategy of the big trader (8)has a unique solution in the time interval [ ] 2 the mean field game problem associated to the retail traders and depend on ξ .As con- sequence the functions t