optimalplacementinalimitorderbook - xin guo · 2018. 10. 8. · optimal placement problem is...

24
Optimal Placement in a Limit Order Book Xin Guo Adrien de Larrard Zhao Ruan August 14, 2013 Abstract This paper proposes and studies an optimal placement problem in a limit order book. Two simple models are proposed: one with price impact and one without price impact. For the first model, optimal placement strategies for both single-period and multi-period cases are derived. For the second model, it is shown that the optimal strategy never mixes market orders and (best) limit orders; in particular, with special choices of parameters, the optimal strategy reduces to the VWAP type of Bertsimas and Lo (1998) for the optimal execution problem. 1 Introduction Technological innovation has completely transformed the fundamentals of the financial market. As a result, automatic and electronic order-driven trading platforms have largely replaced the traditional floor-based trading. In an electronic order-driven market, orders arrive at the exchange and wait in the Limit Order Book (LOB) to be executed. In US, high-frequency trading firms represent 2% of the approximately 20,000 firms operating today, but account for 73% of all equity orders volume. In most exchanges, order flow is heavy with thousands of orders in seconds and tens of thousands of price changes in a day for a liquid stock. Meanwhile, the time for the execution of a market order has dropped below one millisecond. This new era of trading is commonly referred to as High Frequency Trading (HFT) or Algorithmic Trading. Limit order book (LOB). In an order-driven market, there are two types of buy/sell orders for market participants to post: market orders and limit orders. A limit order is an order to trade a certain amount of security (stocks, futures, etc.) at a given specified price. The lowest price for which there is an outstanding limit sell order is called the best ask price and the highest limit buy price is called the best bid price. Limit orders are collected and posted in the LOB, which contains the quantities and the price at each price level for all limit buy and sell orders. A market order is an order to buy/sell a certain amount of the equity at the best available price in the LOB. It is then matched with the best available price and a trade occurs immediately and the LOB is updated accordingly. A limit order stays in the LOB until it is executed against a market order or until it is canceled; cancellation is allowed at * Dept of Industrial Engineering and Operations Research, UC at Berkeley, Berkeley, CA 94720-1777. Email: xin- [email protected]. Tel: 1-510-642-3615. 175, rue du Chevaleret, Laboratoire de Probabilit´ es et Mod` eles Al´ eatoires, 75013, Paris, France. Email: lar- [email protected]. Dept of Industrial Engineering and Operations Research, UC at Berkeley, Berkeley, CA 94720-1777. Email: rz- [email protected]. 1

Upload: others

Post on 25-Sep-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Optimal Placement in a Limit Order Book

Xin Guo ∗ Adrien de Larrard† Zhao Ruan ‡

August 14, 2013

Abstract

This paper proposes and studies an optimal placement problem in a limit order book. Twosimple models are proposed: one with price impact and one without price impact. For the firstmodel, optimal placement strategies for both single-period and multi-period cases are derived. Forthe second model, it is shown that the optimal strategy never mixes market orders and (best) limitorders; in particular, with special choices of parameters, the optimal strategy reduces to the VWAPtype of Bertsimas and Lo (1998) for the optimal execution problem.

1 Introduction

Technological innovation has completely transformed the fundamentals of the financial market. As aresult, automatic and electronic order-driven trading platforms have largely replaced the traditionalfloor-based trading. In an electronic order-driven market, orders arrive at the exchange and wait inthe Limit Order Book (LOB) to be executed. In US, high-frequency trading firms represent 2% of theapproximately 20,000 firms operating today, but account for 73% of all equity orders volume. In mostexchanges, order flow is heavy with thousands of orders in seconds and tens of thousands of price changesin a day for a liquid stock. Meanwhile, the time for the execution of a market order has dropped belowone millisecond. This new era of trading is commonly referred to as High Frequency Trading (HFT) orAlgorithmic Trading.

Limit order book (LOB). In an order-driven market, there are two types of buy/sell orders formarket participants to post: market orders and limit orders. A limit order is an order to trade a certainamount of security (stocks, futures, etc.) at a given specified price. The lowest price for which thereis an outstanding limit sell order is called the best ask price and the highest limit buy price is calledthe best bid price. Limit orders are collected and posted in the LOB, which contains the quantities andthe price at each price level for all limit buy and sell orders. A market order is an order to buy/sell acertain amount of the equity at the best available price in the LOB. It is then matched with the bestavailable price and a trade occurs immediately and the LOB is updated accordingly. A limit order staysin the LOB until it is executed against a market order or until it is canceled; cancellation is allowed at

∗Dept of Industrial Engineering and Operations Research, UC at Berkeley, Berkeley, CA 94720-1777. Email: [email protected]. Tel: 1-510-642-3615.

†175, rue du Chevaleret, Laboratoire de Probabilites et Modeles Aleatoires, 75013, Paris, France. Email: [email protected].

‡Dept of Industrial Engineering and Operations Research, UC at Berkeley, Berkeley, CA 94720-1777. Email: [email protected].

1

Page 2: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

any time. In essence, the closer a limit order is to the best bid/ask, the faster it may be executed. Mostexchanges are based on First-In-First-Out (FIFO) policy for orders on the same price level, althoughsome derivatives on some exchanges have the pro-rate microstructure. That is, an incoming marketorder is dispatched on all active limit orders at the best price, with each limit order contributing toexecution in proportion to its volume. In this paper, unless otherwise specified, we always focus thediscussions on the FIFO market, with extensions to the pro-rate microstructure whenever appropriate.

Order books are available with different levels of details. For example, the so called “level-1 orderbook” contains the best price level of the order book, while “level-2 order book” provides the pricesand quantities of the best five levels on both the ask and the bid sides. The following table is a typicalexample showing the dynamics of the limit order book of the top 5 levels: a market sell order of size1200, followed by a limit ask order of size 400 at price 9.08, and then a cancellation of size 23 for limitask order ar the price 9.10.

Price Size Price Size Price Size Price Size

Ask

9.12 1,525

Ask

9.12 1,525

Ask

9.12 1,525

Ask

9.12 1,5259.11 3,624 9.11 3,624 9.11 3,624 9.11 3,6249.10 4,123 9.10 4,123 9.10 4,123 9.10 4,1009.09 1,235 9.09 1,235 9.09 1,235 9.09 1,2359.08 3,287 9.08 3,287 9.08 3,687 9.08 3,687

Bid

9.07 4,895

Bid

9.07 3,695

Bid

9.07 3,695

Bid

9.07 3,6959.06 3,645 9.06 3,645 9.06 3,645 9.06 3,6459.05 2,004 9.05 2,004 9.05 2,004 9.05 2,0049.04 3,230 9.04 3,230 9.04 3,230 9.04 3,2309.03 7,246 9.03 7,246 9.03 7,246 9.03 7,246

Table 1: A market sell order with size of 1200, a limit ask order with size of 400 at 9.08, and a cancelationof 23 shares of limit ask order at 9.10, in sequence.

The problem of optimal placement. Optimal placement is the most basic element in the designof algorithm trading. It studies how to optimally place the small-sized orders in the LOB. Specifically,when using limit orders, traders do not need to pay the spread and most of the time even get a rebate(say, r). This rebate structure varies from exchange to exchange and leads to different optimizationproblems. For instance, in HK stock exchange, successful executions of limit orders get a discount (i.e.,a fixed percentage of the execution price) whereas in other places such as the London stock exchange,the discount may be a fixed amount. This rebate, however, comes with an execution risk as there is noguarantee of execution for limit orders. On the other hand, when using market orders, one has to payboth the spread between the limit and the market orders and the fee f in exchange for a guaranteedimmediate execution. Thus, traders must decide: given a number of shares to buy or sell, should oneuse market orders, or limit orders, or both? How many orders to be placed at different price levels?What is the optimal sequence of order placement in a give time frame with multi-trades? In essence,traders have to balance the tradeoff between paying the spread and fees vs. execution/inventory riskwhen placing market orders and limit orders.

In essence, the problem of optimal placement is as follows:

• One needs to buy N orders by time T > 0 (T ≈ 1/5 minutes);

2

Page 3: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

• One can split the N orders into (N0,t, N1,t, ...), where N0,t ≥ 0 is the number of market orders attime t = 0, 1, · · · , T , N1,t is the number of orders at the best bid at time t, N2,t is the number oforders at the second best bid at time t, and so on;

• No intermediate selling is allowed before time T ;

• If the limit orders are not executed by time T , one has to buy the non-executed orders at themarket price at time T ;

• When one share of limit order is executed, the market gives a rebate of r > 0;

• When a share of market order is submitted, there is a fee of f > 0;

• Given N and T , the goal is to find the optimal strategy (N0,t, N1,t, ..., Nk,t)t=0,1,··· ,T to minimizethe overall total expected cost.

Clearly the answer to this problem depends on the expected costs at each level of LOB where anorder is placed and in particular, the probability of execution at each level by the end of the period foreach order.

There is also a price impact issue in the optimal placement problem. The major modeling hypothesison price impact is that any trading strategy, especially that involves a large amount of buying and sellingwithin a short period of time, will have an impact on the stock price: too many large orders may depressthe price and reduce the potential profit whereas too many small transactions may be costly and maytake too long to complete. The empirical study by Cont, Kukanov, and Stoikov (2013) [19] verifies theexistence of price impact at the trade level and suggests that the price impact is more or less linear.

Optimal placement problem is closely related to but different from the well-known optimal executionproblem, in which price impact is the main modeling factor. Recall that the optimal execution problemis to slice big orders into smaller ones on a daily/weekly basis in order to minimize the price impact orto maximize some expected utility function; see for instance, Bertsima and Lo (1998) [10], Almgren andChriss (1999, 2000) [5, 6], Almgren (2003) [4], Almgren and Lorenz(2007) [7], Schied and Schoneborn(2009) [47], Weiss (2009) [50], Alfonsi, Fruth, and Schied (2010) [1], Gatheral (2010) [24], Predoiu,Shaiket, and Shreve (2010) [43], Schied, Schoneborn, and Tehranchi (2010) [48], and Alfonsi, Schied,and Slynko (2012)[2], Gatheral and Schied (2011)[25], Forsyth, Kennedy, Tse, and Windcliff (2011)[23],and Guo and Zervos (2012)[30], and Obizhaeva and Wang (2013) [42]. Optimal placement problem, onthe other hand, is on a smaller (10–100 seconds) time scale and mostly for different type of (i.e., HFT)traders (see Kirilenko et. al. (2011) [36]).

To our best knowledge, there is essentially no existing result on the optimal placement problemexcept for Hult and Kiessling (2010) [35], who consider a special version of the problem with N = 1using a high-dimensional Markov chain model for the state and evolution of the entire LOB. Using thepotential theory for Markov chains, they derive conditions for the existence of an optimal strategy andprovide a value-iteration algorithm to numerically find the optimal strategy.

Our results. In this paper, we will analyze the optimal placement problem in two steps.

• First, we will propose a correlated random walk model without the price impact factor. In thismodel, we will analyze the optimal strategy in a single period where orders can only be placed at thebeginning and at the end time T ; we will show that the optimal strategy will involve only the bestbid and market orders. Based on this analysis, we move on to a multi-period model where one isallowed to adjust and cancel any non-executed (limit) orders after each price movement/each time

3

Page 4: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

period. Here we assume the choices are market order, the best bid order, or no order placementat any time t < T . We will show that the optimal strategy at each time t is a threshold type.

• Then we will propose a model taking into account the price impact. We will propose a martingaleprice model with an additive price impact and assume that the choices are between the best bidand the market orders. In this case, we will analyze the structure of the optimal strategy andshow that the optimal trading strategy never mixes the limit and market orders. As a result, theoptimal strategy can be computed recursively. In a special and degenerate case of the model, ourresult reduces to the VWAP strategy in the sense of Bertsimas and Lo (1998) [10] for the optimalexecution problem.

2 Models and Analysis

2.1 Correlated Random Walk Model and Analysis

The model. We will first propose and analyze a correlated random walk model for the dynamics ofthe bid/ask price. In this model, we will assume that

1. The spread between the best bid price and the best ask price is always 1 tick;

2. The best ask price increases or decrease 1 tick at each time step t = 0, 1, · · · , T ;

3. There is no price impact.

Moreover, let At be the best ask price at time t, then

At =

t∑

i=1

Xi, A0 = 0, (2.1)

with (Xi)i≥0 taking values 1 and −1, (Xi, Xi+1) a two-dimensional Markov chain with P(X1 = 1) = p =1− P(X1 = −1) for some p ∈ [0, 1], and

P(Xi+1 = 1|Xi = 1) = P(Xi+1 = −1|Xi = −1) = p <1

2, for i = 0, 1, · · · , T − 1.

Note that this model is a simple case of the well-known correlated random walk model. (See Goldstein(1951) [27], Mohan(1955) [39], Gillis (1955) [26], and Renshaw and Henderson (1981) [40].) The particu-lar choice of p < 1

2makes the price “mean revert,” as consistent with some observation in high-frequency

tradings. (See for instance Chen and Hall (2013) [16] for some statistical analysis on this.)To analyze this model for the optimal placement problem, first note that without price impact

assumption it suffices to consider N = 1. Next, critical to our analysis is At and Yt, where

Yt = min1≤i≤t

Ai. (2.2)

Probability distribution of At and Yt. For ease of exposition, let us call any price change of At

from increase to decrease (or decrease to increase) as a direction change, and suppose there are i suchdirection changes between from 0 to T , 0 ≤ i ≤ T . Then it is not difficult to see that

P(AT = k|number of direction changes is i) =

pT−i−1(1− p)iLiT,k,

T + k

2∈ N & |k| ≤ T,

0, otherwise.

4

Page 5: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Where

LiT,k =

[

(1− p)

( T+k2

− 1

⌊ i+12⌋ − 1

)( T−k2

− 1

⌊ i+22⌋ − 1

)

+ p

( T+k2

− 1

⌊ i+22⌋ − 1

)( T−k2

− 1

⌊ i+12⌋ − 1

)]

.

Summing up over all possible i we

P(AT = k) =

T−k∑

i=1

pT−i−1(1− p)iLiT,k,

T + k

2∈ N & |k| ≤ T,

0, otherwise.

(2.3)

Lemma 1. If T−k2

∈ N and k > 0, then P(YT = −k) = P(AT = −k).

Proof. Notice that

P(YT ≤ −k) = P(YT ≤ −k, AT ≤ −k) + P(YT ≤ −k, AT > −k)

= P(AT ≤ −k) + P(YT ≤ −k, AT > −k),

and

P(YT = −k) = P(YT ≤ −k)− P(YT ≤ −k − 1)

= P(AT = −k) + P(YT ≤ −k, AT ≥ −k + 1)− P(YT ≤ −k − 1, AT ≥ −k).

Since T−k2

∈ N, {AT ≥ −k + 1} = {AT ≥ −k + 2}. Then it is sufficient to show

P(YT ≤ −k, AT ≥ −k + 2) = P(YT ≤ −k − 1, AT ≥ −k).

For ∀ω ∈ {YT ≤ −k − 1, AT ≥ −k}, denote X(ω) = (Xω1 , X

ω2 , · · · , X

ωn ) and A(ω) = (Aω

1 , Aω2 , · · · , A

ωT ).

Let τ(ω) = sup{i : Aωi = YT (ω)}, which is the last time that A(ω) reaches the level of YT (ω). Then

define h : {YT ≤ −k, AT ≥ −k + 2} → {YT ≤ −k − 1, AT ≥ −k} as h(ω) = ω, where ω satisfies

X ωi =

{

Xωi , i 6= τ(ω) + 1,

− 1, i = τ(ω) + 1.

First, we show that h is well defined, i.e., ω ∈ {YT ≤ −k − 1, AT ≥ −k}, and that this mappingkeeps the number of direction changes. Since τ(ω) is the last time A(ω) reaches the level of YT (ω)and AT (ω) − YT (ω) ≥ 2, we have Xω

τ(ω) = −1 and Xωτ(ω)+1 = Xω

τ(ω)+2 = 1. Since ω only changes the

step τ(ω) + 1 from 1 to −1, we know that Ah(ω)τ(ω)+1 ≤ −k − 1 and YT (h(ω)) = YT (ω) − 2 ≥ −k. Thus

ω ∈ {YT ≤ −k− 1, AT ≥ −k}. And we also noted that h keeps the number of direction changes from ω

to ω. Since τ(ω) ≥ 1 for all k > 0, we have Xω1 = X

h(ω)1 and

P(ω) = P(ω). (2.4)

Second, we show that h is an injection. Suppose ω1, ω2 ∈ {Yn ≤ −k, An ≥ −k + 2} satisfyingh(ω1) = h(ω2). If τ(ω1) = τ(ω2), then obviously we have ω1 = ω2. And if τ(ω1) 6= τ(ω2), and W.O.L.G.τ(ω1) < τ(ω2). Then for any i ≤ τ(ω1) and i > τ(ω2), we have Xω1

i = Xω2

i . For τ(ω1) + 1, we haveXω2

τ(ω1)+1 = −1 and Xω2

τ(ω1)+1 = 1. Thus Aω2

τ(ω1)+1 = Aω1

τ(ω1)− 1 = YT (ω1)− 1. Then

YT (ω2) ≤ Aω2

τ(ω1)+1 ≤ YT (ω1)− 1.

5

Page 6: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

And since Aω1

τ(ω2)+1 = Aω2

τ(ω2)+1 = YT (ω2) + 1, we have Aω1

τ(ω2)+1 ≤ YT (ω1), which is contradictory to the

definition of τ(ω1). Thus τ(ω1) = τ(ω2) and ω1 = ω2. That is, h is an injection.Third, we show that h is a surjection, i.e., for any ω ∈ {YT ≤ −k − 1, AT ≥ −k}, there exists

ω ∈ {YT ≤ −k, AT ≥ −k + 2}, such that h(ω) = ω. Let τ(ω) = inf{i : Aωi = Yn(ω)}, i.e. the first time

A(ω) reaches YT (ω). Then define ω by

Xωi =

{

X ωi , i 6= τ (ω),

1, i = τ (ω).

Since τ (ω) is the first time that A(ω) reaches YT (ω), by definition Aωi ≥ YT (ω)+1 for any i < τ (ω), and

Aωi ≥ Aω

i + 2 ≥ YT (ω) + 2 for any i ≥ τ(ω), Thus τ(ω)− 1 is the last time that A(ω) reaches its lowestposition. Then by the definition of h, h(ω) = ω. Hence h is a surjection. Then follows that h is indeeda bijection from {YT ≤ −k, AT ≥ −k + 2} to {YT ≤ −k − 1, AT ≥ −k}. In addition, the equality (2.4)suggests

P{YT ≤ −k − 1, AT ≥ k} = P{YT ≤ −k − 1, AT ≥ −k},

and

P(YT = −k) = P(AT = −k).

Remark 1. Note that with the degenerate case p = 1/2, the correlated random walk model becomes asimple random walk, and the reflection principle argument leads to the same result (see P.97 to P.100in Redner and Sidney (2001) [41]).

Next, we have the monotone property of the distribution of Yt.

Proposition 2. P(YT = −k) is a decreasing function with respect to k, k = 1, 2, ..., T .

Proof. For ∀ω ∈ {YT = −k − 1}, let τ(ω) = inf{i : Aωi = Y ω

T =}, i.e. the first time that Aω reaches thelowest position. Since k > 0, thus τ(ω) exists (otherwise the process will never reach −2). Define g on{YT = −k − 1} as g(ω) = ω, where ω satisfies

X(ω) =

{

Xωi , i 6= τ(ω),

1, i = τ(ω).

That is, g changes Xτ(ω) from a “downward” to an “upward”. Since τ(ω) is the first time that Aω hitthe lowest position, then it is clear that YT (ω) = −k. Thus g(ω) ∈ {YT = −k}. For ∀ω1 and ω2 ∈{YT = −k − 1}, if g(ω1) = g(ω2) = ω, then let τ1 = τ(ω1) and τ2 = τ(ω2). If τ1 = τ2, then it is easyto see that for any i < τ1, X

ω1

i = Xω2

i . Similarly for i = τ1 and i > τ1. Thus ω1 = ω2. If τ1 6= τ2 andW.O.L.G. τ1 < τ2. Then for any i < τ1, X

ω1

i = Xω2

i ; Aω1

i = Aω2

i − 2 for τ1 ≤ i < τ2; and Xω2

i = −1and Xω1

i = 1 for i = τ2. Thus Aω2

τ2= Aω2

τ1≥ YT (ω1) + 1 = −k, which is contradictory to the definition

of ω2. Hence τ1 = τ2 and ω1 = ω2. Thus g is an injection. Note that g(ω) has at least the samenumber of changes of directions, P(g(ω)) ≥ P(ω). Thus P{YT = −k − 1} ≤ P{YT = −k}. Similarly,P{YT = −k} ≤ P{YT = −k + 1}.

6

Page 7: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

2.1.1 Analysis of Optimal Placement Strategy: the Single-period Case

With these preliminary analysis, we will first consider the optimal placement in a single period, by whichwe mean that

• One only places her order at the beginning, i.e. t = 0;

• If the order is placed as a limit order and the limit bid order is not executed before time T , thenone has to use market orders to buy the stock at time T ;

• A limit order placed at price −k will be executed with probability 1 if YT ≤ −k and with probabilityq if YT = −k + 1. Otherwise, a market order has to be used at time T to replace the existingnon-executed order.

Comparing expected costs at each level of LOB. Since N = 1, it amounts to compare theexpected cost of placing the order at each level of the LOB.

Recall that there is a fee f for each market order and a rebate r for an executed limit order. LetCq

0 denote the expect cost of a market order and Cqi the expected cost of a limited order placed at the

price i ticks lower than the initial best ask price. Although the costs are functions of f, r, T, p, q, p, forease of exposition we use the superscript q to highlight their dependence on q.

Obviously, Cq0 = f , and

Cqk =P(YT ≤ −k)(−k − r) + qP(YT = −k + 1)(−k − r)

+ P(YT > −k + 1)(E[AT |YT > −k + 1]) + (1− q)P(YT = −k + 1)(E[AT |YT = −k + 1]). (2.5)

Lemma 3. For k = 1, 2, ...T − 2,

P(YT = −k)(k + E[AT |YT = −k])− P(YT = −k − 1)(k + 2 + E[AT |YT = −k − 1]) ≥ 0. (2.6)

Proof. Define the same mapping g from {YT = −k − 1} to {YT = −k} as in the proof of Proposition 2.Now g is an injection and P(ω) ≤ P(g(ω)) for any ω ∈ {YT = −k − 1}, because g will not decrease thenumber of direction changes of the path from ω to g(ω). Moreover, because g changes one “downward”edge to one “upward” edge, we have AT (g(ω)) = AT (ω) + 2. Thus

P(YT = −k − 1)(k + 2 + E[AT |YT = −k − 1])

=∑

ω∈{YT=−k−1}P(ω)(k + 2 + AT (ω))

≤∑

g(ω)∈g({YT =−k−1})P(g(ω))(k + AT (g(ω)))

≤∑

g(ω)∈{YT=−k}P(g(ω))(k + AT (g(ω))).

The second to the last inequality holds because g is an injection, and the last inequality holds becauseAT (g(ω)) + k ≥ 0 for ∀g(ω) ∈ {YT = −k}.

Proposition 4. Given r, f , T , p, and p, Cq1 < Cq

2 < ... < CqT < Cq

T+1.

7

Page 8: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Proof. Note that

Cqk = qC1

k + (1− q)C0k

Then, it suffices to show

C01 < C0

2 < ... < C0T < C0

T+1, (2.7)

C11 < C1

2 < ... < C1T < C1

T+1. (2.8)

Let b0k = C0k+1 − C0

k and b1k = C1k+1 − C1

k for k = 1, 2, ..., T . We first show that b0k > 0 for k = 1, 2, ..., T ,

b0k = −P(YT < −k) + (r + f + k) · P(YT = −k) + P(YT = −k)E[AT |YT = −k].

Since r, f ≥ 0, it is enough to show that for k = 1, 2, ..., T ,

b0k = −P(YT < −k) + kP(YT = −k) + P(YT = −k)E[AT |YT = −k] > 0.

First,

b0T = f − (E{AT |YT > −T}+ f)P{YT > −T} − P{YT = −T}(−T − r)

= f + E{AT |YT = −T}P{YT = −T} − fP{YT > −T} − P{YT = −T}(−T − r)

= f − TP{YT = −T} − fP{YT > −T} − P{YT = −T}(−T − r)

= f − f + (f + r)P{YT = −T}

≥ 0.

Secondly, note E[AT |YT = −T + 1] = −T + 2, and by Proposition 2, we have

b0T−1 = −P(YT = −T ) + (T − 1)P(YT = −T + 1) + P(YT = −T + 1)E[AT |YT = −T + 1]

= −P(YT = −T ) + P(YT = −T + 1)

> 0.

And for k = 1, 2, ..., T − 2,

b0k − b0k+1 = −P(YT = −k − 1) + kP(YT = −k) + E[AT |YT = −k]P(YT = −k)

− (k + 1)P(YT = −k − 1)− E[AT |YT = −k − 1]P(YT = −k − 1)

= P(YT = −k)(k + E[AT |YT = −k])− P(YT = −k − 1)(k + 2 + E[AT |YT = −k − 1]) ≥ 0.

The last inequality is from lemma 3. Thus recursively we see that b0k, i = 1, 2, ..., T − 1 are positive,which means inequality (2.7) holds. Then for q = 1,

C1k = (−k − r)P(YT ≤ −k + 1) + P(YT ≥ −k + 2)E[AT |YT ≥ −k + 2]

= C0k−1 − P(YT ≤ −k + 1).

Since C0k is increasing and P(YT ) ≤ −k + 1 as k increases, the inequality (2.8) is clear.

8

Page 9: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Comparison of Cq0 and Cq

1 Based on the above analysis, we see that to derive the optimal orderplace strategy, it suffices to compare Cq

0 and Cq1 .

First, we have,

Proposition 5. In a single period model with p = 12, the optimal strategy is to peg the bid. That is, it

is optimal to always place the order at the best bid price.

Proof. This is obvious: as P{YT = −T − 1} = 0, C0T+1 = f + E(AT ) = f , and

C1T+1 = C0

T − P(YT ≤ −T )

= (E{AT |YT > −T} + f)P{YT > −T}+ P{YT = −T}(−T − r − 1)

= −E{AT |YT = −T}P{YT = −T}+ fP{YT >= −T}+ P{YT = −T}(−T − r − 1)

= TP{YT = −T}+ fP{YT >= −T}+ P{YT = −T}(−T − r − 1)

= f − (f + r + 1)P{YT = −T}

< f.

Thus, we have CqT+1 ≤ f = Cq

0 for all T ≥ 1.

Next, for a more general p, we have

Proposition 6. For general p 6= 12and fixed values r, f, p, q, Cq

1 − Cq0 is an increasing linear function

of p. As a result, the optimal strategy is a threshold type, depending on the sign of (Cq1 −Cq

0)(f, r, p, p),the optimal strategy is either using the market order or the best bid. There is at most one threshold ofswitching.

Proof. Let Cp2,T−1 denote the expected cost of placing a limit bid order at the price of 2 tick lower than

the current best ask price, with T − 1 price changes left and q = p. Then Cp2,T−1 ≥ −2− r, and

C01 = (1− p)(−1− r) + p(1 + Cp

2,T−1),

where Cp2,n−1 is independent to p and (1+Cp

2,n−1) ≥ −1− r. Thus C01 is an increasing linear function of

p. Similarly for C11 . Then combining C1

1 and C01 we conclude that Cq

1 is linear of p. Recall that Cq0 = f ,

then the result follows. Furthermore, C01 = −1 − r < 0 when p = 0, and C0

1 = 1 + Cp2,T−1 when p = 1.

Clearly this expression could be either positive or negative depending on the parameters.

2.1.2 Analysis of the Optimal Placement Strategy: the Multi-period Case

To be consistent and comparable with the analysis in the single-period case, we assume for the multi-period analysis that after each price change at each time step 1, · · · , T , one can adjust the non-executedorder with the following options:

• Cancel the non-executed order and replace it with a market order (denoted this action as ActM);

• Cancel the non-executed order and replace it with the best bid (denoted this action as ActL);

• Cancel the non-executed order and do nothing, i.e. wait (denote this action as ActN ).

Since the number of price changes remaining before the deadline is more critical to the analysis, inthis section we use s = T − t to denote the remaining time steps at time t. That is, As is the best askprice when there are s steps remaining. Moreover, we keep the same assumption that the limit bid orderplaced at price of As − 1 will be executed with probability one if As−1 = As − 1, and will get executedwith probability q if As−1 = As + 1.

9

Page 10: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Comparing the expected costs We will introduce some notations.

• ULs,As

is the expected cost per share with action ActL with s time steps remaining and conditionedon the previous price change being up;

• UMs,As

is the expected cost per share with action ActM with s time steps remaining and conditionedon the previous price change being up;

• UNs,As

is the expected cost per share action ActN with s time steps remaining and conditioned onthe previous price change being up.

By symmetry, it is easy to see that

ULs,As

= As + ULs,0 (2.9)

Thus it suffices to focus on ULs,0 and rewrite UL

s for ULs,0 and similarly for UM

s and UNs , and define

Us := min{UMs , UL

s , UNs }.

Similarly, we use DMs , DL

s , DNs as the expected costs for placing market order, placing limit order at

the price of −1, and placing no orders, conditioned on the previous price change being down, and define

Ds := min{DMs , DL

s , DNt }.

Clearly we have

Proposition 7. UM0 = UL

0 = UN0 = DM

0 = DL0 = DN

0 = f . Moreover, for 1 ≤ s ≤ T ,

UMs = DM

s = f,

ULs = (pq + 1− p)(−1− r) + p(1− q)(1 + Us−1),

UNs = (1− p)(−1 +Ds−1) + p(1 + Us−1),

DLs = (p+ (1− p)q)(−1− r) + (1− p)(1− q)(1 + Us−1),

DNs = p(−1 +Ds−1) + (1− p)(1 + Us−1).

Furthermore,

Lemma 8. Both Ds and Us are non-increasing functions with respect to s.

Proof. Let SDs be the corresponding optimal trading strategy for the value function Ds. Then with s+1

time step remaining and Xs+1 = −1, one can adopt the strategy SDs for the first s price changes until

there is one more step remaining, and then use the market order directly. This will lead to an expectedcost Ds. Since this is only one of all the possible strategies for this case, clearly Ds+1 ≤ Ds. SimilarlyUs+1 ≤ Us.

Lemma 9. For 0 ≤ s ≤ T − 1, f ≥ Us ≥ −r − 2 + p

(1−p)(p+q−pq), UL

s ≤ UMs , DL

s ≤ DNs . That is, if the

previous price change is going up, using the market order is never optimal; if the previous price changeis going down, then one should never wait.

10

Page 11: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Proof. By induction. For s = 0, −2 − r + p

(1−p)(p+q−pq)≤ −2 − r + p

(1−p)p≤ −r ≤ f = U0. Notice that

DL0 = DN

0 = f , UL0 = UM

0 = f , thus the claim holds for s = 0.Now suppose the lemma holds for all k ≤ s, then for s+ 1 we have

UMs+1 = f ≥ −2 − r +

p

(1− p)(p+ q − pq)

as we have already shown in the case s = 0, and

ULs+1 = (pq + 1− p)(−1− r) + p(1− q)(1 + Us)

≥ −1− r +p2(1− q)

(1− p)(p+ q − pq)

= −2 − r +p+ q − 2pq

(1− p)(p+ q − pq)

≥ −2− r +p

(1− p)(p+ q − pq).

Meanwhile, UNs+1 = (1− p)(−1 + min{DL

s , DNs , D

Ms }) + p(1 + Us). Note that

(1− p)(−1 +DLs ) + p(1 + Us)

=(1− p)(−1 + (p+ (1− p)q)(−1− r) + (1− p)(1− q)(1 + Us−1)) + p(1 + Us)

=(1− p)(−1− 1− r + (1− p)(1− q)(2 + r + Us−1)) + p(1 + Us)

≥− 2− r +p(1− p)2(1− q) + p2

(1− p)(p+ q − pq)+ p

=− 2− r +p

(1− p)(p+ q − pq),

and

(1− p)(−1 +DMs ) + p(1 + Us)

=(1− p)(−1 + f) + p(1 + Us)

≥2p− 1 + pUs ≥ 2p− 1− 2p− pr +p2

(1− p)(p+ q − pq)

≥− 2− r +p

(1− p)(p+ q − pq).

Since DNs ≥ DL

s , (1− p)(−1+DNs ) + p(1+Us) ≥ (1− p)(−1+DL

s ) + p(1+Us) ≥ −2− r+ p

(1−p)(p+q−pq).

Hence UNs+1 = (1− p)(−1 +Ds) + p(1 +Us) ≥ −2− r+ p

(1−p)(p+q−pq). Note that UL

s = (pq+1− p)(−1−

r) + p(1− q)(1 + Us) ≤ p(1− q)Us ≤ f. Therefore, when the previous price change is down,

DNs+1 = p(−1 +Ds) + (1− p)(1 + Us)

= DLs+1 + p(r +Ds) + (1− p)q(2 + r + Us)

= DLs+1 + p(r + (p+ (1− p)q)(−1− r) + (1− p)(1− q)(1 + Us−1)) + (1− p)q(2 + r + Us)

≥ DLs+1 + p(−1 + (1− p)(1− q)

p

(1− p)(p+ q − pq)) + (1− p)q

p

(1− p)(p+ q − pq)

= DLs+1 − p+

p2(1− q) + pq

p+ q − pq= DL

s+1.

Hence the lemma holds for s+ 1 and therefore for any T − 1 ≥ s ≥ 0 by mathematical induction.

11

Page 12: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Moreover, we see

Lemma 10. Knowing the previous price changes, the optimal strategy is the switching type:

• When the previous price change is up: there exists s∗1 ∈ [1,∞] such that for any s ≤ s∗1 using thebest bid is optimal; and for any s > s∗1 waiting is optimal.

• When the previous price change is going down: there exists s∗2 ∈ [0,∞], such that for any s ≤ s∗2using market order is optimal; and for any s > s∗2 using the best bid is optimal.

Proof. By Lemma 8 and Lemma 9, it suffices to consider

ULs − UN

s = (pq + 1− p)(−1− r) + p(1− q)(1 + Us−1)− (1− p)(−1 +Ds−1) + p(1 + Us−1)

= −pq(2 + r + Us−1)− (1− p)(r +Ds−1).

This is a non-decreasing function with respect to s for s ≥ 1. Thus if ULs ≥ UN

s for some s∗1, then theinequality holds for any s > s∗1. And UL

1 − UN1 = (1 − p + pq)(−1 − r − f) < 0 implying s∗1 ≥ 1. The

proof for the part with s∗2 is similar.

We also find that

Lemma 11. s∗1 > s∗2.

Proof. Note

ULs − UN

s = (pq + 1− p)(−1− r) + p(1− q)(1 + Us−1)− (1− p)(−1 +Ds−1) + p(1 + Us−1)

= −pq(2 + r + Us−1)− (1− p)(r +Ds−1).

When DMs−1 ≤ DL

s−1, we have ULs − UN

s ≤ 0, because Ds−1 = f ≥ 0.

Now, we are ready to state the optimal strategy.

Theorem 12. [Optimal placement strategy for 0 < s ≤ T − 1] Let 0 < s ≤ T − 1 represent the timeremaining. There exist positive integers s∗1, s

∗2 with s∗1 > s∗2 > 0 such that

• for any s > s∗1: the optimal placement strategy is to wait if the previous price change is up, and touse the best bid if the previous price change is down;

• for any s∗2 < s ≤ s∗1: it is optimal to use the best bid;

• for any s ≤ s∗2: it is optimal to use the best bid order if the previous price change is going up, andto use the market order if the previous price change is down.

Moreover,

s∗1 =

[log(p− pq)]−1 logq(1− 2p)

((1− p + pq)(f + 2 + r)− 1)(1− q)(p2q + 1 + p2 − 2p)

+ 1, (2.10)

and

s∗2 =

[log(p− pq)]−1 log(f + r + 1)(1− p+ pq)− (1− p)(1− q)

(1− p)(1− q)((f + 2 + r)(1− p+ pq)− 1)

. (2.11)

(See Figure 1.)

12

Page 13: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

T S1* S

2*

Wait

Market orderBest bid

Best

bid

Best bid

Figure 1: Illustration of the optimal trading strategy for 0 < s ≤ T − 1

Proof. The theorem is obvious from Lemma 9, Lemma 10, and lemma 11. In fact, one can calculate s∗1and s∗2 explicitly as follows. For s ≤ s∗1 one can recursively calculate the sequence Us by the followingequation and the boundary condition:

Us = p(1− q)(Us−1 + 1) + (1− p+ pq)(−1− r) for s∗1 ≥ s ≥ 1,

U0 = f.

Solving it we get

Us = (p− pq)s(f +2p− 2pq − 1− r(1− p+ pq)

p− 1− pq) +

2p− 2pq − 1− r(1− p+ pq)

1− p+ pq

= (p− pq)s(f + 2 + r −1

1− p+ pq)− 2− r +

1

1− p+ pqfor s∗1 ≥ s ≥ 0.

Now that s = s∗1, DLs∗1

≤ DMs∗1

, implying Ds∗1= DL

s∗1

and

ULs∗1+1 − UN

s∗1+1 =− pq(2 + r + Us∗

1)− (1− p)(r +Ds∗

1)

=− pq(2 + r + Us∗)− (1− p)(r +DLs∗1

)

=− pq(2 + r + (p− pq)s∗

1(f + 2 + r −1

1− p + pq)− 2− r +

1

1− p+ pq)

− (1− p)(r + (p+ (1− p)q)(−1− r) + (1− p)(1− q)(1 + Us∗1−1))

=− pq((p− pq)s∗

1(f + 2 + r −1

1− p+ pq) +

1

1− p+ pq)

− (1− p)(r + (p+ (1− p)q)(−1− r)

+ (1− p)(1− q)(1 + (p− pq)s∗

1−1(f + 2 + r −

1

1− p+ pq)− 2− r +

1

1− p + pq))

=q(1− 2p)

1− p+ pq− (f + 2 + r −

1

1− p+ pq)((p− pq)s

1pq + (p− pq)s∗

1−1(1− p)2(1− q))

=q(1− 2p)

1− p+ pq− (f + 2 + r −

1

1− p+ pq)(p− pq)s

1−1(1− q)(p2q + 1 + p2 − 2p) ≥ 0.

13

Page 14: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Thus

s∗1 =

[log(p− pq)]−1 logq(1− 2p)

((1− p+ pq)(f + 2 + r)− 1)(1− q)(p2q + 1 + p2 − 2p)

+ 1.

Simple calculation confirms that this above expression for s∗1 is indeed no less than 1. Moreover, fors ≥ s∗1 we have

Us+1 =(1− p)(−1 +Dt) + p(1 + Us)

=pUs + 2p− 1 + (1− p)[(1− p− q + pq)(1 + Us−1) + (−1 − r)(p+ q − pq)]

=pUs + (1− p)(1− p− q + pq)Ut−1 + 2p− 1− (1 + r)(1− p)(p+ q − pq)

=a1Us + a2Us−1 + a3

where a1 = p, a2 = (1 − p)(1 − p − q + pq), a3 = 2p − 1 − (1 + r)(1 − p)(p + q − pq). And the initialcondition for the iteration is

Us∗ = (p− pq)s∗

1(f + 2 + r −1

1− p+ pq)− 2− r +

1

1− p + pq,

Us∗−1 = (p− pq)s∗

1−1(f + 2 + r −

1

1− p+ pq)− 2− r +

1

1− p + pq.

In order to derive an explicit formula for Ut, we need to rewrite it as

Us+1 − a4 = a1(Us − a4) + a2(Us−1 − a4),

where a4 =a3

1−a1−a2. Solving this, we see

Us − a4 = A(a1 +

a21 + 4a22

)s−s∗1−1 +B(

a1 +√

a21 − 4a22

)s−s∗1−1,

where A and B satisfy the following linear equation systems:

A+B = a1Us∗1+ a2Us∗

1+ a3 − a4,

Aa1 +

a21 + 4a22

+Ba1 −

a21 + 4a22

= (a21 + a2)Us∗1+ a1a2Us∗

1−1 + a1a3 + a3 − a4.

Now we can compute s∗2, which is the largest integer satisfying the following inequality

(1− p)(1− q)

[

(p− pq)s(f + r + 2−1

1− p+ pq) +

1

1− p+ pq

]

− r − 1 ≥ f,

and get

s∗2 =

[log(p− pq)]−1 log(f + r + 1)(1− p+ pq)− (1− p)(1− q)

(1− p)(1− q)((f + 2 + r)(1− p+ pq)− 1)

One can verify from the expression of s∗2 that it is non-negative.

Finally one can calculate Ds as follows

Ds =

{

f, s ≤ s∗2;

(p+ (1− p)q)(−1− r) + (1− p)(1− q)(1 + Us−1), s > s∗2.

Our last step is to derive the optimal strategy for the special case s = T .

14

Page 15: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Theorem 13 (Threshold-type optimal strategy for s = T ). There exist up to two thresholds p∗1 and p∗2,with p∗1 ≤ p∗2 ∈ [0, 1], which separate [0, 1] into up to 3 intervals. Each interval corresponds to one of theactions: waiting/doing nothing, using the best bid orders, and using the market orders. In particular,the potential thresholds are from the following set:

{

DT−1 + r

DT−1 + (1− q)r − 2q − qUT−1

,f + r + 1

(1− q)(2 + r + UT−1),

f + 1−DT−1

UT−1 + 2−DT−1

}

.

Furthermore, when p = 0, placing best bid orders is always better than market orders, and when p = 1,placing best bid orders is always better than to wait.

Proof. Let CostL(T, p) be the expected cost with placing the best bid order with T steps left and theinitial probability of the first price change being up is p. Similarly we define CostN (T, p) and CostM(T, p)for placing no orders and using market orders, respectively. Then

CostL(T, p) = (1− p+ pq)(−1− r) + (p− pq)(1 + UT−1)

= p(1− q)(2 + r + UT−1)− 1− r,

CostN(T, p) = (1− p)(−1 +DT−1) + p(1 + UT−1)

= p(UT−1 + 2−DT−1)− 1 +DT−1,

CostM(T, p) = f.

Here CostM(T, p) is a constant, CostL(T, p), and CostN(T, p) are linear functions of p. It is easy tocheck their first order coefficients are positive as

(1− q)(2 + r + UT−1) ≥ (1− q)(2 + r − 2− r +p

(1− p)(p+ q − pq)

= (1− q)p

(1− p)(p+ q − pq)> 0,

UT−1 + 2−DT−1 ≥ 2 + min{ULT−1 −DL

T−1, UNT−1 −DN

T−1, UMT−1 −DM

T−1}

= 2 +min{(1− 2p− q + 2pq)(−2− r − UT−2), (1− 2p)(−2 +DT−2 − UT−2), 0}.

And since (1 − 2p − q + 2pq) < 1 and −2 − r − UT−2 ≥ − p

(1−p)(p+q−pq)> − 1

1−p> −2, thus −2 + (1 −

2p− q + 2pq)(−2 − r − UT−2) > 0. Note also DT−2 ≥ UT−2. Thus (1 − 2p)(−2 +DT−2 − UT−2) > −2.Therefore UT−1 + 2−DT−1 > 0. Thus CostL(T, p) and CostN(T, p) are increasing functions. It followsthen there are up to 3 intersections and each intersection represents the switch between two actions.Since one of the intersection is the switch between the action with the highest expected cost and theaction with the second highest cost, these intersections could be beyond the range of [0, 1]. Hence theremay be up to 2 thresholds. On each interval, one of the action is optimal. Furthermore, the (possible)thresholds are from the set of the intersections:

{

DT−1 + r

DT−1 + (1− q)r − 2q − qUT−1,

f + r + 1

(1− q)(2 + r + UT−1),

f + 1−DT−1

UT−1 + 2−DT−1

}

.

And CostL(T, 0) = −1 − r < f = CostM(T, 0), thus placing best bid orders are better than placingmarket orders when p = 0. Finally, when p = 1, placing best bid orders is better than waiting because

CostL(T, 1) = (1− q)(2 + r + UT−1)− 1− r

≤ 2 + r + UT−1 − 1− r

= (UT−1 + 2−DT−1)− 1 +DT−1

= CostN (T, 1).

15

Page 16: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

T S2*Best bid Market order

T S1*

Wait Best bid

The previous price change is up

The previous price change is down

Figure 2: Illustration of the optimal trading strategy

Remark 2. The threshold-type optimal strategy is expected given the Markov property of (At, At−1)or equivalently that of (At, Xt). The optimal strategy is in fact independent of At. This is not verysurprising because in the optimal placement problem, the best strategy is derived from comparing choicesof the best bid, the market order or no action at any given price level As, hence the absolute expectedvalue of each strategy is less relevant. (See Figure 2.)

Remark 3. For the degenerate case of p = p = 12, then checking with of the above analysis reveals that

it is always optimal to peg the bid.

Remark 4. If we let T = 1, then both the single-period model and multi-period model yield the sametrading strategy. To see this, we see that for the single period model, the best bid order is used if

p <r + f + 1

(r + f + 2)(1− q).

It implies that when r + f = 0 and q = 0, we choose the best bid order if the probability of price goingup is less than 1/2. And for the multi-period model, we have

CostL(1, p) = p(1− q)(2 + r + f)− 1− r,

≤ 2p− 1 + f,

= CostN (1, p).

Thus we only choose to place market orders or the best bid orders. And it is easy to see that whenp < r+f+1

(r+f+2)(1−q), the best bid order is better than the market order, and vice versa. This is consistent

with the single period model.

16

Page 17: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

2.2 A Model with Price Impact

In the previous model, we assume no price impact from any market or limit orders. In this section, wewill add price impact factor on both limit orders and market orders.

To make the analysis more feasible, our model will focus on the limit order book with market ordersand the best limit orders, and assume that the price impact of market and limit orders is linear andadditive. These assumptions are consistent with the empirical study of Cont, Kukanov, and Stoikov(2013)[19] as well as the modelling framework of optimal execution problems with price impact.

Dynamics of the price model and analysis. Let At be the best ask price at time t, {ǫt}t=1,2,··· ,Tis an i.i.d. random sequence with mean 0. Then the dynamics of At is modeled as:

At+1 = At + c1mt + c2Itlt + ǫt+1, (2.12)

with A0 = 0,

It =

{

1 if the limit order was executed by time t,

0 if the limit order was not executed by time t,(2.13)

Here c1 and c2 are the price impact factor for market orders and limit orders, and mt and lt are theorder sizes placed at time t for market orders and limit orders, respectively.

Now, take r the rebate for an executed limit order and f the transaction fee for a market order asbefore. At each time, a limit order will be executed with probability one at the price of 1 tick lowerthan At. Note that independent of whether the limit order is executed or not, the transaction price fora market order and limit order at time t will be At+ c1mt+ c2lt+ ǫt+ f and At+ c1mt+ c2lt+ ǫt−1− r,correspondingly. For simplification and ease of exposition, and without much loss of generality, weassume that c1 = c2 = c. In reality, it has been observed that c1 > c2 since the market order willaffect the trading directly and immediately while a large limit order may take longer time. But thisdifferentiation of c1 and c2 will not change much of the structural results of our analysis and we opt forclarity of exposition.

Clearly, because of the price impact, the reduction of a general N to N = 1 is no longer valid. NowEqn. (2.13) is rewritten as

At+1 = At + c(mt + Itlt) + ǫt+1. (2.14)

Moreover, we assume that the probability of the limit orders being executed is pl.Let Ct(nt, mt, lt, At) be the expected cost at time t with current price of At, 0 ≤ nt ≤ N shares

left to purchase, placing limit order of lt and market order of mt. Let Vt(nt, At) be the expected costafter optimization over mt and lt. Then according to the dynamic programming principle, the optimalplacement problem can be formulated as

Vt(nt, At) = min≤mt,ltmt+lt≤nt

Ct(nt, mt, lt, At), 1 ≤ t ≤ T − 1, (2.15)

VT (nT , AT ) =nT (f + AT + cnT ). (2.16)

subject to Eqn. (2.14), with

Ct(nt, mt, lt, At) =E{mt(f + At + c(mt + lt) + ǫt) + pllt(At − r − 1 + c(mt + lt) + ǫt)

+ plVt+1(nt −mt − lt, At + c(mt + lt) + ǫt) + (1− pl)Vt+1(nt −mt, At + cmt + ǫt)}.

By mathematical induction, it is easy to check the following lemma

17

Page 18: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Lemma 14. For 0 ≤ t ≤ T − 1,

Ct(nt, mt, lt, x) = Ct(nt, mt, lt, 0) + xnt,

and

Vt(nt, x) = Vt(nt, 0) + xnt.

Proof. First, this lemma is valid for t = T − 1 since

CT−1(nT−1, mT−1, lT−1, AT−1)

=E{mT−1(f + AT−1 + c(mT−1 + lT−1) + ǫT−1) + pllT−1(AT−1 − r − 1 + c(mT−1 + lT−1) + ǫT−1)

+ pl(nT−1 −mT−1 − lT−1)(AT−1 + c(mT−1 + lT−1) + c(nT−1 −mT−1 − lT−1) + ǫT−1 + ǫT )

+ (1− pl)(nt −mt)(At + cmt + c(nT−1 −mT−1) + ǫT−1 + ǫT )}

=mT−1(f + AT−1 + c(mT−1 + lT−1)) + pllT−1(AT−1 − r − 1 + c(mT−1 + lT−1))

+ pl(nT−1 −mT−1 − lT−1)(AT−1 + cnT−1) + (1− pl)(nT−1 −mT−1)(AT−1 + cnT−1)

=nT−1AT−1 +mT−1(f + c(mT−1 + lT−1)) + pllT−1(−r − 1 + c(mT−1 + lT−1))

+ pl(nT−1 −mT−1 − lT−1)(cnT−1) + (1− pl)(nT−1 −mT−1)(cnT−1)

=nT−1AT−1 + CT−1(nT−1, mT−1, lT−1, 0).

And because the coefficient of AT−1 is nT−1,

VT−1(nT−1, AT−1) = minCT−1(nT−1, mT−1, lT−1, AT−1)

= nT−1AT−1 +minCT−1(nT−1, mT−1, lT−1, 0)

= nT−1AT−1 + VT−1(nT−1, 0).

Thus the assertion holds for k = T − 1. Assume that this is true for some k = t+1 with t ≥ 0, then fork = t,

Ct(nt, mt, lt, At)

=E{mt(f + At + c(mt + lt) + ǫt) + pllt(At − r − 1 + c(mt + lt) + ǫt)

+ plVt+1(nt −mt − lt, At + c(mt + lt) + ǫt) + (1− pl)Vt+1(nt −mt, At + cmt + ǫt)}

=mt(f + At + c(mt + lt)) + pllt(At − r − 1 + c(mt + lt))

+ E{pl[Vt+1(nt −mt − lt, 0) + (nt −mt − lt)(At + c(mt + lt) + ǫt)]}

+ E{(1− pl)[Vt+1(nt −mt, 0) + (nt −mt)(At + cmt + ǫt)}

=ntAt + Ct(nt, mt, lt, 0).

And

Vt(nt, At) = minCt(nt, mt, lt, At)

= ntAt +minCt(nt, mt, lt, 0).

= ntAt + Vt(nt, 0).

Thus we see that the lemma holds for k = t if it holds for k = t + 1. By the recursive induction, thelemma is valid for 0 ≤ t ≤ T − 1.

This implies that the influence of the current price is a linear shift to the total cost and will notaffect the optimization over mt and lt. Thus

(Mt, Lt) = arg min0≤mt,ltmt+lt≤nt

Ct(mt, lt, nt, At)

is independent of At.

18

Page 19: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Properties of the optimal strategy for period t. The above analysis suggests that Mt and Lt arefunctions of T−t and nt. To make notations simpler, let a = r+f+1

cbe the normalized difference between

market order and limit order and write Ct(nt, mt, lt) and Vt(nt) for Ct(nt, mt, lt, r+ 1) and Vt(nt, r+ 1),respectively. We see for 0 ≤ t ≤ T − 1,

Ct(nt, mt, lt) =mt(mt + lt + a) + pllt(mt + lt) + pl[Vt+1(nt −mt − lt) + (mt + lt)(nt −mt − lt)]

+ (1− pl)[Vt+1(nt −mt) +mt(nt −mt)]

=amt + ntmt + plntlt + (1− p)mtlt + plVt+1(nt −mt − lt) + (1− p)Vt+1(nt −mt)

Theorem 15. For any t and nt, we have Mt ·Lt = 0. That is, the optimal strategy involves either marketorder or limit order at each step but never both. Moreover, Vt(nt) is a piece-wise quadratic function ofnt with the second order coefficients within (1/2, 1].

Proof. The proof is by mathematical induction.First, for t = T , MT = nT and LT = 0. Thus VT (nT ) = n2

T + anT .Second, suppose the theorem holds for t + 1, and z1 is the second order coefficient of Vt+1(nt+1) within(1/2, 1]. Note that Vt+1 is a piece-wise quadratic function, z1 depends on nt+1 and piecewise constant.Thus the Hessian of Ct is

H(Ct) =

(

2z1 1− pl + 2z1p1− pl + 2z1pl 2z1pl

)

.

Since z1 > 0 and4z21 − (1 − pl + 2z1pl) = −(1 − pl)2 − (1 − pl)(1 − z1) < 0, meaning the Hessian of

Ct is neither semi-positive nor semi-negative. Thus the possible minimum value will only reach on theboundary. Notice that Vt+1 is a piece-wise quadratic function, we also need to consider the pairs of(mt, lt) which makes (nt − mt − lt) or (nt − mt) locates on the thresholds of Vt+1. Suppose A is athreshold of Vt+1 and mt + lt = A. Then

C ′′t (lt) = −2(1− pl) + 2(1− pl)z1 ≤ 0,

implying that Lt = 0,Mt = A or Lt = A,Mt = 0. Similarly, we can show that in the case of Lt = A orMt = A, Ct will be a quadratic function with a negative second order coefficient. Thus Mt ·Lt = 0 for t.

Next, let us calculate Vt. In the case of lt = 0,

Ct = amt + ntmt + Vt+1(nt −mt),

which is a piece-wise quadratic function of mt. On each piece, if not on the boundary of that piece, theoptimal solution Mt is a linear function of nt with coefficient a1 = 1− 1/(2z1), which is in the range of(0, 1/2]. Then the second order coefficient of Vt is z1(1− a1)

2+ a21 < 1. And if Mt is on the boundary ofthat piece, then Mt is still a linear function of nt with the first order coefficient of 1. Then the secondorder coefficient of Vt is z1(1− a1)

2 + a21 = 1. Similarly for the case of mt = 0,

Ct = plntlt + plVt+1(nt − lt) + (1− pl)Vt+1(nt).

Therefore Lt is a linear function of nt with the first order coefficient no greater than 1, denoted by b1.Then the second order coefficient of Vt is plz1(1 − b1)

2 + plb21 + (1 − pl)z1 ≤ 1. Therefore the theorem

holds for t. By the mathematical induction, it holds for all t ≤ T .

19

Page 20: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

2.3 Optimal Placement vs. Optimal Execution: Connection to Bertsimasand Lo (1998)[10]

The study of the optimal execution problem is pioneered in Bertsimas and Lo (1998)[10], where thestock price is modelled by a simple random walk with an additive impact of large sales. An intriguingconsequence of this modelling approach is that the optimal strategy turns out to be more or less staticor deterministic. That is, evenly dividing the total number of shares N over the T selling period isoptimal.

Obviously, specifying pl = 1 or pl = 0 will reduce our model with price impact to the model ofBertsimas and Lo. In fact, we can show that in this special case the optimal strategy is the same astheirs. Indeed in the case of pl = 1 meaning the limit order will be executed for sure, then the marketorder is always dominated by the limit order. In Equation (2.17), substitute pl with 1, and use limitorders at the last period, we get

VT−1(x,AT−1) = min0≤mT−1,lT−1

mT−1+lT−1≤x

{

lT−1(−1− r + c(mT−1 + lT−1) + AT−1) + (x−mT−1 − lT−1)(xc+ AT−1 − r − 1)

+mT−1(f + c(mT−1 + lT−1) + AT−1)}

= min0≤mT−1,lT−1

mT−1+lT−1≤x

{

c(mT−1 + lT−1)2 − (cx− r − f − 1)(mT−1 + lT−1)− (r + f + 1)lT−1

+ x(AT−1 + cx− r − 1)}

.

Since (mT−1, lT−1) is always dominated by (0, mT−1+lT−1) if both of them are feasible, we haveMT−1 = 0,and

VT−1(x,AT−1) = min0≤lT−1≤x

cl2T−1 − cxlT−1 + x(AT−1 + cx− r − 1),

whose minimum is of 3cx2/4+x(AT−1−r−1) at lT−1 =x2. Inductively, suppose (Mt+1 = 0, Lt+1 = x/(T − t))

is the optimal solution for the period t, 0 ≤ t ≤ T−1 and Vt+1(x,At+1) = cx2(1+1/(T−t))/2+x(At+1−r − 1). Then at time t,

Ct(x,mt, lt, At) =mt(At + c(mt + lt) + f) + lt(At + c(mt + lt)− r − 1)

+ c(x−mt − lt)2(1 + 1/(T − t))/2 + (x−mt − lt)(At + c(mt + lt)− r − 1)

=T − t+ 1

2(T − t)c(mt + lt)

2 −1

T − t(cx− r − f − 1)(mt + lt) +

T − t + 1

2(T − t)cx2

+ x(At − r − 1)− (r + f + 1)lt.

Thus, for any feasible solution (mt, lt), (0, mt + lt) is always better if mt > 0. Hence Mt = 0. Furthersimple calculation concludes that

Lt =x

T − t + 1,

Et(x,At) =cx2(1 + 1/(T − t + 1))/2 + x(At − r − 1).

Thus by mathematical induction, the optimal strategy is to always use limit orders, and if there areT periods in total, then each time one places 1/T of the total volume. If pl = 0, which means thelimit order will not be executed, then similarly one can show that the optimal trading strategy is to usemarket orders only and to equally divide the total volume for each period.

20

Page 21: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

Example 1. To get a sense of the computational complexity, we give some illustration for t = T − 1with an explicit optimal strategy. Clearly,

V (x,AT−1) = min0≤mT−1,lT−1

mT−1+lT−1≤x

mT−1(f + c(mT−1 + lT−1) + AT−1)

+ pl[lT−1(−1− r + c(mT−1 + lT−1) + AT−1) + (x−mT−1 − lT−1)(f + xc+ AT−1)]

+ (1− pl)(x−mT−1)(f + xc + AT−1). (2.17)

For any fixed x and AT−1, the RHS of (2.17) is a quadratic function of mt−1 and lt−1, whose Hessian is(

2 pl + 1pl + 1 2pl

)

, (2.18)

whose determinant is −(pl − 1)2 < 0 for pl < 1. Clearly this Hessian is neither positive definite nornegative definite for all mt−1 and lt−1. Thus the function will reach its minimum only on the boundary.Moreover,

• If pl <14, then there are two scenarios:

1. For 0 ≤ x ≤ 4plr+f+1

c, then MT−1 = 0, LT−1 = x;

2. For 4plr+f+1

c< x, then MT−1 =

12x, LT−1 = 0.

• If 14< pl ≤ 1, then there are three scenarios:

1. 0 ≤ x ≤ r+f+1c

, then MT−1 = 0, LT−1 = x;

2. r+f+1c

< x ≤ r+f+1c

√pl

1−√pl, then MT−1 = 0, LT−1 =

r+f+1+cx

2c;

3. r+f+1c

√pl

1−√pl< x, then MT−1 =

12x, LT−1 = 0.

3 Summary and Discussions

This paper presents some simple and stylish models for the optimal placement problem in the LOB andanalyzes optimal strategies in each model. There are many possibilities to generalize the models. Forinstance, one could consider the possibility of an intermediate selling, which brings the optimal place-ment problem closer to the market making problem, where trading strategies involve simultaneouslyplacing limit and market orders to buy and sell. The idea then is to maximize the profit by playingwith the spread between the bid and ask prices, while controlling the inventory risk and the executionrisk. See for example, Avelaneda and Stoikov (2008) [8], Bayraktar and Ludkovski (2012)[9], Cartea andJaimungal (2013) [14], Cartea, Jaimugal, and Ricci (2011)[15], Veraarta (2010)[49], Guilbaud and Pham(2011) [29], Gueant, Lehalla, and Tapia (2012) [28], and Horst, Lehalle and Li (2013) [33]. There arealso order scheduling problems especially when orders can be placed in different exchanges with differentfee structures. See Laruelle, Lehalle, and Pages (2011) [37] and Cont and Kukanov (2012) [18].

Acknowledgement: The first author would like to thank R. Cont, S. Jaimungal, A. Kercheval, A.de Larrard, D. Leinweber, J. Ma, C. Moallemi, J. Wu, S. Wong, K. Wong, and the participants inWCMF 2012, SIAM Conference on Financial Mathematics and Engineering 2012, and IMS-FPS2013for comments and discussions. Generous financial and data support from NASDAQ OMX EducationGroup, New York, and CASH Dynamic Opportunities Investment Lt., Hong Kong is acknowledged.

21

Page 22: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

References

[1] Alfonsi, A., Fruth, A. and Schied, A. (2010). Optimal execution strategies in limit order bookswith general shape functions. Quantitative Finance, 10(2), 143-157.

[2] Alfonsi, A., Schied, A. and Slynko, A. (2012). Order book resilience, price manipulation, and thepositive portfolio problem. SIAM J. on Financial Mathematics, 3, 511-533.

[3] Allaart, P. (2004). Optimal stopping rules for correlated random walks with a discount. J. Appl.Probab., 41(2), 483–496.

[4] Almgren, R. (2003). Optimal execution with nonlinear impact function and trading enhanced risk.Applied Mathematical Finance, 10, 1-18.

[5] Almgren, R. and Chriss, N. (1999). Value under liquidation. Risk, 12, 61–63.

[6] Almgren, R. and Chriss, N. (2000). Optimal execution of portfolio transactions. Journal of Risk,3, 5–39.

[7] Almgren, R. and Lorenz, J. (2007). Adaptive arrival price. Institutional Investor Journals, 1, 59-66.

[8] Avellaneda, M. and Stoikova, S. (2008) High-frequency trading in a limit order book. QuantitativeFinance, 8(3), 217–224.

[9] Bayraktar, E. and Ludkovski, M. (2012). Liquidation in limit order books with controlled intensity.Mathematical Finance, to appear.

[10] Bertsimas, D. and Lo, A.W. (1998). Optimal control of execution codes. Journal of FinancialMarkets, 1, 1–50.

[11] Biais, B., Hillion, P., and Spatt, C. (1995). An empirical analysis of the limit order book and theorder flow in the Paris Bourse. Journal of Finance, 50(5), 1655–1689.

[12] Bouchaud, J-P., Mezard, M., and Potters, M. (2002). Statistical properties of stock order books:Empirical results and models. Quantitative Finance, 2, 251–256.

[13] Brogaard, J., Hendershott, T., and Riordan, R. (2012). High frequency trading and price discovery.Working Paper.

[14] Cartea, A. and Jaimungal, S. (2013). Modeling asset prices for algorithmic and high frequencytrading. Applied Mathematical Finance, Forthcoming.

[15] Cartea, A., Jaimungal, S., and Ricci, J. (2011). Buy low sell high: A high frequency tradingperspective. Preprint. University College London.

[16] Chen, F. and Hall, P. (2013) Inference for a non-stationary self-exciting point process with anapplication in ultra-high frequency financial data modeling” Journal of Applied Probability, Forth-coming.

[17] Cont, R. (2011) Statistical Modeling of High Frequency Financial Data: Facts, Models and Chal-lenges. IEEE Signal Processing, Volume 28, No 5, 16-25.

[18] Cont, R. and Kukanov, A. (2012). Optimal order placement in limit order markets. Preprint.

22

Page 23: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

[19] Cont, R., Kukanov, A., and Stoikov, S. (2013). The price impact of order book events. Jornal ofFinancial Econometrics, Forthcoming.

[20] Cont, R., Talreja, R., and Stoikov, S. (2010) A stochastic model for order book dynamics. OperationsResearch, 58(3), 549-563.

[21] Cvitanic, J. and Kirilenko, A. (2010). High-frequency traders and asset prices. Working paper.

[22] Easley, D., de Prado, L. M., and O’Hara, M. (2012). Flow toxicity and liquidity in a high-frequencyworld. Review of Financial Studies, 25(5), 1457–1493.

[23] Forsyth, P.A., Kennedy, J. S., Tse, S. T. and Windcliff, H. (2011). Optimal trade execution: amean-quadratic-variation approach. Preprint.

[24] Gatheral, J. (2010). No-dynamic-arbitrage and market impact. Quantitative Finance, 10(7), 749-759.

[25] Gatheral, J. and Schied, A. (2011). Optimal trade execution under geometric Brownian motion inthe Almgren and Chriss framework. International Journal on Theoretical and Applied Finance, 14(3), 353-368.

[26] Gillis, J. (1955). Correlated random walk Mathematical Proceedings of the Cambridge PhilosophicalSociety. 51(4), 639–651.

[27] Goldstein, S. (1951). On diffusion by discontinuous movements, and on the telegraph equation.The Quarterly Journal of Mechanics and Applied Mathematics. 4(2), 129–156.

[28] Gueant, O., Lehalle, C-A., and Tapia, F. J. (2012). Optimal portfolio liquidation with limit orders.Preprint.

[29] Guilbaud, F. and Pham, H. (2013). Optimal high frequency trading with limit and market orders.Quantitative Finance, 13(1), 79-94.

[30] Guo, X., and Zervos, M. (2012). Optimal execution with nonlinear and multiplicative price impactPreprint.

[31] He, H. and Mamaysky. (2005). Dynamic trading with price impact. Journal of Economic Dynamicsand Control, 29, 891-930.

[32] Hollifield, B., Miller, R. A., and Sandas, P. (2004). Empirical analysis of limit order markets.Review of Economic Studies, 71, 1024–1063.

[33] Horst, U., Lehalle, C-A. , and Li Q. H. (2013). Optimal trading in a two-sided limit order book.Preprint.

[34] Huberman, G. and Stanzl, W. (2004). Price manipulation and quasi-arbitrage. Econometrica,72(4), 1247–1275.

[35] Hult, H. and Kiessling, J. (2010). Algorithmic trading with Markov chains, Doctoral thesis, Stock-holm University, Sweden.

[36] Kirilenko, A., Kyle A., Samadi M., and Tuzun T. (2011). The flash crash: the impact of highfrequency trading on an electronic market. Preprint.

23

Page 24: OptimalPlacementinaLimitOrderBook - XIN GUO · 2018. 10. 8. · Optimal placement problem is closely related to but different from the well-known optimal execution problem, in which

[37] Laruelle, S., Lehalle, C-A, and Pages, G. (2011). Optimal split of orders across liquidity pools: astochastic algorithm approach. SIAM Journal on Financial Mathematics, 2(1), 1042-1076.

[38] Moallemi, C., Park, B. and Van Roy, B. (2009). The execution game. Working paper.

[39] Mohan, C. (1955). The gambler’s ruin problem with correlation. Biometrika, 42(3/4), 486–493.

[40] Renshaw, E. and Henderson, R. (1981). The correlated random walk. Journal of Applied Probability.403–414

[41] Redner, Sidney (2001). A guide to first-passage processes. Cambridge University Press.

[42] Obizhaeva, A. and Wang, J. (2013). Optimal trading strategy and supply/demand dynamics.Journal of Financial Markets, 16(1), 1-32.

[43] Predoiu, S., Shaikhet,G., and Shreve, S. (2011). Optimal execution in a general one-sided limit-orderbook. SIAM J. Finan. Math. 2, 183-212.

[44] Potters, M. and Bouchaud, J-P. (2003). More statistical properties of order books and price impact.Physica A, 3(24), 133-140.

[45] Renshaw, E. and Henderson, R. (1981). The correlated random walk. Journal of Applied Probability,18(2), 403–414.

[46] Rosu, I. (2009) A Dynamic model of the limit order book. Review of Financial Studies 22, 4601–4641.

[47] Schied, I. and Schoneborn, T. (2009). Risk aversion and the dynamics of optimal liquidationstrategies in illiquid markets. Finance and Stochastics, 13, 181–204.

[48] Schied, I., Schoneborn, T., and Tehranchi (2010). Optimal basket liqudition for CARA investors isdeterministic. Applied Mathematical Finance, 17(6), 471–489.

[49] Veraarta, L. A. M. (2010). Optimal market making in the foreign exchange market. AppliedMathematical Finance, 17(4), 359–372.

[50] Weiss, A. (2009). Executing large orders in a microscopic market model. Available athttp://arxiv.org/abs/0904.4131v1.

[51] Zheng, B., Moulines, E., and Abergel, F. (2012). Price jump prediction in limit order book. WorkingPaper.

24