High Frequency Trading in A Limit Order Book
High Frequency Trading in A Limit Order Book
High Frequency Trading in A Limit Order Book
to model these arrival rates, we will draw on recent results stock evolves according to
in econophysics. One of the important achievements of
dSu ¼ dWu ð1Þ
this literature has been to explain the statistical properties
of the limit order book (see Bouchaud et al. 2002, with initial value St ¼ s. Here Wt is a standard one-
Luckock 2003, Potters and Bouchaud 2003, Smith et al. dimensional Brownian motion and is constant.y
2003). The focus of these studies has been to reproduce Underlying this continuous-time model is the implicit
the observed patterns in the markets by introducing ‘zero assumption that our agent has no opinion on the drift or
intelligence’ agents, rather than modelling optimal stra- any autocorrelation structure for the stock.
tegies of rational agents. One possible exception is the This mid-price will be used solely to value the agent’s
work of Luckock (2003), who defines a notion of optimal assets at the end of the investment period. He may not
strategies, without resorting to utility functions. Though trade costlessly at this price, but this source of random-
our objective is different to that of the econophysics ness will allow us to measure the risk of his inventory in
literature, we will draw on their results to infer reasonable stock. In section 2.4 we will introduce the possibility to
arrival rates of buy and sell orders. In particular, trade through limit orders.
the results that will be most useful to us are the size
distribution of market orders (Maslow and Mills 2001,
Weber and Rosenow 2005, Gabaix et al. 2006) and the
2.2. The optimizing agent with finite horizon
temporary price impact of market orders (Bouchaud et al.
2002, Weber and Rosenow 2005). The agent’s objective is to maximize the expected
Our approach, therefore, is to combine the utility exponential utility of his P&L profile at a terminal
framework of the Ho and Stoll approach with the time T. This choice of convex risk measure is particularly
microstructure of actual limit order books as described convenient, since it will allow us to define reservation
in the econophysics literature. The main result is that the (or indifference) prices which are independent of the
optimal bid and ask quotes are derived in an intuitive agent’s wealth.
two-step procedure. First, the dealer computes a personal We first model an inactive trader who does not have
indifference valuation for the stock, given his current any limit orders in the market and simply holds an
inventory. Second, he calibrates his bid and ask quotes to inventory of q stocks until the terminal time T.
the limit order book, by considering the probability with This ‘frozen inventory’ strategy will later prove to be
which his quotes will be executed as a function of their useful in the case when limit orders are allowed.
distance from the mid-price. In the balancing act between The agent’s value function is
the dealer’s personal risk considerations and the market
environment lies the essence of our solution. vðx, s, q, tÞ ¼ Et ½expððx þ qST Þ,
The paper is organized as follows. In section 2, we where x is the initial wealth in dollars. This value function
describe the main building blocks for the model: the can be written as
dynamics of the mid-market price, the agent’s utility 2 2 2
objective and the arrival rate of orders as a function of q ðT tÞ
vðx, s, q, tÞ ¼ expðxÞ expðqsÞ exp ,
the distance to the mid-price. In section 3, we solve for 2
the optimal bid and ask quotes, and relate them to the ð3Þ
reservation price of the agent, given his current inventory.
We then present an approximate solution, numerically which shows us directly its dependence on the market
simulate the performance of our agent’s strategy parameters.
and compare its Profit and Loss (P&L) profile to that We may now define the reservation bid and ask prices
of a benchmark strategy. for the agent. The reservation bid price is the price that
would make the agent indifferent between his current
portfolio and his current portfolio plus one stock.
The reservation ask price is defined similarly below.
2. The model We stress that this is a subjective valuation from the point
of view of the agent and does not reflect a price at which
2.1. The mid-price of the stock trading should occur.
For simplicity, we assume that money market pays no Definition 1. Let v be the value function of the agent.
interest. The mid-market price, or mid-price, of the His reservation bid price rb is given implicitly by the
yWe choose this model over the standard geometric Brownian motion to ensure that the utility functionals introduced in the sequel
remain bounded. In practical applications, we could also use a dimensionless model such as
dSu
¼ dWu ð2Þ
Su
with initial value St ¼ s. To avoid mathematical infinities, exponential utility functions could be modified to a standard mean/
variance objective with the same Taylor-series expansion. The essence of the results would remain. More details regarding the model
(2) with mean/variance utility are given in the appendix.
Feature 219
Downloaded By: [Mt Sinai School of Medicine, Levy Library] At: 23:19 28 April 2008
2.5. The trading intensity Alternatively, since we are interested in short term
liquidity, the market impact function could be derived
One of the main objectives of the econophysics commu-
directly by integrating the density of the limit order book.
nity has been to describe the laws governing the
This procedure is described in Smith et al. (2003) and
microstructure of financial markets. Here, we will be
Weber and Rosenow (2005) and yields what is sometimes
focusing on the results which address the Poisson
called the ‘virtual’ price impact.
intensity with which a limit order will be executed as
a function of its distance to the mid-price. In order to
quantify this, we need to know statistics on (i) the overall 3. The solution
frequency of market orders, (ii) the distribution of their
size and (iii) the temporary impact of a large market 3.1. Optimal bid and ask quotes
order. Aggregating these results suggests that should
decay as an exponential or a power law function. Recall that our agent’s objective is given by the value
For simplicity, we assume a constant frequency of function
market buy or sell orders. This could be estimated by uðs, x, q, tÞ ¼ max Et ½expððXT þ qT ST ÞÞ ð13Þ
dividing the total volume traded over a day by the average a , b
size of market orders on that day. where the optimal feedback controls a and b will turn
The distribution of the size of market orders has been out to be time and state dependent. This type of optimal
found by several studies to obey a power law. In other dealer problem was first studied by Ho and Stoll (1981).
words, the density of market order size is One of the key steps in their analysis is to use the dynamic
programming principle to show that the function u solves
f Q ðxÞ / x1 ð9Þ
the following Hamilton–Jacobi–Bellman equation
for large x, with ¼ 1.53 in Gopikrishnan et al. (2000) 8
> 1 2
for US stocks, ¼ 1.4 in Maslow and Mills (2001) >
> ut þ 2 uss þ max b ðb Þ uðs, x s þ b, q þ 1, tÞ
>
> b
for shares on the NASDAQ and ¼ 1.5 in Gabaix et al. >
>
>
(2006) for the Paris Bourse. < uðs, x, q, tÞ þ max a ða Þuðs, x þ s þ a, q 1, tÞ
>
a
There is less consensus on the statistics of the market >
>
>
impact in the econophysics literature. This is due to a >
> uðs, x, q, tÞ ¼ 0,
>
>
general disagreement over how to define it and how to >
>
:
measure it. Some authors find that the change in price p uðs, x, q, TÞ ¼ expððx þ qsÞÞ:
following a market order of size Q is given by
The solution to this nonlinear PDE is continuous in
p / Q ,
ð10Þ the variables s, x and t and depends on the discrete
values of the inventory q. Due to our choice of
where ¼ 0.5 in Gabaix et al. (2006) and ¼ 0.76 in exponential utility, we are able to simplify the problem
Weber and Rosenow (2005). Potters and Bouchaud with the ansatz
(2003) find a better fit to the function
uðs, x, q, tÞ ¼ expðxÞ expð ðs, q, tÞÞ: ð14Þ
p / lnðQÞ: ð11Þ
Direct substitution yields the following equation for :
Aggregating this information, we may derive the 8
>
> t þ ð1=2Þ 2 ss ð1=2Þ 2 s2
Poisson intensity at which our agent’s orders are >
>
>
> b b
executed. This intensity will depend only on the distance >
> ð Þ
>
> ðs b r b Þ
of his quotes to the mid-price, i.e. b(b ) for the arrival of < þ max
>
b
½1 e
sell orders and a(a ) for the arrival of buy orders. ð15Þ
> a a
For instance, using (9) and (11), we derive >
> ð Þ ðsþa r a Þ
>
> þ max ½1 e ¼ 0;
>
>
>
> b
ðÞ ¼ Pðp4Þ >
>
:
ðs, q, TÞ ¼ qs:
¼ Pð lnðQÞ4KÞ
Applying the definition of reservation bid and ask prices
¼ PðQ4 expðKÞÞ (given in section 2.2) to the ansatz (14), we find that rb and
Z1 ra depend directly on this function . Indeed,
¼ x1 dx
expðKÞ rb ðs; q; tÞ ¼ ðs; q þ 1; tÞ ðs; q; tÞ ð16Þ
¼ A expðkÞ ð12Þ is the reservation bid price of the stock, when the
inventory is q and
where A ¼ / and k ¼ K. In the case of a power price
r a ðs, q, tÞ ¼ ðs, q, tÞ ðs, q 1, tÞ ð17Þ
impact (10), we obtain an intensity of the form
is the reservation ask price, when the inventory is q.
ðÞ ¼ B= : From the first-order optimality condition in (15),
Feature 221
Downloaded By: [Mt Sinai School of Medicine, Levy Library] At: 23:19 28 April 2008
we obtain the optimal distances b and a. They are given Using equations (24) and (23), along with the optimality
by the implicit relations conditions (18) and (19), we find that the optimal pricing
strategy amounts to quoting a spread of
b b 1 b ðb Þ
s r ðs; q; tÞ ¼ ln 1
ð@b =@Þðb Þ
ð18Þ 2
a þ b ¼ 22 ðs; tÞ þ ln 1 þ ð25Þ
k
and
around the reservation price given by
a 1
a a ða Þ
r ðs, q, tÞ s ¼ ln 1 : ð19Þ ra þ rb
ð@a =@Þða Þ rðs, q, tÞ ¼ ¼ 1 ðs, tÞ þ 2q2 ðs, tÞ:
2
In summary, the optimal bid and ask quotes are
The term 1 can be interpreted as the reservation price,
obtained through an intuitive, two-step procedure.
when the inventory is zero. The term 2 may be interpreted
First, we solve the PDE (15) in order to obtain the
as the sensitivity of the market maker’s quotes to changes
reservation bid and ask prices rb(s, q, t) and ra(s, q, t).
in inventory. For instance, since 2 will turn out to be
Second, we solve the implicit equations (18) and (19) and
negative, accumulating a long position q40 will result in
obtain the optimal distances b(s, q, t) and a(s, q, t)
aggressively low quotes.
between the mid-price and optimal bid and ask quotes.
The bid–ask spread in (25) is independent of the
This second step can be interpreted as a calibration of our
inventory. This follows from our assumption of exponen-
indifference prices to the current market supply b and
tial arrival rates. The spread consists of two components,
demand a.
one that depends on the sensitivity to changes in inventory
2 and one that depends on the intensity of arrival of
orders, through the parameter k.
3.2. Asymptotic expansion in q Taking a first-order approximation of the order arrival
The main computational difficulty lies in solving term
equation (15). The order arrival terms (i.e. the terms A a b A
to be maximized in the expression) are highly nonlinear ðek þ ek Þ ¼ 2 kða þ b Þ þ , ð26Þ
kþ kþ
and may depend on the inventory. We therefore
suggest an asymptotic expansion of in the inventory we notice that the linear term does not depend on the
variable q, and a linear approximation of the order inventory q. Therefore, if we substitute (22) and (26) into
arrival terms. In the case of symmetric, exponential (21) and group terms of order q, we obtain
arrival rates 8
< 1 þ 1 2 1 ¼ 0,
t ss
a ðÞ ¼ b ðÞ ¼ Aek ; ð20Þ 2 ð27Þ
: 1
ðs, T Þ ¼ s;
the indifference prices ra(s, q, t) and rb(s, q, t) coincide
with their ‘frozen inventory’ values, as described in whose solution is 1(s, t) ¼ s. Grouping terms of order q2
section 2.2. yields
Substituting the optimal values given by equations (18) 8
and (19) into (15) and using the exponential arrival rates, < 2 þ 1 2 2 1 2 ð1 Þ2 ¼ 0
t ss s
we obtain 2 2 ð28Þ
: 2
ðs, T Þ ¼ 0:
8
> 1 1 A a b
< t þ 2 ss 2 s2 þ ðek þ ek Þ ¼ 0, whose solution is 2 ¼ ð1=2Þ 2 ðT tÞ. Thus, for this
2 2 kþ
> linear approximation of the order arrival term, we obtain
:
ðs, q, T Þ ¼ qs: the same indifference price
ð21Þ rðs; tÞ ¼ s q 2 ðT tÞ ð29Þ
Consider an asymptotic expansion in the inventory
as for the ‘frozen inventory’ problem from section 2.2.
variable
We then set a bid/ask spread given by
1
ðq, s, tÞ ¼ 0 ðs, tÞ þ q1 ðs, tÞ þ q2 2 ðs, tÞ þ : ð22Þ 2
2 a þ b ¼ 2 ðT tÞ þ ln 1 þ ð30Þ
k
The exact relations for the indifference bid and ask prices,
around this indifference or reservation price. Note that
(16) and (17), yield
if we had taken a quadratic approximation of the order
r b ðs, q, tÞ ¼ 1 ðs, tÞ þ ð1 þ 2qÞ2 ðs, tÞ þ ð23Þ arrival term, we would still obtain 1 ¼ s, but the
sensitivity term 2(s, t) would solve a nonlinear PDE.
and Equations (29) and (30) thus provide us with simple
expressions for the bid and ask prices in terms
r a ðs, q, tÞ ¼ 1 ðs, tÞ þ ð1 þ 2qÞ2 ðs, tÞ þ : ð24Þ of our model parameters. This approximate solution
222 Feature
Downloaded By: [Mt Sinai School of Medicine, Levy Library] At: 23:19 28 April 2008
100
References
80
Biais, B., Glosten, L. and Spatt, C., Market microstructure: a
60
server of microfoundations, empirical results and policy
40 implications. J. Financ. Markets, 2005, 8, 217–264.
Bouchaud, J.-P., Mezard, M. and Potters, M., Statistical
20 properties of stock order books: empirical results and
0 models. Quant. Finance, 2002, 2, 251–256.
50 0 50 100 150 Gabaix, X., Gopikrishnan, P., Plerou, V. and Stanley, H.E.,
Institutional investors and stock market volatility. Quart.
Figure 3. ¼ 0.01. J. Econ., 2006, 121, 461–504.
Gopikrishnan, P., Plerou, V., Gabaix, X. and Stanley, H.,
Statistical properties of share volume traded in financial
markets. Phys. Rev. E, 2000, 62, R4493–R4496.
Table 3. 1000 simulations with ¼ 1. Ho, T. and Macris, R., Dealer bid–ask quotes and transaction
Average Std Std prices: an empirical study of some AMEX options. J. Finance,
Strategy spread Profit (Profit) Final q (Final q) 1984, 39, 23–45.
Ho, T. and Stoll, H., On dealer markets under competition.
Inventory 3.02 31.4 5.0 0.02 1.7 J. Finance, 1980, 35, 259–267.
Symmetric 3.02 44.0 11.0 0.00 5.1 Ho, T. and Stoll, H., Optimal dealer pricing under transactions
and return uncertainty. J. Financ. Econ., 1981, 9, 47–73.
Luckock, H., A steady-state model of the continuous double
auction. Quant. Finance, 2003, 3, 385–404.
Maslow, S. and Mills, M., Price fluctuations from the order
book perspective: empirical facts and a simple model.
180 Inventory strategy Phys. A, 2001, 299, 234–246.
Symmetric strategy
O’Hara, M., Market Microstructure Theory, 1997 (Blackwell:
160 Cambridge).
Potters, M. and Bouchaud, J.-P., More statistical properties of
140
order books and price impact. Physica A: Stat. Mech. Appl.,
120 2003, 324, 133–140.
Smith, E., Farmer, J.D., Gillemot, L. and Krishnamurthy, S.,
100 Statistical theory of the continuous double auction. Quant.
Finance, 2003, 3, 481–514.
80 Stoll, H.R., Market microstructure. In Handbook of the
Economics of Finance, edited by G.M. Constantinides, et al.,
60
2003 (North Holland: Amsterdam).
40 Weber, P. and Rosenow, B., Order book approach to price
impact. Quant. Finance, 2005, 5, 357–364.
20
0
50 0 50 100 150
Appendix
Figure 4. ¼ 1.
Herein, we consider the geometric Brownian motion
dSu
The results of the simulations comparing the ¼ dWu
‘inventory’ strategy for ¼ 0.01 with the corresponding Su
‘symmetric’ strategy are displayed in table 2. This small with initial value St ¼ s, and the mean/variance objective
value for represents an investor who is close to risk
h i
neutral. The inventory effect is therefore much smaller Vðx; s; q; tÞ ¼ Et ðx þ qST Þ ðqST qsÞ2 ;
and the P&L profiles of the two strategies are very similar, 2
as illustrated in figure 3. In fact, in the limit as ! 0 the
where x is the initial wealth in dollars. This value function
two strategies are identical.
can be written as
Finally, we display the performance of the two
strategies for ¼ 1 in table 3. This choice corresponds q2 s2 2 ðTtÞ
to a very risk averse investor, who will go to great lengths Vðx; s; q; tÞ ¼ x þ qs e 1 :
2
224 Feature
Downloaded By: [Mt Sinai School of Medicine, Levy Library] At: 23:19 28 April 2008