Optimal trading with linear and (small) non-linear costs

Bouchaud et al find the optimal trading strategy for a family of predictive signals in the presence of transaction costs


How should you trade your favourite alpha signal? This simple-sounding question is of pivotal importance for quantitative asset managers, as fees, bid/ask spreads and market impact chip away at their gains. In this paper, Adam Rej, Raphael Benichou, Joachim de Lataillade, Gilles Zérah and Jean-Philippe Bouchaud find the optimal trading strategy for a rich family of predictive signals in the presence of these costs, extending previous papers in which they were only considered in isolation

Determining the optimal trading strategy in the presence of a predictive signal and transaction costs is of the utmost importance for quantitative asset managers, since too much trading (both in volume and frequency) can quickly cause a strategy’s performance to deteriorate, or even make it a money-losing machine. The detailed structure of these costs is actually quite complex. Some are called ‘linear’ because they grow as ΓQ, where Q is the traded volume and Γ is the linear cost parameter. These are due to various fees (market fees, brokerage fees, etc) or the bid/ask spread, and they usually represent a small fraction of the amount traded (typically 10-4 on liquid markets, but sometimes much more in over-the-counter/illiquid markets). More subtle are impact-induced costs, which come from the fact that a large order must be split into a sequence of small trades that are executed gradually. However, since each executed trade, on average, affects the price in the direction of the trade, the average execution price is higher (if one buys) than the decision price, which leads to what is called ‘execution shortfall’. This cost clearly increases more quickly than Q, since the price impact itself increases with the size of the trade. There now seems to be a wide-ranging consensus that impact-induced costs are of the order σQ3/2/V1/2, where σ is the daily volatility and V is the daily turnover (see Tóth et al (2011), Donier et al (2015) and Donier & Bonart (2014) for recent accounts).

From a theoretical point of view, however, the Q3/2 dependence of the costs makes analysis difficult. As a simplifying assumption, one often replaces the empirical Q3/2 behaviour with a ‘quadratic cost’ formula ηQ2, so the price impact is proportional to Q (see, for example, Almgren & Chriss 2000; Obizhaeva & Wang 2013). In the absence of linear costs (Γ=0), the optimal strategy may be found as a result of a simple quadratic optimisation problem (see, for example, Almgren & Chriss 2000; Gârleanu & Pedersen 2013). The optimal policy is to rebalance at finite speed towards the target portfolio. This results in a position that is an exponential moving average of the trading signal. The pure linear cost problem (ie, η=0) was independently solved, in slightly different contexts, in Martin & Schöneborn (2011) and de Lataillade et al (2012). It requires instantaneous rebalancing towards a finite band around the ideal position as well as no action inside the band, also called the no-trade (NT) region. The case where both linear and quadratic costs are present is, of course, highly interesting, and no exact solution is known at this stage. An approximate solution was proposed in Passerini & Vázquez (2015). A method for constructing the exact solution in the small cost limit, where both Γ and η tend to zero, can be found in Liu, Muhle-Karbe & Weber (2014). The aim of our paper is to show that one can relax the assumption that Γ is small and expand around the general solution for linear cost, with the expansion parameter being η0. The solution defines four different regions (see figure 1), as follows.

  • An NT region: this is still present inside a band around the ideal position, but the band shrinks by an amount η1/3.

  • A small ‘boundary layer’: this has a width of η1/3 and surrounds the band. The trading speed is of order η-1/3 and takes a scaling form.

  • Rebalancing region (i): this is further away from the band, but still within its zone of influence. The trading speed is of order η-1/2 and behaves as a square root of the distance to the band.

  • Rebalancing region (ii): this is even further away from the band. The trading speed is a linear function of the distance to the ideal position, and one recovers the exact Γ=0 solution as expected.

Our method readily generalises to other non-linear cost structures, particularly to the Q3/2 law alluded to above. We briefly discuss how our results extend to this case in the final section of this paper.

1 Setup of the problem and the Γ=0 solution

Following Martin & Schöneborn (2011), we assume the value Xt of the traded instrument has a dynamics governed by the following drift-diffusion equation:11The diffusion constant σ2 can also depend on Xt, as in Martin & Schöneborn (2011), without materially affecting the following results. For simplicity, we keep σ constant.

  dXt=μ(Xt)dt+σdWt   (1)

where μ(X) is the ‘signal’, eg, μ(X)=-κX for classical mean-reverting statistical arbitrage (StatArb) strategies. We will call x the associated Itô differential operator:

  x[f]=μ(x)fx+σ222fx2   (2)

The position (number of shares/lots, etc) of the manager at time t is denoted by θt. For a given rebalancing policy, the expected risk-adjusted profit and loss (P&L) per unit time, conditional on Xt=x and θt=θ, is given by:

  W(θ,xt)=limT1Ttdte-(t-t)/T×[μ(Xt)θt-λθt2-Γ|θ˙t|-ηθ˙t2]   (3)

where λ is the cost of risk (which includes a factor σ2). The first term is the average gain of the position; the last two terms are rebalancing costs. We now introduce the value function V(θ,x), defined as W(θ,xt) for the optimal future rebalancing policy. Note that, because we assume a stationary process for Xt, the value function is independent of t.22Technically, it can be useful to keep T large but finite, which amounts to regularising the differential operator x[f] with a term -f/T and taking the limit T. As is well known, V(θ,x) then obeys a Hamilton-Jacobi-Bellman (HJB) equation, which in the present case reads as follows:

  0=μ(x)θ-λθ2+maxθ˙{-Γ|θ˙|-ηθ˙2+Vθθ˙+x[V]}   (4)

The maximisation with respect to θ˙ is very simple and leads to:

  v=θ˙*=12η[Vθ-Γsign(θ˙*)]orv=0   (5)

where the NT region (v=0) is defined by |V/θ|Γ. In this region, the HJB equation simplifies to:

  x[VNT]=-μ(x)θ+λθ2   (6)

In the rebalancing (RB) region, on the other hand, the HJB equation becomes a non-linear partial differential equation (PDE):

  (V±θ±Γ)2=4η2v2=4η[λθ2-μ(x)θ-x[V±]]   (7)

where the ± sign corresponds to either large enough positive θ, such that the optimal policy is to sell (v<0), or large enough negative θ, such that the optimal policy is to buy (v>0).

Figure 1: Trading speed as a function of the distance to the boundary of the NT region. The outer solution behaves as a square root close to the band and linearly further out. The square root singularity is regularised in a boundary layer of width η 1/3 , so the velocity vanishes linearly at the (shifted) boundary of the band Θ η

risk 0317 bouchaud fig 1

2 The η=0 solution

For η=0, the solution of the corresponding HJB equation has been worked out by Martin & Schöneborn (2011), and it will be denoted by V0(θ,x). The NT region is parameterised by two functions, Θ0-(x),Θ0+(x), such that, for a given x, the speed of trading v vanishes inside the interval [-Θ0-(x),Θ0+(x)], hereafter referred to as a band. Outside the band, the η=0 solution to (7) is given by:

  V0±(θ,x)=VNT,0(±Θ0±(x),x)-Γ|θΘ0±(x)|   (8)

Inside the band, the general solution to the linear equation (6) can be constructed using a Green’s function ?x of the operator x and the two independent solutions ψ1,2(x) of the homogeneous equation xf=0 (see Martin & Schöneborn (2011) for details). Schematically:

  VNT,0(θ,x)=?x[-μ(x)θ+λθ2]+α1(θ)ψ1(x)+α2(θ)ψ2(x)   (9)

where α1,2(θ) are two yet-to-be-determined functions. Martin & Schöneborn (2011) propose fixing these functions in two steps. First, one imposes that, at the (still unknown) boundaries of the NT zone, the derivatives of V0(θ,x) are continuous, ie:

  VNT,0(θ,x)θ|θ=±Θ0±(x)=Γ   (10)

This allows one to solve α1,2(θ) as functionals of the boundary positions Θ0±(x). Second, one determines these boundaries by invoking the variational argument, ie, that these boundaries should maximise the value function V0,NT(θ,x) everywhere in the NT region. This second condition allows us to fully determine Θ0±(x). While we fully agree with the final expressions obtained by Martin & Schöneborn (2011; hereafter M&S), we argue their second condition does not generalise to the case η0. The general condition should, rather, be that the second derivative of the value function with respect to θ is continuous everywhere, including the boundaries between NT and RB regions. This is a direct consequence of the continuity of the trading speed across the boundary and the fact that the HJB equation contains second derivatives of the value function. In fact, we show in appendix B of Rej et al (2015) that the M&S solution obeys:

  2VNT,0(θ,x)θ2|θ=±Θ0±(x)0   (11)

a property that apparently went unnoticed in Martin & Schöneborn (2011), which is actually much simpler than the variational condition. In the next section, we will attempt to construct a consistent solution to the HJB for arbitrary Γ but small quadratic costs η0. We will make use of the continuity of the first and second derivatives of the value function to determine the new location of the boundaries.

3 The small η-matched asymptotic expansions

3.1 The outer region

Let us assume that, far enough from the new band positions [-Θη-(x),Θη+(x)] (the ‘outer region’), the trading solution for small η reads:

  Vη±(θ,x)=V0±(θ,x)+ηV1±(θ,x)+(η0)   (12)

Below, we will confine ourselves to the ‘+’ sector, where the trading speed is negative; we will also drop the superscripts on the position of the band Θ0 as well as on V0,V1. Plugging our ansatz into (7) and retaining leading terms in η gives us:

  V1θ=-2λθ2-μ(x)θ-x[V0]   (13)

where we have used V0/θ=-Γ so the zero-order term on the left-hand side vanishes. Using the solution outside the band (8), we write:

  x[V0]=x[VNT,0(Θ0(x),x)]+Γx[Θ0(x)]   (14)


  x[VNT,0(θ,x)]=-μ(x)θ+λθ2   (15)

from which we deduce (the dependence of μ and Θ0 on x is henceforth suppressed):

  x[VNT,0(Θ0,x)] =-μΘ0+λΘ02+μΘ0(VNT,0)θ  
      +σ22[Θ02(VNT,0)θθ+Θ0′′(VNT,0)θ+2Θ0(VNT,0)xθ]   (16)

where the prime stands for the derivative of Θ0 with respect to x, and the subscripts indicate variables (x or θ) with regard to which derivatives are taken. The boundary conditions at Θ0 are:

  (VNT,0)θ(Θ0(x),x)-Γ,(VNT,0)θθ(Θ0(x),x)0for all x   (17)


  (VNT,0)xθ=-Θ0(VNT,0)θθ0   (18)

so x[V0] finally simplifies to:

  x[V0]-μΘ0+λΘ02   (19)

Therefore, the equation for V1 becomes:

  V1θ=-2λ(θ2-Θ02)-μ(θ-Θ0)   (20)

Now, the velocity in the trading zone is simply:

  v=12ηV1θ   (21)

We thus find:

  • v diverges as η-1/2 when η0, recovering the instantaneous rebalancing in this limit;

  • v behaves linearly for large |θ|;

  • v behaves as a square root close to the unperturbed band Θ0 (see discussion below):

      v-λ(Θ0+θ)-μηθ-Θ0   (22)

    This square root singularity is interesting, because it means there must be a region very close to the band where this naive perturbative solution breaks down. Indeed, the second derivative of ηV1 with respect to θ diverges and, thus, may not be neglected. One has to analyse this region by zooming in on the immediate proximity of the band, conventionally dubbed the ‘inner region’ or the boundary layer (see Hinch 1991).

3.2 The inner region

To make a start on the analysis, we take the derivative of (7) with respect to θ and introduce:


This leads to the exact equation:

  ffθ=-2η(μ-2λθ+x[f])   (23)

We postulate that, close to the (new) band Θη(x), the function f exhibits the following scaling:

  f=-ηαF(y)where y:=θ-Θη(x)ηβ>0,α,β>0   (24)

The parameters α and β are two exponents that need to be determined, while F(y) is a positive function (note that fv<0 in the ‘+’ sector we are considering here). A first condition comes from the fact that when y, this scaling form must reproduce the above square root solution, (22). Writing F(y)Ay for large y, one finds:

  v=-12ηηαF(y)y1-ηα-β/22ηAθ-Θη   (25)

Up to leading order in η, Θη=Θ0, so the identification with (22) directly yields:

  α-β/2=1/2,A=22λΘ0-μ   (26)

Injecting the scaling form into (23), and noting that derivatives with respect to x supply factors of η-β, we find the leading terms are:

  η2α-βFFy=2η(-μ+2λΘ0+σ22ηα-2βΘ02Fyy)   (27)

Matching the η powers of the two sides of the equation leads to:

  2α-β=1or2α-β=1+α-2β   (28)

The first equality can only hold if α2β, in which case the last term on the right-hand side is negligible. This would, however, lead to:

  (F2)y=4(2λΘ0-μ)A2   (29)

which still has a square root singularity (where F goes to zero); so, close enough to the singularity, the last term on the right-hand side diverges and cannot be neglected. This contradicts our original assumption.

The only other possibility is:


which, together with:


leads to α=2/3 and β=1/3. The leading ordinary differential equation (ODE) for F takes the following form:

  (F2)y-BFyy=A2,B2σ2Θ02   (30)

Upon integration:

  F2-BFy=A2(y-y0)   (31)

The solution to the above may be expressed in terms of Airy functions. Writing F=-BΨy/Ψ, the above equation reads:

  Ψyy=A2B2(y-y0)Ψ   (32)

We want a solution to this equation such that Ψy(y=0)=0 (ie, F(y=0)=0), such that F(y>0)>0. The general solution is:

  Ψ(y)=c1Ai(z(y-y0))+c2Bi(z(y-y0)),z=(AB)2/3   (33)

but the asymptotic behaviour of the Airy functions imposes c2=0. The condition Ai(-zy0)=0 selects the first maximum of Ai that occurs for -zy0-1.018, thereby fixing y0. Finally, the solution is:

  F(y)=-BzAi(z(y-y0))Ai(z(y-y0))   (34)

For large y, one uses the asymptotic behaviour lnAi(u)-2u3/2/3 to obtain:

  F(y)Bz3/2yAy   (35)

as desired. We have found a solution that goes smoothly to zero when y0, ie, in a region of width η1/3 immediately outside the boundary of the band -Θη (see figure 1). Note that Fy(0)=1.018A4/3B-1/3.

In the small Γ limit, the NT region has a width of order Γ1/3 around the ideal (Markowitz) position, therefore leading to 2λΘ0-μΓ1/3, or AΓ1/6 and zΓ1/9. Plugging this into (34) leads to a width of the inner region scaling as (η3/Γ)1/9. This allows us to make the connection between our results and those of Liu, Muhle-Karbe & Weber (2014), who consider the double limit Γ,η0 with η/Γ4/3 fixed. In that regime, (η3/Γ)1/9Γ1/3, which recovers the predictions of Liu, Muhle-Karbe & Weber (2014). Our results are, we believe, quite interesting, as they are valid for arbitrary values of Γ, with a universal shape of the scaling function F(y) in the inner region, independent of the precise problem at hand.

3.3 Boundaries shift inwards

Next, we need to find the shifted band position Θη. We will use the fact that the second derivative of the value function should be continuous at the boundary. Integrating f leads to the following equality for the value function in the trading zone:

  V+(θ,x)=Θηθdθf(θ,x)-Γ(θ-Θη)+VNT,η(Θη,x)   (36)

that by construction coincides with VNT,η at the boundaries of the band. Observe VNT,η differs from the original M&S solution by the change of boundary conditions. Because of the optimality of the η=0 boundaries, one immediately infers |Θη-Θ0|=O(ηa) translates to |VNT,η(θ)-VNT,0(θ)|=O(η2a).

We will now show that a=1/3, ie, the shift of the band is of the same order as the width of the boundary layer. The continuity of the second derivative at θ=Θη imposes, up to leading order in η:

  -η1/3Fy(0)=(VNT,0)θθ(Θη)(VNT,0)θθθ(Θ0)(Θη-Θ0)   (37)

where we use the condition (VNT,0)θθ(Θ0)=0, derived in appendix B of Rej et al (2015). This immediately yields:

  Θη=Θ0-Fy(0)(VNT,0)θθθ(Θ0)η1/3   (38)

ie, the inward shift of the band is of order η1/3, exactly like the width of the boundary layer. This is reasonable, as it means both effects of the quadratic term on the immediate proximity of the band are of the same order. As we show in appendix B of Rej et al (2015), the third derivative of VNT,0 turns out to be positive at the unperturbed band; hence, the above expression implies the boundary shifts inwards, ie, the NT region is reduced by the presence of quadratic costs.

The alert reader might wonder how the solution given by (36) still has a continuous first derivative at Θη. This is discussed in full detail in Rej et al (2015), which establishes that our boundary layer solution (36) is indeed C2 across the NT-RB boundary.

4 Discussion and extensions

All the results above are compatible with the numerical results of Liu, Muhle-Karbe & Weber (2014), who exhibit a square root-like trading speed close to the band and a band that shrinks when η increases (see figure 1 therein; the parameters λ, ε are identical to our η, Γ, respectively). We have ourselves solved the HJB equation numerically and found a band position that is compatible with our prediction above: Θ0-Θηη1/3 (see Liu, Muhle-Karbe & Weber 2014, figure 1).

In the above, we did not elaborate on the domain of validity of the small η expansion. For perturbation theory to make sense, the shift in the position of the band must remain small compared with the width of the band itself, ie:

  |Θ0+-Θη+Θ0++Θ0-|1   (39)

Assuming an Ornstein-Uhlenbeck process for the prediction (κ-1 is the mean-reversion time), μ(x)=-κx, we obtain in the small Γ limit:

  (VNT,0)θθθ(Θ0)8λ2σ2κ(3Γσ22κ)1/3   (40)

This, together with the results of Martin & Schöneborn (2011):

  Θ0++Θ0-σ2λ(Γκ2σ4)1/3,Θ0κλ   (41)

where we have dropped all O(1) numerical constants, allows us to recast the above as:33In the following discussion, we assume λΘ0μ, ie, the price of risk for a position at the edge of the band is small compared with the expected gains.

  ηΓ4/3λ(σκ)4/3   (42)

so the relevant combination is indeed ηΓ-4/3, as anticipated in Liu, Muhle-Karbe & Weber (2014) in the Γ,η0 limit. In order to make sense of the above inequality, it is useful to substitute the price of risk λ with a risk target , corresponding to the volatility of the ideal position. In the absence of costs, this ideal position reads as:

  θ*=μ2λ   (43)

leading to a typical risk κσ2/2λ. The above inequality can thus be rewritten as:

  ηΓ4/3σ2/3κ5/6   (44)

Suppose the target risk is a fraction φ of the daily volume V, ie, =φVσ. The quadratic cost parameter may be expressed using dimensional quantities η=CσT3/2/V, where C is a number and T=1 day. The final dimensionless condition is, interestingly enough, independent of the volume V:

  Cφ(ΓσT)4/3(κT)-5/6   (45)

Taking, for example, Γ=2 basis points, σT=2% and κT=0.1, we find Cφ10-2. In conclusion, our small η expansion makes sense, for a given quadratic cost coefficient C, if the portfolio’s typical positions represent a small fraction of the daily traded volume.

Finally, we note that the minimal P&L induced by linear and quadratic costs can be written as Γ2/3G(ηΓ-4/3), where G(u) is a function that tends to a constant for u0 and behaves as u for large u. This enables one to estimate the impact of both parameters on the final costs. It is also interesting to note the use of the simplified ‘outer’ solution for the trading speed (22) leads to an increased cost of order η compared with the optimal solution.

Let us conclude by pointing out that the above matched asymptotic expansion around the M&S solution can be undertaken for arbitrary non-linear costs. If, instead of the quadratic cost term ηθ˙2 considered above, one worked with the more realistic ζθ˙3/2 term, one would find the following HJB equation in the trading region:

  (V±θ±Γ)3ζ2[λθ2-μ(x)θ-x[V±]]   (46)

requiring a perturbative expansion of the form:

  Vζ±(θ,x)=V0±(θ,x)+ζ2/3V1±(θ,x)+   (47)

This leads to trading speed behaving as (θ-Θζ)1/3 in the outer region, close enough to the band, but crossing over to the following boundary layer solution:

  f(θ)=ζ4/5F^(θ-Θζ(x)ζ2/5)   (48)

where F^(y) now obeys the following Abel equation (see, for example, Panayotounakos & Zarmpoutis 2011):

  F^3-BF^y=A2(y-y0)   (49)

One should impose F^(y=0)=0 and F^(y)y1/3 for large y. Since our asymptotic expansion in the quadratic case relies chiefly on the properties of the M&S solution in the NT region, all the results obtained readily transpose to the present case as well. The general shape of the optimal trading solution is, mutatis mutandis, similar to that drawn in figure 1.

Adam Rej is a research manager, Raphael Benichou is a directional portfolio manager, Joachim de Lataillade is head of execution, Gilles Zérah is head of research management and Jean-Philippe Bouchaud is chairman and head of research at Capital Fund Management in Paris. The authors thank J Donier, CA Lehalle, J Muhle-Karbe and M Potters for enlightening discussions on the subject matter of this paper.


  • Almgren RF and N Chriss, 2000
    Optimal execution of portfolio transactions
    Journal of Risk 3, pages 5–39
  • De Lataillade J, C Deremble, M Potters and JP Bouchaud, 2012
    Optimal trading with linear costs
    Journal of Investment Strategy 1(3), pages 91–115
  • Donier J and J Bonart, 2014
    A million metaorder analysis of market impact on Bitcoin
    Market Microstructure and Liquidity 1(2), pages 1550008
  • Donier J, J Friedrich Bonart, I Mastromatteo and JP Bouchaud, 2015
    A fully consistent, minimal model for non-linear market impact
    Quantitative Finance 15(7), pages 1109–1121 (see also references therein)
  • Gârleanu NB and LH Pedersen, 2013
    Dynamic trading with predictable returns and transaction costs
    Journal of Finance 68(6), pages 2309–2340
  • Hinch J, 1991
    Perturbation Methods
    Cambridge University Press
  • Liu R, J Muhle-Karbe and M Weber, 2014
    Rebalancing with linear and quadratic costs
    Preprint, arXiv:1402.5306
  • Martin R and T Schöneborn, 2011
    Mean reversion pays, but costs
    Risk February, pages 96–101
  • Obizhaeva A and J Wang, 2013
    Optimal trading strategy and supply/demand dynamics
    Journal of Financial Markets 16, pages 1–32
  • Panayotounakos DE and TI Zarmpoutis, 2011
    Construction of exact parametric or closed form solutions of some unsolvable classes of nonlinear ODEs
    International Journal of Mathematics and Mathematical Sciences 2011, article 387429
  • Passerini F and S Vázquez, 2015
    Optimal trading with alpha predictors
    Preprint, arXiv:1501.03756
  • Rej A, R Benichou, J de Lataillade, G Zérah and JP Bouchaud, 2015
    Optimal trading with linear and (small) non-linear costs
    Preprint, arXiv:1511.07359
  • Tóth B, Y Lempérière, C Deremble, J de Lataillade, J Kockelkoren and JP Bouchaud, 2011
    Anomalous price impact and the critical nature of liquidity in financial markets
    Physical Review X 1, article 021006


  • LinkedIn  
  • Save this article
  • Print this page  

Only users who have a paid subscription or are part of a corporate subscription are able to print or copy content.

To access these options, along with all other subscription benefits, please contact [email protected] or view our subscription options here: http://subscriptions.risk.net/subscribe

You are currently unable to copy this content. Please contact [email protected] to find out more.

You need to sign in to use this feature. If you don’t have a Risk.net account, please register for a trial.

Sign in
You are currently on corporate access.

To use this feature you will need an individual account. If you have one already please sign in.

Sign in.

Alternatively you can request an individual account here: