Rama Cont

Adrien De Larrard

Order book dynamics in liquid markets: limit theorems and diffusion approximations

Keywords: limit order book, queueing systems, heavy traffic limit, functional central limit theorem, diffusion limit, high-frequency data, market microstructure, point process, limit order market 1

We propose a model for the dynamics of a limit order book in a liquid market where buy and sell orders are submitted at high frequency. We derive a functional central limit theorem for the joint dynamics of the bid and ask queues and show that, when the frequency of order arrivals is large, the intraday dynamics of the limit order book may be approximated by a Markovian jump-diffusion process in the positive orthant, whose characteristics are explicitly described in terms of the statistical properties of the underlying order flow. This result allows to obtain tractable analytical approximations for various quantities of interest, such as the probability of a price increase or the distribution of the duration until the next price move, conditional on the state of the order book. Our results allow for a wide range of distributional assumptions and temporal dependence in the order flow and apply to a wide class of stochastic models proposed for order book dynamics, including models based on Poisson point processes, self-exciting point processes and models of the ACD-GARCH family.

Introduction

An increasing proportion of financial transactions -in stocks, futures and other contracts-take place in electronic markets where participants may submit limit orders (for buying or selling), market orders and order cancelations which are then centralized in a limit order book and executed according to precise time and price priority rules. The limit order book represents, at each point in time, the outstanding orders which are awaiting execution: it consists in queues at different price levels where these orders are arranged according to time of arrival. A new limit buy (resp. sell) order of size x increases the size of the bid (resp. ask) queue by x. Market orders are executed against limit orders at the best available price: a market order decreases of size x the corresponding queue size by x. Limit orders placed at the best available price are executed against market orders.

The availability of high-frequency data on limit order books has generated a lot of interest in statistical modeling of order book dynamics, motivated either by high-frequency trading applications or simply a better understanding of intraday price dynamics (see [START_REF] Cont | Statistical modeling of high-frequency financial data[END_REF] for a recent survey). The challenge here is to develop statistical models which capture salient features of the data while allowing for some analytical and computational tractability.

Given the discrete nature of order submissions and precise priority rules for their execution, is quite natural to model a limit order book as a queueing system; early work in this direction dates back to [START_REF] Mendelson | Market behavior in a clearing house[END_REF]. More recently, Cont, Stoikov and Talreja Cont et al. (2010b) have studied a Markovian queueing model of a limit order book, in which arrivals of market orders and limit orders at each price level are modeled as independent Poisson processes. [START_REF] Cont | Price dynamics in a markovian limit order market[END_REF] used this Markovian queueing approach to compute useful quantities (the distribution of the duration between price changes, the distribution and autocorrelation of price changes, and the probability of an upward move in the price, conditional on the state of the order book) and relate the volatility of the price with statistical properties of the order flow.

However, the results obtained in such Markovian models rely on the fact that time intervals between orders are independent and exponentially distributed, orders are of the same size and that the order flow at the bid is independent from the order flow at the ask. Empirical studies on highfrequency data show these assumptions to be incorrect [START_REF] Hasbrouck | Empirical Market Microstructure[END_REF], [START_REF] Bouchaud | Statistical properties of stock order books: empirical results and models[END_REF][START_REF] Bouchaud | How markets slowly digest changes in supply and demand[END_REF], [START_REF] Andersen | A point process model for the high-frequency dynamics of a limit order book[END_REF]). Figure 1 compares the quantiles of the duration between order book events for CitiGroup stock on June 26, 2008 to those of an exponential distribution with the same mean, showing that the empirical distribution of durations is far from being exponential. Figure 9 shows the autocorrelation function of the inverse durations: the persistent positive value of this autocorrelation shows that durations may not be assumed to be independent. Finally, as shown in Figure 2 which displays the (positive or negative) changes in queue size induced by successive orders for CitiGroup shares, there is considerable heterogeneity in sizes and clustering in the timing of orders.

Other, more complex, statistical models for order book dynamics have been developed to take these properties into account (see Section 2.3). However, only models based on Poisson point processes such as Cont et al. (2010b), [START_REF] Cont | Price dynamics in a markovian limit order market[END_REF] have offered so far the analytical tractability necessary when it comes to studying quantities of interest such as durations or transition probabilities of the price, conditional on the state of the order book. It is therefore of interest to know whether the conclusions based on Markovian models are robust to a departure from these simplifying assumptions and, if not, how they must be modified in the presence of other distributional features and dependence in durations and order sizes.

The goal of this work is to show that it is indeed possible to restore analytical tractability without imposing restrictive assumptions on the order arrival process, by exploiting the separation of time scales involved in the problem. The existence of widely different time scales, from milliseconds to minutes, makes it possible to obtain meaningful results from an asymptotic analysis of order book dynamics using a diffusion approximation of the limit order book. We argue that this diffusion approximation provides relevant and computationally tractable approximations of the quantities of interest in liquid markets where order arrivals are frequent.

Figure 1

Quantiles of inter-event durations compared with quantiles of an exponential distribution with the same mean (Citigroup, June 2008). The dotted line represents the benchmark case where the observations are exponentially distributed, which is clearly not the case here. As shown in Table 1, most applications involve the behavior of prices over time scales an order of magnitude larger than the typical inter-event duration: for example, in optimal trade execution the benchmark is the Volume weighted average price (VWAP) computed over a period which may range from 10 minutes to a day: over such time scales much of the microstructural details of the market are averaged out. Second, as noted in Table 2, in liquid equity markets the number of events affecting the state of the order book over such time scales is quite large, of the order of hundreds or thousands. The typical duration τ L (resp. τ M ) between limit orders (resp. market orders and cancelations) is typically 0.001 -0.01 1 (in seconds). These observations show that it is relevant to consider heavy-traffic limits in which the rate of arrival of orders is large for studying the dynamics of order books in liquid markets.

Regime

Time scale Issues Ultra-high ∼ 10 -3 -0.1 s Microstructure, frequency (UHF) Latency High ∼ 1 -100 s Trade Frequency (HF) execution "Daily" ∼ 10 3 -10 4 s Trading strategies, Option hedging Table 2 Average number of orders in 10 seconds and number of price changes (June 26th, 2008).

In this limit, the complex dynamics of the discrete queueing system is approximated by a simpler system with a continuous state space, which can be either described by a system of ordinary differential equations (in the 'fluid limit', where random fluctuations in queue size vanish) or a system of stochastic differential equations (in the 'diffusion limit' where random fluctuations dominate) [START_REF] Iglehart | Multiple channel queues in heavy traffic[END_REF], [START_REF] Harrison | Brownian models of multiclass queueing networks: Current status and open problems[END_REF], [START_REF] Whitt | Stochastic Process Limits[END_REF]). Intuitively, the fluid limit corresponds to the regime of law of large numbers, where random fluctuations average out and the limit is described by average queue size, whereas the diffusion limit corresponds to the regime of the central limit theorem, where fluctuations in queue size are asymptotically Gaussian. When order sizes or durations fail to have finite moments of first or second order, other scaling limits may intervene, involving Lévy processes (see [START_REF] Whitt | Stochastic Process Limits[END_REF]) or fractional Brownian motion [START_REF] Araman | Fractional brownian motion with H < 1/2 as a limit of scheduled traffic[END_REF]. As shown by [START_REF] Dai | On the convergence of multiclass queueing networks in heavy traffic[END_REF], there are also cases where such a 'heavy traffic limit' may fail to exist. The relevance of each of these asymptotic regimes is, of course, not a matter of 'taste' but an empirical question which depends on the behavior of high-frequency order flow in these markets.

Using empirical data on US stocks, we argue that for most liquid stocks, while the rate of arrival of market orders and limit orders is large, the imbalance between limit orders, which increase queue size, and market orders and cancels, which decrease queue size, is an order of magnitude smaller: over, say, a 10 minute interval, one observes an imbalance ranging from 1 to 10 % of order flow. In other words, over a time scale of several minutes, a large number N of events occur, but the bid/ask imbalance accumulating over the same interval is of order √ N N . In this regime, random fluctuations in queue sizes cannot be ignored and it is relevant to consider the diffusion limit of the limit order book.

In this paper we study the behavior of a limit order book in this diffusion limit: we prove a functional central limit theorem for the joint dynamics of the bid and ask queues when the intensity of orders becomes large, and use it to derive an analytically tractable jump-diffusion approximation. More precisely, we show that under a wide range of assumptions, which are shown to be plausible for empirical data on liquid US stocks, the intraday dynamics of the limit order book behaves like as a planar Brownian motion in the interior of the positive orthant, and jumps to the interior of the orthant at each hitting time of the boundary. This jump-diffusion approximation allows various quantities of interest to be computed analytically: we obtain analytical expressions for various quantities such as the probability that the price will increase at the next price change, and the distribution of the duration between price changes, conditional on the state of the order book.

Our results extend previous analysis of heavy traffic limits for such auction processes [START_REF] Kruk | Functional limit theorems for a simple auction[END_REF], [START_REF] Bayraktar | A limit theorem for financial markets with inert investors[END_REF], [START_REF] Cont | Price dynamics in a markovian limit order market[END_REF]) to a setting which is relevant and useful for quantitative modeling of limit order books and provide a foundation for recently proposed diffusion models for order book dynamics [START_REF] Avellaneda | Forecasting prices from Level-I quotes in the presence of hidden liquidity[END_REF].

Outline. The paper is organized as follows. Section 2 describes a general framework for the dynamics of a limit order book; various examples of models studied in the literature are shown to fall within this modeling framework (Section 2.3). Section 3 reviews some statistical properties of high frequency order flow in limit order markets: these properties highlight the complex nature of the order flow and motivate the statistical assumptions used to derive the diffusion limit. Section 4 contains our main result: Theorem 2 shows that, in a limit order market where orders arrive at high frequency, the bid and ask queues behaves like a Markov process in the positive quadrant which diffuses inside the quadrant and jumps to the interior each time it hits the boundary. We provide a complete description of this process, and use it to derive, in Section 4.3, a simple jump-diffusion approximation for the joint dynamics of bid and ask queues, which is easier to study and simulate than the initial queueing system.

In particular, we show that in this asymptotic regime the price process is characterized as a piecewise constant process whose transition times correspond to hitting times of the axes by a two dimensional Brownian motion in the positive orthant (Proposition 1). This result allows to study analytically various quantities of interest, such as the distribution of the duration between price moves and the probability of an increase in the price: this is discussed in Section 5.

2.

A model for the dynamics of a limit order book 2.1. Reduced-form representation of a limit order book Empirical studies of limit order markets suggest that the major component of the order flow occurs at the (best) bid and ask price levels (see e.g. [START_REF] Biais | An empirical analysis of the order flow and order book in the Paris Bourse[END_REF]). All electronic trading venues also allow to place limit orders pegged to the best available price (National Best Bid Offer, or NBBO); market makers used these pegged orders to liquidate their inventories. Furthermore, studies on the price impact of order book events show that the net effect of orders on the bid and ask queue sizes is the main factor driving price variations (Cont et al. (2010a)). These observations, together with the fact that queue sizes at the best bid and ask of the consolidated order book are more easily obtainable (from records on trades and quotes) than information on deeper levels of the order book, motivate a reduced-form modeling approach in which we represent the state of the limit order book by

• the bid price s b t and the ask price s a t

• the size of the bid queue q b t representing the outstanding limit buy orders at the bid, and • the size of the ask queue q a t representing the outstanding limit sell orders at the ask Figure 3 summarizes this representation.

If the stock is traded in several venues, the quantities q b and q a represent the best bids and offers in the consolidated order book, obtained by aggregating over all (visible) trading venues. At every time t, q b t (resp. q a t ) corresponds to all visible orders available at the bid price s b t (resp. s a t ) across all exchanges.

The state of the order book is modified by order book events: limit orders (at the bid or ask), market orders and cancelations (see Cont et al. (2010b,a), [START_REF] Smith | Statistical theory of the continuous double auction[END_REF]). A limit buy (resp. sell) order of size x increases the size of the bid (resp. ask) queue by x, while a market buy (resp.

q a q b δ Quantities s b Price s a Figure 3
Simplified representation of a limit order book.

sell) order decreases the corresponding queue size by x. Cancelation of x orders in a given queue reduces the queue size by x. Given that we are interested in the queue sizes at the best bid/ask levels, market orders and cancelations have the same effect on the queue sizes (q b t , q a t ). The bid and ask prices are multiples of the tick size δ. When either the bid or ask queue is depleted by market orders and cancelations, the price moves up or down to the next level of the order book. The price processes s b t , s a t are thus piecewise constant processes whose transitions correspond to hitting times of the axes {(0, y), y > 0} ∪ {(x, 0), x > 0} by the process q t = (q b t , q a t ). If the order book contains no 'gaps' (empty levels), these price increments are equal to one tick: • when the bid queue is depleted, the (bid) price decreases by one tick.

• when the ask queue is depleted, the (ask) price increases by one tick. If there are gaps in the order book, this results in 'jumps' (i.e. variations of more than one tick) in the price dynamics. We will ignore this feature in what follows but it is not hard to generalize our results to include it.

The quantity s a t -s b t is the bid-ask spread, which may be one or several ticks. As shown in Table 3, for liquid stocks the bid-ask spread is equal to one tick for more than 98% of observations. Bid-ask spread 1 tick 2 tick ≥ 3 tick Citigroup 98.82 1.18 0 General Electric 98.80 1.18 0.02 General Motors 98.71 1.15 0.14 When either the bid or ask queue is depleted, the bid-ask spread widens immediately to more than one tick. Once the spread has increased, a flow of limit sell (resp. buy) orders quickly fills the gap and the spread reduces again to one tick. When a limit order is placed inside the spread, all the limit orders pegged to the NBBO price move in less than a millisecond to the price level corresponding to this new order. Once this happens, both the bid price and the ask price have increased (resp. decreased) by one tick.

The histograms in Figure 4 show that this 'closing' of the spread takes place very quickly: as shown in Figure 4 (left) the lifetime of a spread larger than one tick is of the order of a couple of milliseconds, which is negligible compared to the lifetime of a spread equal to one tick (Figure 4 ,right). In our model we assume that the second step occurs infinitely fast: once the bid-ask spread widens, it returns immediately to one tick. For the example of Dow Jones stocks (Figure 4 ), this is a reasonable assumption since the widening of the spread lasts only a few milliseconds. This simply means that we are not trying to describe/model how the orders flow inside the bid-ask spread at the millisecond time scale and, when we describe the state of the order book after a price change we have in mind the state of the order book after the bid-ask spread has returned to one tick. Under this assumption, each time one of the queues is depleted, both the bid queue and the ask queue move to a new position and the bid-ask spread remains equal to one tick after the price change. Thus, under our assumptions the bid-ask spread is equal to one tick, i.e. s a t = s b t + δ, resulting in a further reduction of dimension in the model.

Once either the bid or the ask queue are depleted, the bid and ask queues assume new values. Instead of keeping track of arrival, cancelation and execution of orders at all price levels (as in Cont et al. (2010b), [START_REF] Smith | Statistical theory of the continuous double auction[END_REF]), we treat the queue sizes after a price change as a stationary sequence of random variables whose distribution represents the depth of the order book in a statistical sense. More specifically, we model the size of the bid and ask queues after a price increase by a stationary sequence (R k ) k≥1 of random variables with values in N 2 . Similarly, the size of the bid and ask queues after a price decrease is modeled by a stationary sequence ( Rk ) k≥1 of random variables with values in N 2 . The sequences (R k ) k≥1 and ( Rk ) k≥1 summarize the interaction of the queues at the best bid/ask levels with the rest of the order book, viewed here as a 'reservoir' of limit orders.

The variables R k (resp. Rk ) have a common distribution which represents the depth of the order book after a price increase (resp. decrease): Figure 5 shows the (joint) empirical distribution of bid and ask queue sizes after a price move for Citigroup stock on June 26th 2008.

The simplest specification could be to take (R k ) k≥1 , ( Rk ) k≥1 to be IID sequences; this approach, used in [START_REF] Cont | Price dynamics in a markovian limit order market[END_REF], turns out to be good enough for many purposes. But this IID assumption is not necessary; in the next section we will see more general specifications which allow for serial dependence.

In summary, state of the limit order book is thus described by a continuous-time process (s b t , q b t , q a t ) which takes values in the discrete state space δZ × N 2 , with piecewise constant sample paths whose transitions correspond to the order book events. Denoting by (t a i , i ≥ 1) (resp. t b i ) the event times at the ask (resp. the bid), V a i (resp. V b i ) the corresponding change in ask (resp. bid) queue size, and k(t) the number of price changes in [0, t], the above assumptions translate into the following dynamics for (s b t , q b t , q a t ): • If an order or cancelation of size V a i arrives on the ask side at t = t a i , -if q a t-+ V a i ≥ 0, the order can be satisfied without changing the price; -if q a t-+ V a i < 0, the ask queue is depleted, the price increases by one 'tick' of size δ, and the queue sizes take new values R k

(t) = (R b k(t) , R a k(t) ), (s b t , q b t , q a t ) = (s b t-, q b t-, q a t-+ V a i )1 {q a t-≥-V a i } + (s b t-+ δ, R b k(t) , R a k(t) )1 {q a t-<-V a i } , (1)
• If an order or cancelation of size V b i arrives on the bid side at t = t b i , -if q b t-+ V b i ≥ 0, the order can be satisfied without changing the price; -if q b t-+ V b i < 0, the bid queue gets depleted, the price decreases by one 'tick' of size δ and the queue sizes take new values Rk(t) = ( Rb

k(t) , Ra k(t) ): (s b t , q b t , q a t ) = (s b t-, q b t-+ V b i , q a t-)1 {q b t-≥-V b i } + (s b t--δ, Rb k(t) , Ra k(t) )1 {q b t-<-V b i } .
(2) 2.2. The limit order book as a 'regulated' process in the orthant As in the case of reflected processes arising in queueing networks, the process q t = (q b t , q a t ) may be constructed from the net order flow process

x t = (x b t , x a t ) =   N b t i=1 V b i , N a t i=1 V a i  
where N b t (resp. N a t ) is the number of events (i.e. orders or cancelations) occurring at the bid (resp. the ask) during [0, t]. x t = (x b t , x a t ) is analogous to the 'net input' process in queuing systems [START_REF] Whitt | Stochastic Process Limits[END_REF]: x b t (resp. x a t ) represents the cumulative sum of all orders and cancelations at the bid (resp. the ask) between 0 and t. q = (q b t , q a t ) t≥0 which takes values in the positive orthant, may be constructed from x by reinitializing its value to a a new position inside the positive orthant according to the rules (1)-( 2) each time one of the queues is depleted: every time (q t ) t≥0 attempts to exit the positive orthant, it jumps to a a new position inside the orthant, taken from the sequence (R n , Rn ). This construction may be done path by path, as follows:

Definition 1. Let ω ∈ D([0, ∞), R 2 )
(ω, R, R) ∈ D([0, ∞), R 2 + ) such that • For t < τ 1 , let Ψ(ω, R, R)(t) = ω(t) where τ 1 = inf{t ≥ 0, ω(t).(1, 0) < 0 or ω(t).(0, 1) < 0}.
is the first exit time of ω from the positive orthant.

•

Ψ(ω, R, R)(τ 1 ) = R 1 if Ψ(ω, R, R)(τ 1 -).(0, 1) < 0, and Ψ(ω, R, R)(τ 1 ) = R1 if Ψ(ω, R, R)(τ 1 -).(1, 0) < 0. • For k ≥ 1, Ψ(ω, R, R)(t + τ k ) = Ψ(ω, R, R)(τ k ) + ω(t + τ k ) -ω(τ k ) for 0 ≤ t < τ k+1 -τ k , where τ k+1 = inf{t ≥ τ k-1 , Ψ(ω, R, R)(τ k ) + ω(t + τ k ) -ω(τ k ) / ∈ R 2 + } is the first exit time of (Ψ(ω, R, R)(t), t ≥ τ k ) from the positive orthant. • Ψ(ω, R, R)(τ k ) = R k if Ψ(ω, R, R)(τ k -).(0, 1) < Ψ(ω, R, R)(τ k-1 ).(1, 0) and Ψ(ω, R, R)(τ k ) = Rk otherwise.
The path Ψ(ω, R, R) is obtained by "regulating" the path ω with the sequences (R, R): in between two exit times, the increments of Ψ(ω, R, R) follow those of ω and each time the process attempts to exit the positive orthant by crossing the x-axis (resp. the y-axis), it jumps to a a new position inside the orthant, taken from the sequence (R n ) n≥1 (resp. from the sequence ( Rn ) n≥1 ).

Unlike the more familiar case of a continuous reflection at the boundary, which arises in heavytraffic limits of multiclass queueing systems (see [START_REF] Harrison | The diffusion approximation for tandem queues in heavy traffic[END_REF], [START_REF] Harrison | Brownian models of multiclass queueing networks: Current status and open problems[END_REF], [START_REF] Whitt | Stochastic Process Limits[END_REF], [START_REF] Ramanan | Fluid and heavy traffic diffusion limits for a generalized processor sharing model[END_REF] for examples), this construction introduces a discontinuity by pushing the process into the interior of the positive orthant each time it attempts to exit from the axes.

To study the continuity properties of this map, we endow D([0, ∞), R 2 ) with Skorokhod's J 1 topology [START_REF] Billingsley | Convergence of Probability Measures[END_REF], [START_REF] Lindvall | Weak convergence of probability measures and random functions in the function space D(0, ∞)[END_REF] and the set (R 2 + )

N with the topology induced by 'cylindrical' semi-norms, defined as follows: for a sequence

(R n ) n≥1 in (R 2 + ) N R n n→∞ → R ∈ (R 2 + ) N ⇐⇒ ∀k ≥ 1, sup{|R n 1 -R 1 |, ..., |R n k -R k |) n→∞ → 0 . D([0, ∞), R 2 ) × (R 2 + ) N × (R 2 + )
N is then endowed with the corresponding product topology.

Theorem 1. Let R = (R n ) n≥1 , R = ( Rn ) n≥1 be sequences in ]0, ∞[×]0, ∞[ which do not have any accumulation point on the axes. If ω ∈ C 0 ([0, ∞), R 2 ) is such that (0, 0) / ∈ Ψ(ω, R, R)([0, ∞) ). ( 3
)
Then the map

Ψ : D([0, ∞), R 2 ) × (R 2 + ) N × (R 2 + ) N → D([0, ∞), R 2 + ) (4) is continuous at (ω, R, R).
Proof: See Section 6.2 in the Appendix. This construction may be applied to any cadlag stochastic process: given a cadlag process X with values in R 2 and (random) sequences R = (R n ) n≥1 and R = ( Rn ) n≥1 with values in R 2 + , the process Ψ(X, R, R) is a cadlag process with values in R 2 + . It is easy to see that the order book process q t = (q b t , q a t ) may be constructed by this procedure:

Lemma 1. The queue size process q = (q b t , q a t ) tgeq0 is related to the net order flow by q = (q b , q a ) = Ψ(x, R, R)

where

• x t = (x b t , x a t ) = N b t i=1 V b i , N a t i=1 V a i
is the net order flow at the bid and the ask, • R = (R n ) n≥1 is the sequence of queue sizes after a price increase, and • R = ( Rn ) n≥1 is the sequence of queue sizes after a price decrease.

One can thus build a statistical model for the limit order book by specifying the joint law of x and of the regulating sequences (R, R). This approach simplifies the study of the (asymptotic) properties of q t = (q b t , q a t ).

Example 1 (IID reinitializations). The simplest case is the case where the queue length after each price change is independent from the history of the order book, as in [START_REF] Cont | Price dynamics in a markovian limit order market[END_REF]. R = (R n ) n≥1 and R = ( Rn ) n≥1 are then IID sequences with values in ]0, ∞[ 2 . Figure 5 shows an example of such a distribution for a liquidly traded stock (NYSE: CitiGroup).

The law of the process Q = Ψ(x, R, R) is then entirely determined by the law of the net order flow x and the distributions of R n , Rn : it can be constructed from the concatenation of the laws of (x t , τ k ≤ t < τ k+1 ) for k ≥ 0 (where we define τ 0 := 0).

Example 2 (Pegged limit orders). Most electronic trading platforms allow to place limit orders which are pegged to the best quote: if the best quote moves to a new price level, a pegged limit order moves along with it to the new price level. The presence of pegged orders leads to positive autocorrelation and dependence in the queue size before/after a price change. The queue size after a price change may be modeled as

• q τn = R n = ( b n + βq b τn-, a n )
if the price has increased, and

• q τn = Rn = (˜ b n , ˜ a n + βq a τn-) if the price has decreased where n = ( b n , a n ), ˜ n = (˜ b n , ˜ a n ) are IID sequences.
Empirically, one observes a correlation of ∼ 10% -20% between the queue lengths before and after a price change, which suggests an order magnitude for the fraction of pegged orders. As in the previous example, the law of of the process q = Ψ(x, R, R) is determined by the law of the net order flow x, the coefficients β, β and the distributions of ,˜ : it can be constructed from the concatenation of the laws of (x t , τ k ≤ t < τ k+1 ) for k ≥ 0.

More generally, one could consider other extensions where the queue size after a price move may depend in a (nonlinear) way on the queue size before the price move and a random term n representing the inflow of new orders after the n-th price change:

q τn = g(q τn-, n ).
(5)

The results given below hold for this general specification although the examples 1 and 2 above are sufficiently general for most applications.

Examples

The framework described in Section 2.1 allows a wide class of specifications for the order flow process, and contains as special cases various models proposed in the literature. Each model involves a specification for the (random) sequences (

t a i , t b i , V a i , V b i ) i≥1 , R = (R n ) n≥1 and R = ( Rn ) n≥1 or, equivalently, (T a i , T b i , V a i , V b i ) i≥1 , R = (R n ) n≥1 and R = ( Rn ) n≥1 where T a i = t a i+1 -t a i (resp. T b i = t b i+1 -t b i
) are the durations between order book events on the ask (resp. the bid) side.

Models based on

Poisson point processes Cont and de Larrard ( 2010) study a stylized model of a limit order market in which market orders, limit orders and cancelations arrive at independent and exponential times with corresponding rates µ, λ and θ, the process q = (q b , q a ) becomes a Markov process. If we assume additionally that all orders have the same size, the dynamics of the reduced limit order book is described by:

• The sequence (T a i ) i≥0 is a sequence of independent random variables with exponential distribution with parameter λ + θ + µ,

• The sequence (T b i ) i≥0 is a sequence of independent random variables with exponential distribution with parameter λ + θ + µ,

• The sequence (V a i ) i≥0 is a sequence of independent random variables with

P[V a i = 1] = λ λ + µ + θ and P[V a i = -1] = µ + θ λ + µ + θ ,
• The sequence (V b i ) i≥0 is a sequence of independent random variables with

P[V b i = 1] = λ λ + µ + θ and P[V b i = -1] = µ + θ λ + µ + θ .
• All these sequences are independent. It is readily verified that this model is a special case of the framework of Section 2.1: (q t ) t≥0 may be constructed as in Definition 1, where the unconstrained process x t is now a compound Poisson process.

2.3.2. Self-exciting point processes Empirical studies of order durations highlight the dependence in the sequence of order durations. This feature, which is not captured in models based on Poisson processes, may be adequately represented by a multidimensional self-exciting point process [START_REF] Andersen | A point process model for the high-frequency dynamics of a limit order book[END_REF], [START_REF] Hautsch | Modelling Irregularly Spaced Financial Data[END_REF], in which the arrival rate λ i (t) of an order of type i is represented as a stochastic process whose value depends on the recent history of the order flow: each new order increases the rate of arrival for subsequent orders of the same type (self-exciting property) and may also affect the rate of arrival of other order types (mutually exciting property):

λ i (t) = θ i + J j=1 δ ij t 0 e -κ i (t-s) dN j (s)
Here δ ij measures the impact of events of type j on the rate of arrival of subsequent events of type i: as each event of type j occurs, λ i increases by δ ij . In between events, λ i (t) decays exponentially at rate κ i . Maximum likelihood estimation of this model on TAQ data [START_REF] Andersen | A point process model for the high-frequency dynamics of a limit order book[END_REF] shows evidence of self-exciting and mutually exciting features in order flow: the coefficients δ ij are all significantly different from zero and positive, with δ ii > δ ij for j = i.

Autoregressive conditional durations Models based on

Poisson process fail to capture serial dependence in the sequence of durations, which manifests itself in the form of clustering of order book events. One approach for incorporating serial dependence in event durations is to represent the duration T i between transactions i -1 and i as

T i = ψ i i ,
where ( i ) i≥1 is a sequence of independent positive random variables with common distribution and E[ i ] = 1 and the conditional duration ψ i = E[T i |ψ i-j , T i-j , j ≥ 1] is modeled as a function of past history of the process:

ψ i = G(ψ i-1 , ψ i-2 , ..., ..; T i-1 , T i-2 , ..., ..).
Engle and Russell's Autoregressive Conditional Duration model [START_REF] Engle | Autoregressive conditional duration: a new model for irregularly-spaced transaction data[END_REF] propose an ARMA(p, q) representation for G:

ψ i = a 0 + p i=1 a k ψ i-k + q i=1 b q T j-k
where (a 0 , ..., a p ) and (b 1 , ..., b q ) are positive constants. The ACD-GARCH model [START_REF] Ghysels | GARCH for irregularly spaced financial data: the ACD-GARCH model[END_REF] combine this model with a GARCH model for the returns. [START_REF] Engle | The econometrics of ultra-high-frequency data[END_REF] proposes a GARCH-type model with random durations where the volatility of a price change may depend on the previous durations. Variants and extensions are discussed in [START_REF] Hautsch | Modelling Irregularly Spaced Financial Data[END_REF]. Such models, like ARMA or GARCH models defined on fixed time intervals, have likelihood functions which are numerically computable. Although these references focus on transaction data, the framework can be adapted to model the durations (T a i , i ≥ 1) and (T b i , i ≥ 1) between order book events with the ACD framework [START_REF] Hautsch | Modelling Irregularly Spaced Financial Data[END_REF]).

2.3.4. A limit order market with patient and impatient agents Another way of specifying a stochastic model for the order flow in a limit order market is to use an 'agent-based' formulation where agent types are characterized in terms of the statistical properties of the order flow they generate. Consider for example a market with three types of traders:

• impatient traders who only submit market orders:

• patient traders who use only limit orders: this is the case for example of traders who place stop loss orders or engage in strategies such as mean-reversion arbitrage or pairs trading which are only profitable with limit orders.

• other traders who use both limit and market orders; we will assume these traders submit a proportion γ of their orders as limit orders and (1 -γ) as market orders, where 0 < γ < 1. Denote by m (resp. l) the proportion of orders generated by impatient (resp. patient) traders:

∀i ≥ 1, P[i -th trader uses only market orders] = m, P[i -th trader uses only limit orders] = l, P[ith trader uses both limit and market orders] = 1 -lm.

Assume that the sequence (T i , i ≥ 1) of duration between consecutive orders is a stationary ergodic sequence of random variables with E[T i ] < ∞, that each trader has an equal chance of being a buyer or a seller and that the type of trader (buyer or seller) is independent from the past:

P[i -th trader is a buyer] = P[i -th trader is a seller] =
1 2 Trader i generates an order of size V i , where (V i , i ≥ 1) is an IID sequence with:

P[(V b i , V a i ) = (V i , 0)] = P[(V b i , V a i ) = (0, V i )] = m 2 , P[(V b i , V a i ) = (-V i , 0)] = P[(V b i , V a i ) = (0, -V i )] = l 2 , P[(V b i , V a i ) = (γV i , -(1 -γ)V i )] = P[(V b i , V a i ) = (-(1 -γ)V i , γV i )] = 1 -l -m 2 .

Statistical properties of high-frequency order flow

As described in Section 2.1, the sequence of order book events -the order flow-is characterized by the sequences (T a i , i ≥ 1) and (T b i , i ≥ 1) of durations between orders and the sequences of order sizes (V b i , i ≥ 1) and (V a i , i ≥ 1). In this section we illustrate the statistical properties of these sequences using high-frequency quotes and trades for liquid US stocks -CitiGroup, General Electric, General Motors-on June 26th, 2008.

Order sizes

Empirical studies [START_REF] Bouchaud | Statistical properties of stock order books: empirical results and models[END_REF][START_REF] Bouchaud | How markets slowly digest changes in supply and demand[END_REF], [START_REF] Gopikrishnan | Statistical properties of share volume traded in financial markets[END_REF], [START_REF] Maslov | Price fluctuations from the order book perspective -empirical facts and a simple model[END_REF] have shown that order sizes are highly heterogeneous and exhibit heavy-tailed distributions, with Pareto-type tails:

P(V a i ≥ x) ∼ Cx -β
with tail exponent β > 0 between 2 and 3, which corresponds to a series with finite variance but infinite moments of order ≥ 3. The tail exponent β > 0 is difficult to estimate precisely, but the Hill estimator [START_REF] Resnick | Heavy-tail phenomena: Probabilistic and Statistical Modeling[END_REF] can be used to measure the heaviness of the tails. Table 4 gives the Hill estimator of the tail coefficient of order sizes for our samples. This estimator is larger than 2 for both the bid and the ask; this means that the sequence of order sizes have a finite moment of order two. 95-percent confidence interval of the Hill estimator of the sequence of order sizes. When the Hill estimator is < 0.5, the estimated tail index is large than 2 and the distribution has finite variance.

The sequences of order sizes (V a i , i ≥ 1) and (V b i , i ≥ 1) exhibit insignificant autocorrelation, as observed on Figure 6. However, they are far from being independent: the series of squared order sizes ((V b i ) 2 , i ≥ 1) and ((V a i ) 2 , i ≥ 1) are positively autocorrelated, as shown in Figure 7. Finally, the sequences (V a i , i ≥ 1) and (V b i , i ≥ 1) may be negatively correlated. This stems from the fact that a buyer can simultaneously use market orders on the ask side (which correspond to negative values of V a i ) and limit orders on the bid side (which correspond to positive values of V b i ); the same argument holds for sellers (see Section 2.3.4).

Figure 7

Autocorrelogram of the sequence of absolute order sizes. Order coming at the ask on the left and at the bid on the right.

These properties of the sequence (V a i , V b i ) i≥1 may be modeled using a bivariate ARCH process:

V b i = σ b i z b i V a i = σ a i z a i (σ b i ) 2 = α b 0 + α b 1 (V b t-1 ) 2 , (σ a i ) 2 = α a 0 + α a 1 (V a t-1 ) 2 , where (z b i , z a i ) i≥1 IID ∼ N 0, 1 ρ ρ 1 and (α b 0 , α b 1 , α a 0 , α a 1 ) are positive coefficients satisfying 0 < α b 0 + α b 1 < 1, and 0 < α a 0 + α a 1 < 1. ( 6
)
As shown by [START_REF] Bougerol | Strict stationarity of generalized autoregressive processes[END_REF], under the assumption (6), the sequence of order sizes (V b i , V a i ) i≥1 is then a well defined, stationary sequence of random variables with finite second-order moments, satisfying the properties enumerated above.

Durations

The timing of order book events is describe by the sequence of durations (T b i , i ≥ 1) at the bid and (T a i , i ≥ 1) at the ask. These sequences have zero autocorrelation (see Figure 8) but are not independence sequences: for example, as shown in Figure 9, the sequence of inverse durations (1/T b i , i ≥ 1) and (1/T b i , i ≥ 1) has significant autocorrelations.

Figure

Autocorrelogram of the sequence of inverse durations for events at the ask (left) and the bid (right).

Figure

Logarithm of the empirical distribution function of durations for events at the ask (left) and the bid (right).

Heavy Traffic limit

At very high frequency, the limit order book is described by a two-dimensional piecewise constant process q t = (q b t , q a t ) t≥0 , whose evolution is determined by the flow of orders. The complex nature of this order flow -heterogeneity and serial dependence in order sizes, dependence between orders coming at the ask and at the bid-described in section 3, makes it difficult to describe q t in an analytically tractable manner which would allow the quantities of interest to be computed either in closed form or numerically in real time applications. However, if one is interested in the evolution of the order book over time scales much larger than the interval between individual order book events, the (coarse-grained) dynamics of the queue sizes may be described in terms of a simpler process Q, called the heavy traffic approximation of q. In this limit, the complex dynamics of the discrete queueing system is approximated by a simpler system with a continuous state space, which can be either described by a system of ordinary differential equations (in the 'fluid limit', where random fluctuations in queue sizes vanish) or a system of stochastic differential equations (in the 'diffusion limit' where random fluctuations dominate). This idea has been widely used in queueing theory to obtain useful analytical insights into the dynamics of queueing systems [START_REF] Harrison | Brownian models of multiclass queueing networks: Current status and open problems[END_REF], [START_REF] Iglehart | Multiple channel queues in heavy traffic[END_REF], [START_REF] Whitt | Stochastic Process Limits[END_REF].

We argue that the heavy traffic limit is highly relevant for the study of limit order books in liquid markets, and that the correct scaling limit for the liquid stocks examined in our data sets is the "diffusion" limit. This heavy traffic limit is then derived in Theorem 2 and described in Section 4.3. 4.1. Fluid limit or diffusion limit? Let (V n,a i , i ≥ 1) the sequence of order sizes, whose properties depend on the index n. One way of viewing the heavy traffic limit is to view the limit order book at a lower time resolution, by grouping together events in batches of size n. Since the inter-event durations are finite, this is equivalent to rescaling time by n. The impact, on the net order flow, of a batch of n events at the ask is

V n,a 1 + V n,a 2 + V n,a 3 + ... + V n,a n √ n = (V n,a 1 -V n,a ) + (V n,a 2 -V n,a ) + ... + (V n,a n -V n,a ) √ n + √ n V n,a , where V n,a = E[V n,a 1
]. Under appropriate assumptions (see next section), this sum behaves approximately as a Gaussian random variable for large n:

V n,a 1 + V n,a 2 + V n,a 3 + ... + V n,a n √ n ∼ N ( √ n V n,a , Var(V n,a 1
)) as n → ∞.

Two regimes are possible, depending on the behavior of the ratio

√ n V n,a √ Var(V n,a 1
)
as n grows:

• If √ n V n,a √ Var(V n,a i )
→ ∞ as n → ∞, the correct approximation is given by the fluid limit, which describes the (deterministic) behavior of the average queue size.

• If lim n→∞ √ n V n,a √ Var(V n,a i )
< ∞, the rescaled queue sizes behave like a diffusion process.

The fluid limit corresponds to the regime of law of large numbers, where random fluctuations average out and the limit is described by average queue size, whereas the diffusion limit corresponds to the regime of the (functional) central limit theorem, where fluctuations in queue size are asymptotically Gaussian.

Figure 11 displays the histogram of the ratio

√ n V n,a √ Var(V n,a i )
for stocks in the Dow Jones index, where for each stock n is chosen to represent the average number of order book events in a 10 second interval (typically n ∼ 100 -1000). This ratio is shown to be rather small at such intraday time scales, showing that the diffusion approximation, rather than the fluid limit, is the relevant approximation to use here. Bid and ask queue sizes (q b t , q a t ) exhibit a diffusion-type behavior at such intraday time scales. Figure 12 shows the path of the net order flow process

x t = (q b 0 , q a 0 ) +   N b t i=1 V b i , N a t i=1 V a i   (8)
sampled every second for CitiGroup stocks on a typical trading day. In this example, for which the average time between consecutive orders is λ -1 13 ms 1 second, we observe that the process X behaves like a diffusion in the orthant with negative drift: the randomness of queue sizes does not average out at this time scale.

Figure 12

Evolution of the net order flow Xt = (X b t , X a t ) given by Eq. ( 8) for CitiGroup shares over one trading day (June 26, 2008). The starting point is taken to be (0,0) at the marke open. Note the irregular, diffusive feature of the path of X and its negative drift.

We will now show that this is a general result: under mild assumptions on the order flow process, we will show that the (rescaled) queue size process

(Q n t ) t≥0 := ( q n,b nt √ n , q n,a nt √ n ) t≥0 (9)
converges in distribution to a Markov process (Q t ) t≥0 in the positive orthant, whose features we will now describe in terms of the statistical properties of the order flow.

4.2. A functional central limit theorem for the limit order book Consider now a sequence q n = (q n t ) t≥0 of processes, where q n represents the dynamics of the bid and ask queues in the limit order book at a time resolution corresponding to n events (see discussion above). The dynamics of q n is characterized by the sequence of order sizes (

V n,b i , V n,a i ) i≥1 , durations (T n,b i , T n,a i
) i≥1 between orders and the fact that, at each price change

• q n τ k = R n k = g(q n τ k -, n k )
if the price has increased, and

• q n τ k = Rn k = g(q n τ k -, ˜ n k )
if the price has decreased, where ( n k , k ≥ 1) is an IID sequence with distribution f n , and (˜ n k , k ≥ 1) is an IID sequence with distribution fn . Note that this specification includes Examples 1 and 2 as special cases.

We make the following assumptions, which allow for an analytical study of the heavy traffic limit and are sufficiently general to accommodate high frequency data sets of trades and quotes such as the ones described in Section 3:

Assumption 1. (T n,a i , T n,b
i ) i≥1 is a stationary array of positive random variables whose common distribution has a continuous density and satisfies

lim n→∞ T n,a 1 + T n,a 2 + ... + T n,a n n = 1 λ a < ∞, lim n→∞ T n,b 1 + T n,b 2 + ... + T n,b n n = 1 λ b < ∞.
λ a (resp. λ b ) represents the arrival rate of orders at the ask (resp. the bid).

Assumption 2. (V n,a i , V n,b i
) i≥1 is a stationary, uniformly mixing array of random variables satisfying

√ nE[V n,a 1 ] n→∞ → V a , √ nE[V n,b 1 ] n→∞ → V b , (10)
lim n→∞ E[(V n,a i -V a ) 2 ] + 2 ∞ i=2 cov(V n,a 1 , V n,a i ) = v 2 a < ∞, and
lim n→∞ E[(V n,b i -V b ) 2 ] + 2 ∞ i=2 cov(V n,b 1 , V n,b i ) = v 2 b < ∞.
The assumption of uniform mixing (Billingsley 1968, Ch. 4) implies that the partial sums of order sizes verify a central limit theorem, but allows for various types of serial dependence in order sizes.

The scaling assumptions on the first two moments corresponds to the properties of the empirical data discussed in Section 4.1. Under Assumption 2, one can define

ρ := lim n→∞ 1 v a v b 2 max(λ a , λ b )cov(V n,a 1 , V n,b 1 ) + 2 ∞ i=1 λ a cov(V n,a 1 , V n,b i ) + λ b cov(V n,b 1 , V n,a i ) . ( 11
)
ρ ∈ (-1, 1) may be interpreted as a measure of 'correlation' between event sizes at the bid and event sizes at the ask. These assumptions hold for the examples of Section 2.3. In the case of the Hawkes model, Assumption 1 was shown to hold in [START_REF] Bacry | Scaling limits for Hawkes processes and application to financial statistics[END_REF]. Also, these assumptions are quite plausible for high frequency quotes for liquid US stocks since, as argued in Section 3:

• The tail index of order sizes is larger than two, so the sequences (V b i , i ≥ 1) and (V a i , i ≥ 1) have a finite second moment.

• The sequence of order sizes is uncorrelated i.e. has statistically insignificant autocorrelation. Therefore the sum of autocorrelations of order sizes is finite (zero, in fact).

• The sequence of inter-event durations has a finite empirical mean and is not autocorrelated. These empirical observations support the plausibility of Assumptions 1 and 2 for the data sets examined.

Assumption 2 has an intuitive interpretation: if orders are grouped in batches of n orders, then Assumption 2 amounts to stating that the variance of batch sizes should scale linear with n. This assumption can be checked empirically, using a variance ratio test for example: Figure 13 shows that this linear relation is indeed verifies for the data sets examined in Section 3. The following scaling assumption states that, when grouping orders in batches of n orders, a good proportion of batches should have a size O( √ n) (otherwise their impact will vanish in the limit when n becomes large):

Assumption 3. There exist probability distributions F, F on the interior (0, ∞) × (0, ∞) of the positive orthant, such that

nf n ( √ n .) n→∞ ⇒ F and n fn ( √ n .) n→∞ ⇒ F . Assumption 4. g ∈ C 2 (R 2 + × R 2 + , ]0, ∞[ 2 ) and ∃α > 0, ∀(x, y) ∈ R 2 + × R 2 + , g(x, y) ≥ α min(y 1 , y 2 ).
Finally, we add the following condition for the initial value of the queue sizes:

q n,b 0 √ n , q n,a 0 √ n n→∞ → (x 0 , y 0 ) ∈]0, ∞[×]0, ∞[ (12)
The following theorem, whose proof is given in the Appendix, describes the joint dynamics of the bid and ask queues in this heavy traffic limit:

Theorem 2 (Heavy traffic limit). Under Assumptions 3, 1, 2 and 4, the rescaled process

(Q n t , t ≥ 0) = q n nt √ n , t ≥ 0 converges weakly, on the Skorokhod space (D(]0, ∞[, R 2 + ), J 1 ), Q n n→∞ ⇒ Q to a Markov process (Q t ) t≥0
with values in R 2 + , initial value Q 0 = (x 0 , y 0 ) given in (12) and infinitesimal generator G given, for x > 0, y > 0, by

Gh(x, y) = λ a V a ∂h ∂y + λ b V b ∂h ∂x + λ a v 2 a 2 ∂ 2 h ∂y 2 + λ b v 2 b 2 ∂ 2 h ∂x 2 + ρ √ λ a λ b v a v b ∂ 2 h ∂x∂y , (13)
Gh(x, 0) = ]0,∞[ 2 Gh(g((x, 0), (u, v)))F (du, dv), Gh(0, y) = ]0,∞[ 2 Gh(g((0, y), (u, v))) F (du, dv),
and whose domain is the set dom

(G) of functions h ∈ C 2 (]0, ∞[×]0, ∞[, R) ∩ C 0 (R 2 + , R) verifying the Wentzell boundary conditions ∀x > 0, h(x, 0) = R 2 + h(g((x, 0), (u, v)))F (du, dv), ( 14
)
∀y > 0, h(0, y) = R 2 + h(g((0, y), (u, v))) F (du, dv).
We outline here the main steps of the proof. The technical details are given in the Appendix. Define the counting processes which correspond to the number of events at the ask (resp. the bid), and the net order flow

X n t =   N b,n nt i=1 V b,n i √ n , N a,n nt i=1 V a,n i √ n  
Then, as shown in Proposition 3 (see Appendix), X n converges in distribution on (D([0, ∞[, R 2 ), J 1 ) to a two-dimensional Brownian motion with drift

(X n t ) t≥0 n→∞ ⇒ Z t + t(λ b V b , λ a V a ) t≥0
where Z is a planar Brownian motion with covariance matrix

λ b v 2 b ρ √ λ a λ b v a v b ρ √ λ a λ b v a v b λ a v 2 a .
Under assumption 3, using the Skorokhod representation theorem, there exist IID sequences (( n k , n ≥ 1), (˜ n k , n ≥ 1), k , ˜ k ) k≥1 and a copy X of the process

(x 0 , y 0 ) + Z t + t(λ b V b , λ a V a ) t≥0 on some probability space (Ω 0 , B, Q) such that n k ∼ f n , ˜ n k ∼ fn , k ∼ F, ˜ k ∼ F and Q X n n→∞ → X ; ∀k ≥ 1, n k √ n n→∞ → k , ˜ n k √ n n→∞ → ˜ k = 1.
Using the notations of Appendix 6.2, denote by

• τ n 1 = τ (X n ) the first exit time of X n from the positive orthant R 2 + and • τ n k the first exit time of Ψ k-1 (X n , Q n τ n 1 , ..., Q n τ n k-1
) from R 2 + . We can now construct the process Q by an induction procedure. Let τ 1 = τ (X) be the first exit time of X from the orthant. Let Q t = X t for t < τ 1 and, by continuity of the first-passage time map and the last-evaluation map at a first passage time (Whitt 2002, Sec. 13.6.3),

(τ n 1 , Q n τ n 1 -) n→∞ → (τ 1 , Q τ 1 -) Q -a.s.
We now set

Q τ 1 = g(X τ 1 -, 1 )1 Xτ 1 .(0,1)<0 + g(X τ 1 -, ˜ 1 )1 Xτ 1 .(1,0)<0 . Since X is a Brownian motion, lim inf r↓0 (X τ 1 +r -X τ 1 ).(1, 0) < 0 therefore P 1 Xτ 1 .(1,0)<0 = 1 Xτ 1 .
(1,0)≤0 = 1 so we can also write

Q τ 1 = g(Q τ 1 -, 1 )1 Xτ 1 .(0,1)≤0 + g(Q τ 1 -, ˜ 1 )1 Xτ 1 .(1,0)≤0 .
X is a continuous process and the probability thats its path crosses the origin is zero, so by Lemma 2, X lies with probability 1 in the continuity set of the map G : ω → 1 ω τ (ω) .(0,1)<0 . So using the continuity of g(., .), we can apply the continuous mapping theorem (Billingsley 1968, Theorem 5.1), to conclude that

Q n τ n 1 n→∞ → Q τ 1 Q -a.s.
Let us now assume that we have defined Q on [0, τ k-1 ] and shown that

(τ n 1 , .., τ n k-1 , Q n τ n 1 , ..., Q n τ n k-1 ) n→∞ → (τ 1 , .., τ k-1 , Q τ 1 , ..., Q τ k-1 ) Q -a.s. Since Q((0, 0) / ∈ Ψ k (X, Q τ 1 , ..., Q τ k-1 )([0, ∞)) ) = 1, Lemma 4 implies that (X, Q τ 1 , ..., Q τ k-1
) lies with probability 1 in the continuity set of Ψ k , so by the continuous mapping theorem

Ψ k (X n , Q n τ n 1 , ..., Q n τ n k-1 ) n→∞ → Ψ k (X, Q τ 1 , ..., Q τ k-1 ) Q -a.s. Define now τ k as the first exit time of Ψ k (X, Q τ 1 , ..., Q n τ k-1 ) from the positive orthant [0, ∞[×[0, ∞[.
As before, by continuity of the first-passage time map and the last-value map at a first passage time (Whitt 2002, Sec. 13.6.3),

(τ n k , Q n τ n k -) n→∞ → (τ k , Q τ k -) Q -a.s.
We can now extend the definition of Q to [0, τ k ] by setting

Q t = Ψ k (X, Q τ 1 , ..., Q τ k )(t) for t < τ k , and
Q τ k = g(Q τ k -, k )1 Ψ k (X,Qτ 1 ,...,Qτ k-1 ).(0,1)<0 + g(Q τ k -, ˜ k )1 Ψ k (X,Qτ 1 ,...,Qτ k-1 ).(1,0)<0
As above, using the continuity properties of Ψ k from Lemma 4 we conclude that Q n τ n k → Q τ k a.s. and using the Brownian property of X we can show that

Q τ k = g(Q τ k -, k )1 Ψ k (X,Qτ 1 ,...,Qτ k-1 ).(0,1)≤0 + g(Q τ k -, ˜ k )1 Ψ k (X,Qτ 1 ,...,Qτ k-1 ).(1,0)≤0 a.s.
So finally, we have shown that

∀k ≥ 1, (τ n 1 , .., τ n k , Q n τ n 1 , ..., Q n τ n k ) n→∞ → (τ 1 , .., τ k , Q τ 1 , ..., Q τ k ) Q -a.s.
We can now construct the sequences R, R by setting

• R k = Q τ k if Ψ k (X, Q τ 1 , ..., Q τ k-1 )(τ k -).(0, 1) < 0, • Rk = Q τ k if Ψ k (X, Q τ 1 , ..., Q τ k-1 )(τ k -).(1, 0) < 0. Then Q = Ψ(X, R, R)
where Ψ is the map defined in Definition 1. Let us now show that (X, R, R) lies with probability 1 in the J 1 -continuity set of Ψ, in order to apply the continuous mapping theorem. X is a continuous process whose paths lie in C 0 ([0, ∞), R 2 -{(0, 0)}) almost surely. Since F and F have zero mass on the axes, with probability 1 the sequences ( k ) k≥1 , (˜ k ) k≥1 do not have any accumulation point on the axes. Assumption 4 then implies that the sequences (R k ) k≥1 , ( Rk ) k≥1 do not have any accumulation point on the axes. From the definition of Ψ (Definition 1), Q jumps at each hitting time of the axes and, in between two jumps, its increments follow those of the planar Brownian motion X. Since F, F have no mass at the origin and planar Brownian paths have a zero probability of hitting isolated points, with probability 1 the graph of Q = Ψ(X, R, R) does not hit the origin :

Q (0, 0) / ∈ Ψ(X, R, R)([0, ∞) ) = 1. ( 16
)
So the triplet (X, R, R) satisfies the conditions of Theorem 1 almost-surely i.e. Ψ is continuous at (X, R, R) with probability 1. We can therefore apply the continuous mapping theorem (Billingsley 1968, Theorem 5.1) and conclude that

Q n = (X n , R n , Rn ) n→∞ ⇒ Q = Ψ(X, R, R).
The process Q = Ψ(X, R, R) can be explicitly constructed from the planar Brownian motion X and the sequences R, R: Q follows the increments of X and is reinitialized to R n or Rn at each hitting time of the axes. Lemma 5 in Appendix 6.4 uses this description to show that Q is a Markov process whose infinitesimal generator is given by ( 13)-( 14).

Remark 1 (Lévy process limits). The diffusion approximation inside the orthant fails when order sizes do not have a finite second moment. For example, if the sequence (V a i , V b i ) is regularly varying with tail exponent α ∈ (0, 2) (see [START_REF] Resnick | Heavy-tail phenomena: Probabilistic and Statistical Modeling[END_REF] for definitions), the heavy-traffic approximation Q is a pure-jump process in the positive orthant, constructed by applying the map Ψ to a two-dimensional α-stable Lévy process L:

Q = Ψ(L, R, R),
i.e. by re-initializing it according to (5) at each attempted exit from the positive orthant. We do not further develop this case here, but it may be of interest for the study of illiquid limit order markets, or those where order flow is dominated by large block trades.

Jump-diffusion approximation for order book dynamics

Theorem 2 implies that, when examined over time scales much larger than the interval between order book events, the queue sizes q b and q a are well described by a Markovian jump-diffusion process (Q t ) t≥0 in the positive orthant R 2 + which behaves like a a planar Brownian motion with drift vector

(λ b V b , λ a V a ) ( 17
)
and covariance matrix

λ b v 2 b ρ √ λ a λ b v a v b ρ √ λ a λ b v a v b λ a v 2 a . ( 18
)
in the interior ]0, ∞[ 2 of the orthant and, at each hitting time τ k of the axes, jumps to a new position

• Q τ k = R k = g(Q τ k -, k ) whenever Q a τ k-= 0, • Q τ k = Rk = g(Q τ k -, ˜ k ) whenever Q b τ k-= 0
, where the k are IID with distribution F and the ˜ k are IID with distribution F . We note that similar processes in the orthant were studied byBaccelli and Fayolle (1987) with queueing applications in mind, but not in the context of heavy traffic limits.

This process is analytically and computationally tractable and allows various quantities related to intraday price behavior to be computed (see next section).

If

γ 0 = (E[T a 1 ] + E[T b 1 ]
)/2 is the average time between order book events, (γ 0 ≤ 100 milliseconds), and γ 1 γ 0 (typically, γ 1 ∼ 10-100 seconds) then Theorem 2 leads to an approximation for the distributional properties of the queue dynamics in terms of Q t :

q t d √ N Q t/N where N = γ 1 γ 0
So, under Assumptions 1, 2, 3 and 4 the queue sizes (q b t , q a t ) t≥0 can be approximated at the time scale γ 1 by a Markov process which

• behaves like a two-dimensional Brownian motion with drift (µ b , µ a ) and covariance matrix Λ on {x > 0} ∩ {y > 0} with

µ a = √ N λ a V a , µ b = √ N λ b V b , Λ = N λ b v 2 b ρ √ λ a λ b v a v b ρ √ λ a λ b v a v b λ a v 2 a ( 19
)
and,

• jumps to a new value g(q t-,

√ N k ) if q a t-= 0, • jumps to a new value g(q t-, √ N ˜ k ) if q b t-= 0, where k ∼ F , ˜ k ∼ F are IID.
This gives a rigorous justification for modeling the queue sizes by a diffusion process at such intraday time scales, as proposed in [START_REF] Avellaneda | Forecasting prices from Level-I quotes in the presence of hidden liquidity[END_REF]. The parameters involved in this approximation are straightforward to estimate from empirical data: they involve estimating first and second moments of durations and order sizes.

Example 3. Set for instance γ 1 = 30 seconds and Parameters for the heavy-traffic approximation of bid / ask queues over a 30-second time scale. The unit is a number of orders per period of 30 seconds.

γ 0 = (E[T a ] + E[T b ])/2.
In particular we observe that the order of magnitude of the standard deviation of queue lengths is an order of magnitude larger than their expected change.

Example 4. Theorem 2 may also be used to derive jump-diffusion approximations for the limit order book in theoretical models such as the ones presented in Section 2.3. Let us illustrate this in the case of the heterogeneous trader model of Section 2.3.4. Let (T i , i ≥ 1) be the sequence of duration between consecutive orders. We assume that this sequence is a sequence of stationary random variables with E[T 1 ] < ∞. We also assume that every trader has an equal chance of being a buyer or a seller and that the type of trader (buyer or seller) is independent from the past:

P[i -th trader is a buyer] = P[i -th trader is a seller] =
1 2 Finally the sequence of number of orders (V i , i ≥ 1) is a stationary sequence of orders traded by the i-th trader with the property that E[V 2 1 ] < ∞. This order flow given by (T i , i ≥ 1), (V i , i ≥ 1), and the sequence of type (buyers or sellers, using limit orders, market orders or both) generates a sequence of durations (T a i , i ≥ 1), (T b i ; i ≥ 1) and order sizes (V a i , i ≥ 1) and (V b i , i ≥ 1) which satisfy assumptions 1 and 2. The sequence of durations (T a i , i ≥ 1) and (T b i , i ≥ 1) are two stationary sequences of random variables with finite mean:

∀i ≥ 0, T i = T a i = T b i . therefore E[T i ] = E[T a i ] = E[T b i ] < ∞. The sequence of order sizes ((V b i , V a i ), i ≥ 1) is a sequences of IID random variables with P[(V b i , V a i ) = (V i , 0)] = P[(V b i , V a i ) = (0, V i )] = m 2 , (20)
P[(V b i , V a i ) = (-V i , 0)] = P[(V b i , V a i ) = (0, -V i )] = l 2 , (21)
P[(V b i , V a i ) = (γV i , -(1 -γ)V i )] = P[(V b i , V a i ) = (-(1 -γ)V i , γV i )] = 1 -l -m 2 . (22)
Theorem 2 then shows that (Q b , Q a ) is a Markov process which behaves like a two-dimensional Brownian motion with drift (µ b , µ a ) and covariance matrix Λ inside the positive orthant {x > 0} ∩ {y > 0} where:

µ b = µ a = V 2E[T 1 ] (2m + 2γ(1 -l -m) -1) , Λ = v 2 1 ρ ρ 1 , where (23)
v 2 = E[T 1 ]E[V 2 1 ] 4 m + l + γ 2 + (1 -γ) 2 2 (1 -l -m) and ρ = - (1 -l -m) 2 γ(1 -γ) 1 + (1 -l -m)(γ 2 -γ -1/2) < 0.
(24) Figure 14 displays the value of the correlation ρ in different scenarios as a function of γ and the proportion 1 -(l + m) of traders submitting orders of both types.

Price dynamics

5.1. Price dynamics in the heavy traffic limit Denote by (s n t , t ≥ 0) the (bid) price process corresponding to the limit order book process (q n t ) t≥0 . As explained in Section 2, s n is a piecewise constant stochastic process which

• increases by one tick at each event (t a,n i , V a,n i ) at the ask for which q a,n (t a,n i ) + V a,n i < 0, • decreases by one tick at each event (t b,n i , V b,n i ) at the bid for which q b,n (t b,n i ) + V b,n i < 0. Due to the complex dependence structure in the sequence of order durations and sizes, properties of the process s n are not easy to study, even in simple models such as those given in Section 2.3. The following result shows that the price process converges to a simpler process in the heavy traffic limit, which is entirely characterized by hitting times of the two dimensional Markov process Q: Correlation ρ between bid and ask queue sizes for different scenario. 1 -(l +m) represents the proportion of traders using both market and limit orders, γ the proportion of limit orders and (1-γ) the proportion of market orders.

Proposition 1. Under the assumptions of Theorem 2,

(s n nt , t ≥ 0) n→∞ ⇒ S, on (D([0, ∞[, R), M 1 )
, where

S t = δ 0≤s≤t 1 Q a s-=0 - 0≤s≤t 1 Q b s-=0 . (25)
S is a piecewise constant cadlag process which • increases by one tick at t if Q a t-= 0 and • decreases by one tick at t if Q b t-= 0. We refer the reader to [START_REF] Whitt | Stochastic Process Limits[END_REF] or [START_REF] Whitt | Some useful functions for functional limit theorems[END_REF] for a description of the M 1 topology. The price process s n (rescaled in time) can be expressed as

s n nt = τ n k ≤t 1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1 )(τ n k ).(0,1)<0 -1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1 )(τ n k ).(1,0)<0 .
where

τ n k , Q n τ n k
are defined in the proof of Theorem 2, where it was shown that

∀k ≥ 1, (X n , τ n 1 , .., τ n k , Q n τ n 1 , ..., Q n τ n k ) n→∞ ⇒ (X, τ 1 , .., τ k , Q τ 1 , ..., Q τ k ).
As shown in the proof of Theorem 2, (X, Q τ 1 , ..., Q τ k ,... ) lies, with probability 1, in the set of continuity points of Ψ k for each k ≥ 1 so

Ψ k (X n , Q n τ n 1 , ..., Q n τ n k ) n→∞ ⇒ Ψ k (X, Q τ 1 , ..., Q τ k ).
Applying Lemma 2 and the continuous mapping theorem [START_REF] Billingsley | Convergence of Probability Measures[END_REF], Theorem 5.1) then shows that

1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1 )(τ n k -).(0,1)<0 n→∞ ⇒ 1 Ψ k-1 (X,Qτ 1 ,...,Qτ k-1 )(τ k -).(0,1)<0
The sequences of processes

τ n k ≤t 1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1
)(τ n k ).(0,1)<0 and

τ n k ≤t 1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1 )(τ n k ).(1,0)<0 belong to D ↑ ([0, ∞[, R + )
, the set of increasing cadlag trajectories. The convergence for the M 1 topology of sequences in D ↑ reduces to the convergence on a dense subset including zeros. Therefore 0,1)<0 , and

τ n k ≤t 1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1 )(τ n k ).(0,1)<0 ⇒ τ k ≤t 1 Ψ k-1 (X,Qτ 1 ,...,Qτ k-1 )(τ k ).(
τ n k ≤t 1 Ψ k-1 (X n ,Q n τ n 1 ,...,Q n τ n k-1 )(τ n k ).(1,0)≤0 ⇒ τ k ≤t 1 Ψ k-1 (X,Qτ 1 ,...,Qτ k-1 )(τ k ).(1,0)≤0 .
On the other hand, since the set of discontinuities of

τ k ≤t 1 Ψ k (X,Qτ 1 ,...,Qτ k-1 )(τ k ).(0,1)<0 and τ k ≤t 1 Ψ k (X,Qτ 1 ,...,Qτ k-1 )(τ k ).
(1,0)<0 have an intersection which is almost surely void, one can apply (Whitt 1980, Theorem 4.1) and (Whitt 2002, Theorem 12.7.1) and

(s n nt , t ≥ 0) n→∞ ⇒ S. on (D([0, ∞[, R + ), M 1 ).
S is thus the difference between the occupation time of the y axis and the occupation time of the x axis by the Markov process Q. In particular, this result shows that, in a market where order arrivals are frequent, distributional properties of the price process s n may be approximated using the distributional properties of its limit S. We will now use this result to obtain some analytical results on the distribution of durations between price changes and the transition probabilities of the price.

Duration between price moves

Starting from an initial order book configuration Q 0 = (x, y),

• the next price increase occurs at the first hitting time of the x-axis by (Q t-) t≥0 :

τ a = inf{t ≥ 0, Q a t-= 0}
• the next price decrease occurs at the first hitting time of the y-axis by (Q t-) t≥0 :

τ b = inf{t ≥ 0, Q b t-= 0}.
The duration τ until the next price changes is then given by τ = τ a ∧ τ b , which has the same law as the first exit time from the positive orthant of a two-dimensional Brownian motion with drift. Using the results of [START_REF] Metzler | On the first passage problem for correlated brownian motion[END_REF], [START_REF] Lipton | Mathematical methods in foreign exchange[END_REF], [START_REF] Zhou | An analysis of default correlations and multiple defaults[END_REF] we obtain the following result which relates the distribution of this duration to the state of the order book and the statistical features of the order flow process, for a balanced order flow where V a = V b = 0.

Proposition 2 (Conditional distribution of duration between price changes). In the case of balanced order flow where V a = V b = 0 the distribution of the duration τ until the next price change, conditional on the current state of the bid and ask queues, is given by

P[τ > t|Q b 0 = x, Q a 0 = y] = 2U πt e - U 4t ∞ n=0 1 (2n + 1) sin (2n + 1)πθ 0 α (I (νn-1)/2 ( U 4t ) + I (νn+1)/2 ( U 4t
)),

where ν n = (2n + 1)π/α, I n is the nth Bessel function,

U = ( x λav 2 a ) 2 + ( y λ b v 2 b ) 2 -2ρ xy λaλ b v 2 a v 2 b (1 -ρ) , and
α =                      π + tan -1 (- √ 1 -ρ 2 ρ ) ρ > 0 π 2 ρ = 0 tan -1 (- √ 1 -ρ 2 ρ ) ρ < 0 and θ 0 =                      π + tan -1 (- y √ 1 -ρ 2 x -ρy ) x < ρy π 2 x = ρy tan -1 (- y √ 1 -ρ 2 x -ρy ) x > ρy (26)
In particular, τ is regularly varying with tail index π 2α .

When V a = V b = 0, the process Q behaves like a two-dimensional Brownian motion Z with covariance matrix given by ( 18) up to the first hitting time of the axes, so the distribution of the duration τ has the same law as the first exit time of Z from the orthant:

τ d = inf{t ≥ 0, Q a t-< 0 or Q b t-< 0}
Using the results of [START_REF] Iyengar | Hitting lines with two-dimensional brownian motion[END_REF], corrected by [START_REF] Metzler | On the first passage problem for correlated brownian motion[END_REF] for the distribution of the first exit time of a two-dimensional Brownian motion from the orthant we obtain the result.

A result of [START_REF] Spitzer | Some theorems concerning 2-dimensional brownian motion[END_REF] then shows that

E[τ β |Q b 0 = x, Q a 0 = y] = ∞ 0 t β-a P[τ > t|Q b 0 = x, Q a 0 = y]dt < ∞
if and only if β < π/2α, where α is defined in (26). Therefore the tail index of τ is π 2α . This result does not depend on the initial state (x, y).

• If ρ = 0, the two components of the Brownian Motion are independent and τ is a regularlyvarying random variable with tail index 1. This random variable does not have a moment of order one.

• If ρ < 0, π 2α > 1 and τ has a finite moment of order one. In practice, ρ ≈ -0.7; this means that if µ a = 0 and µ b = 0, the tail index of τ is around 2.

• When ρ > 0, π 2α < 1. The tail of τ is very heavy; τ does not have a finite moment of order one. For all high frequency data sets examined, the estimates for µ a , µ b are negative (see Section 4.3); the durations then have finite moments of all orders.

Remark 2. Using the results of (Lipton 2001, Eq.(12.87)) (see also [START_REF] Zhou | An analysis of default correlations and multiple defaults[END_REF]) on the first exit time of a two-dimensional Brownian motion with drift, one can generalize the above results to the case where (V b , V a ) = (0, 0): we obtain in that case

P[τ > t|Q b 0 = x, Q a 0 = y] = 2e a 1 x+a 2 y+a t t-r 2 0 /2t αt ∞ n=1 sin nπθ 0 α α 0 sin nπ α g n (θ)dθ ( 27
)
where θ 0 , α are defined as above, r 0 = √ U and

g n (θ) = ∞ 0
re -r 2 /2t e d 1 r sin(θ-α)-d 2 r cos(θ-α) I nπ/α ( rr 0 t )dr,

d 1 = a 1 √ λ a v a + ρa 2 v b √ λ b , d 2 = ρa 1 √ λ a v a + a 2 v b √ λ b (28) a 1 = - µ a √ λ b v b + µ b ρv a √ λ a (1 -ρ 2 )σ 2 a λ a √ λ b v b , a 2 = - ρµ a √ λ b v b + µ b v a √ λ a (1 -ρ 2 )σ 2 b λ b √ λ a v a , (29)
and

a t = a 1 λ a v 2 a 2 + a 2 λ b v 2 b 2 + 2ρa 1 √ λ a λ b v a a 2 v b -a 1 µ a -a 2 µ b . (30)

Probability of a price increase

A useful quantity for short-term prediction of intraday price moves is the probability p up 1 (x, y) that the price will increase at the next move given x orders at the bid and y orders at the ask; in our setting this is equal to the probability that the ask queue gets depleted before the bid queue.

In the heavy traffic limit, this quantity may be represented as the probability that the twodimensional process (Q t , t ≥ 0), starting from an initial position (x, y), hits the horizontal axis before hitting the vertical axis:

p up 1 (x, y) = P[τ a < τ b |(Q b 0 , Q a 0 ) = (x, y)].
Since this quantity only involves the process Q up to its first hitting time of the boundary of the orthant, it may be equivalently computed by replacing Q by a two-dimensional Brownian motion with drift and covariance given by ( 17)-( 18). However, when V a = V b = 0, one has a simple analytical solution which only depends on the size x of the bid queue, the size y of the ask queue and the correlation ρ between their increments:

Theorem 3. Assume V a + V b ≤ 0. Then p up 1 : R 2 + → [0, 1] is the unique bounded solution of the Dirichlet problem λ a v 2 a 2 ∂ 2 p up 1 ∂y 2 + λ b v 2 b 2 ∂ 2 p up 1 ∂x 2 + 2ρ √ λ a λ b σ a σ b ∂ 2 p up 1 ∂x∂y + λ a V a ∂p up 1 ∂y + λ b V b ∂p up 1 ∂x = 0 for x > 0, y > 0
(31) with the boundary conditions ∀x > 0, p up 1 (x, 0) = 1 and ∀y > 0, p up 1 (0, y) = 0. (32)

When V a = V b = 0, p up 1 (x, y) is given by

p up 1 (x, y) = 1 2 - arctan( 1+ρ 1-ρ y √ λava -x √ λ b v b y √ λava + x √ λ b v b ) 2 arctan( 1+ρ 1-ρ ) , ( 33
)
where λ a , λ b , v a and v b are defined in Assumptions 1 and 2.

Using the results of [START_REF] Yoshida | Harmonic functions in a cone which vanish on the boundary[END_REF], the Dirichlet problem ( 31)-(32) has a unique positive bounded solution u

∈ C 2 (]0, ∞[ 2 , R + ) ∩ C 0 b (R 2 + , R + ). Application of Ito's formula to M t = u(Q b t , Q a t )
∀r > 0, φ(r, -β) = 1 φ(r, π 2 -β) = 0 (35)
A positive bounded solution, which in this case does not depend on r, is given by

φ(r, θ) = 1 π/2 + arcsin ρ (-θ + π/2 + arcsin(ρ)/2),
where ρ is the correlation coefficient between the bid and ask queues. By (Yoshida and Miyamoto 1999, Theorem 3.2), the Dirichlet problem ( 34)-( 35) has a unique bounded solution, so finally

p up 1 (x, y) = 1 π/2 + arcsin ρ π/2 + arcsin(ρ)/2 -arctan( sin(arctan(y/x) -β) cos(β + arctan(y/x)) ) . Remark 3. When √ λ a v a = √ λ b v b
, the probability p up 1 (x, y) only depends on the ration y/x and on the correlation ρ

p up 1 (x, y) = 1 2 - arctan( 1+ρ 1-ρ y-x y+x ) 2 arctan( 1+ρ 1-ρ ) , (36)
and when ρ = 0 (which is the case for some empirical examples, see Section 4.3),

p up 1 (x, y) = 2 π arctan( y x ).
Figure 15 displays the dependence of the uptick probability p up 1 on the bid-ask imbalance variable θ = arctan(y/x) for different values of ρ.

G : (D([0, ∞), R 2 ), J 1 ) → R (37) ω → 1 ω(τ (ω)).(0,1)<0 . is continuous on the set {ω ∈ C([0, ∞), R 2 \{(0, 0)}), τ (ω) < ∞}.
When τ (ω) < ∞, G(ω) = 1 indicates that ω first exits the orthant by crossing the x-axis. To prove this property, first note that

C([0, ∞), R 2 \{(0, 0)}) = n≥1 C 0 ([0, ∞), R 2 \B(0, 1/n)). Let ω 0 ∈ C([0, ∞), R 2 \{(0, 0)}). There exists n ∈ N such that ω 0 / ∈ B(0, 1/n). Let > 0 such that + η ω 0 ( ) + η ω 0 •λ ( ) < 1/n, where η ω is the modulus of continuity of ω. Let ω ∈ D([0, ∞), R 2 ) with d J 1 (ω 0 , ω ) ≤ . There exists λ : [0, T ] → [0, T ] increasing such that ||ω 0 • λ -ω|| ∞ ≤ and ||λ -e|| ∞ ≤ .
Without loss of generality, one can also assume, by J 1 -continuity of τ at ω 0 , that

|τ (ω 0 ) -τ (ω)| ≤ .
Now, we will show that |ω 0 (τ (ω 0 )) -ω (τ (ω ))| ≤ + η ω 0 ( ) + η ω 0 •λ ( ):

|ω 0 (τ (ω 0 ))-ω (τ (ω ))| = |ω 0 (τ (ω 0 ))-ω 0 •λ(τ (ω ))+ω 0 •λ(τ (ω ))-ω 0 •λ(τ (ω 0 ))+ω 0 •λ(τ (ω 0 ))-ω (τ (ω ))|, therefore |ω 0 (τ (ω 0 )) -ω (τ (ω ))| ≤ ||ω 0 • λ -ω || ∞ + |ω 0 • λ(τ (ω )) -ω 0 • λ(τ (ω 0 ))| + |ω 0 • λ(τ (ω 0 )) -ω 0 (τ (ω 0 ))| ≤ + η ω 0 ( ) + η ω 0 •λ ( ).
Since + η ω 0 ( ) + η ω 0 •λ ( ) < 1/n and ω 0 / ∈ B(0, 1, n), 1 τ (ω 0 ).(0,1)<0 = 1 τ (ω ).(0,1)<0 , which completes the proof of the continuity of the map G on the space C([0, ∞), R 2 \{(0, 0)}).

Continuity of Ψ: proof of Theorem 1

To study the continuity of the map Ψ, we endow D([0, ∞), R 2 ) with Skorokhod's J 1 topology (see [START_REF] Lindvall | Weak convergence of probability measures and random functions in the function space D(0, ∞)[END_REF], [START_REF] Whitt | Some useful functions for functional limit theorems[END_REF]). Let Λ T the set of continuous, increasing functions λ : [0, T ] → [0, T ] and e the identical function on [0, T ]. Recall that the following metric

d J 1 (ω 1 , ω 2 ) = inf λ∈Λ (||ω 2 • λ -ω 1 || ∞ + ||λ -e|| ∞ ) . defined for ω 1 , ω 2 ∈ D([0, T ], R 2 ), induces the J 1 topology on D([0, T ], R 2 ), and ω n → ω in (D([0, ∞), R 2 ), J 1 ) if for every continuity point T of ω, ω n → ω in (D([0, T ], R 2 ), J 1 ).
The set (R 2 + ) N is endowed with the topology induced by 'cylindrical' semi-norms, defined as follows: for a sequence

(R n ) n≥1 in (R 2 + ) N R n n→∞ → R ⇐⇒ ∀k ≥ 1, sup{|R n 1 -R 1 |, ..., |R n k -R k |) n→∞ → 0. D([0, ∞), R 2 ) × (R 2 + ) N × (R 2 + )
N is then endowed with the corresponding product topology. The goal of this section is to characterize the continuity set of the map

Ψ : D([0, ∞), R 2 ) × (R 2 + ) N × (R 2 + ) N → D([0, ∞), R 2 + )
introduced in Definition 1. Let us introduce C([0, ∞), R 2 \{(0, 0)}) be the space of continuous planar paths avoiding the origin:

C([0, ∞), R 2 \{(0, 0)}) = n≥1 C 0 ([0, T ], R 2 \B(0, 1/n)). Lemma 3. Let ω ∈ C([0, ∞), R 2 \{(0, 0)}). Then the map Ψ 1 : D([0, ∞), R 2 ) × R + × R + → D([0, ∞), R 2 ) (38) (ω, R 1 , R1 ) → ω + 1 [τ (ω),∞) 1 σ b (ω)=τ (ω) (R 1 -ω τ (ω) ) + 1 σa(ω)=τ (ω) ( R1 -ω τ (ω) ) ,
where

σ b (ω) = inf{t ≥ 0, ω t .(0, 1) < 0}, σ a (ω) = inf{t ≥ 0, ω t .(1, 0) < 0} and τ (ω) = σ b (ω) ∧ σ a (ω).
is continuous at ω with respect to the following distance on

(D([0, ∞], R 2 ) × R + × R + ): d((ω, R 1 , R1 ), (ω , R 1 , R 1 )) = d J 1 (ω, ω ) + |R 1 -R 1 | + | R1 -R1 | Let (ω 0 , R 1 , R1 ) ∈ C([0, ∞), R 2 \{(0, 0)}) × R 2 + , (ω , R 1 , R 1 ) ∈ D(0, R 2 ) × R 2 + . Since ω 0 ∈ C([0, ∞), R 2 \{(0, 0)}), there exists n > 0 such that ω 0 / ∈ B(0, 1/n). Let 0 < < 1/n such that d((ω 0 , R 1 , R1 ), (ω , R 1 , R 1 )) < .
Since d J 1 (ω 0 , ω ) < , there exists λ : [0, T ] → [0, T ], non-decreasing such that:

||λ -e|| ∞ < , and ||ω 0 • λ -ω|| ∞ < .

By continuity of τ for the J 1 topology Whitt (2002)[Theorem 13.6.4] at ω 0 (since ω 0 is continuous, the J 1 and M 1 topologies are identical at this point), one can also assume, without loss of generality, that |τ

(ω 0 • λ) -τ (ω )| ≤ .
Moreover, since the graph of ω 0 does not intersect with B(0, 1/n) and

< 1/n, 1 τ (ω 0 )=σa(ω 0 ) = 1 τ (ω )=σa(ω ) . Now define λ by λ : [0, T ] → [0, T ] (39) t → τ (ω ) τ (ω 0 • λ) λ t . Then ||λ -e|| ∞ = || τ (ω) τ (ω 0 • λ) λ -e|| ∞ ≤ || τ (ω) τ (ω 0 • λ) λ - τ (ω) τ (ω 0 • λ) e|| ∞ + || τ (ω) τ (ω 0 • λ) e -e|| ∞ ≤ τ (ω) τ (ω 0 • λ) + τ (ω 0 • λ) .
On the other hand

||ω 0 • λ -ω|| ∞ = ||ω 0 • λ -ω 0 • λ + ω 0 • λ -ω|| ∞ ≤ ||ω 0 • λ -ω 0 • λ|| ∞ + ≤ η ω 0 •λ ( ) + ,
where η ω 0 •λ is the modulus of continuity modulus of ω 0 • λ. Therefore, since 1 τ (ω 0 •λ ) = 1 τ (ω ) by definition of λ and

Ψ 1 (ω 0 , R 1 , R1 ) • λ -Ψ 1 (ω , R 1 , R 1 )) = ω 0 • λ -ω + 1 τ (ω 0 •λ ) 1 τ (ω )=σa (R 1 -R 1 ) + 1 τ (ω )=σ b ( R 1 -R1 ) . Thus λ satisfies ||λ -e|| ≤ ( τ (ω )+1 τ (ω 0 •λ) ) and ||Ψ 1 (ω 0 , R 1 , R1 ) • λ -Ψ 1 (ω , R 1 , R 1 ))|| ∞ ≤ η ω 0 •λ ( ) + + 2 which proves that (ω 0 , R 1 , R1 ) is a continuity point for Ψ 1 .
For k ≥ 2, define recursively the maps

Ψ k : D([0, ∞), R 2 ) × R N + × R N + → D([0, ∞), R 2 ) (40) (ω, (R i , Ri ) i≥1 ) → Ψ 1 (Ψ k-1 (ω, (R i , Ri ) i=1..k-1 ), R k , Rk ).
To simplify notation we will denote the argument of Ψ k as (ω, R, R)(= (ω, (R i , Ri ) i≥1 ) although it is easily observed from (40) that Ψ k only depends on the first k elements

(R i , Ri ) i=1..k ) of R, R. Lemma 4. If (ω, R, R) ∈ C([0, ∞), R 2 \{(0, 0)}) × R N + × R N + such that (0, 0) / ∈ Ψ k (ω, R, R)([0, ∞) ) (41) then Ψ k is continuous at (ω, R, R). Let (R i , Ri ) i≥1 , (R i , R i ) i≥1
, two sequences of random variables on R 2 + and define

Ω k (R, R) = ∩ k j=0 Ψ j (C([0, ∞), R 2 \{(0, 0)}), R, R)
where we have set Ψ 0 = Id. Consider ω 0 ∈ Ω k (R, R), and ω ∈ D([0, T ], R 2 + ), such that:

d J 1 (ω 0 , ω) + sup i=1..k |R i -R i | + sup i=1..k | Ri -R i | ≤ .
An application of the triangle inequality yields

d J 1 (Ψ k (ω 0 , (R i , Ri )), Ψ k (ω , (R i , R i ))) ≤ d J 1 (Ψ k (ω 0 , (R i , Ri )), Ψ k (ω , (R i , Ri ))) + d J 1 (Ψ k (ω , (R i , Ri )), Ψ k (ω , (R i , R i )))
where the last term converges to zero when goes to zero by continuity of Ψ 1 .

We can now prove Theorem 1.

Proof of Theorem 1. Since ω is continuous, the jumps of Ψ(ω, R, R) correspond to the first exit times from the orthant of the paths Ψ k (ω, R, R). Therefore, if (R n ) n≥1 , ( Rn ) n≥1 have no accumulation points on the axes, the paths Ψ(ω, R, R) only has a finite number of discontinuities on [0, T ] for any T > 0. So, for any T > 0, there exists k(T ) such that Ψ = Ψ k(T ) . Then thanks to Lemma 4, Ψ is continuous on the set of continuous trajectories whose image has a finite number of discontinuities and does not contain the origin. ) i≥1 be stationary arrays of random variables which satisfy Assumptions 1 and 2. Let (N a,n t , t ≥ 0) and (N b,n t , t ≥ 0) be the counting processes defined in (15). Then

  N a,n nt i=1 V a,n i √ n , N b,n nt i=1 V b,n i √ n   t≥0 J 1 ⇒ n→∞ ΣB t + t(λ a V a , λ b V b ) t≥0 ( 42
)
where B is a standard planar Brownian motion and

Σ t Σ = λ a v 2 a ρ √ λ a λ b v a v b ρ √ λ a λ b v a v b λ b v 2 b , (43)
Proof: First we will prove that the sequence of processes

  [λ a t] i=1 V a,n i √ n , [λ b t] i=1 V b,n i √ n   t≥0 J 1 ⇒ n→∞ ΣB t + t(λ a V a , λ b V b ) t≥0
weakly converges in the J 1 topology. Using the Cramer-Wold device, it is sufficient to prove that for (α,

β) ∈ R 2 ,   α [λ a t] i=1 V a,n i √ n + β [λ b t] i=1 V b,n i √ n   t≥0 ⇒ n→∞ (αλ a V a + βλ b V b ))t + (α 2 λ a v 2 a + β 2 λ b v 2 b + 2ραβv a v b √ λ a λ b )B t
If λ a ∈ Q and λ b ∈ Q, it is possible to find λ such that λ a /λ ∈ N and λ b /λ ∈ N. Let for all (i, n) ∈ N 2 , W n i = α V a,n (λ a /λ)(i-1)+1 + V a,n 2 + ... + V a,n λ a i/λ + β V b,n (λ b /λ)(i-1)+1 + V b,n 2 + ... + V b,n λ b i/λ , then for all t > 0,

α [λ a t] i=1 V a,n i √ n + β [λ b t] i=1 V b,n i √ n = [λt] i=1 W n i √ n .
For all n > 0, (W n i , i ≥ 1) is a sequence of stationary random variables. Therefore, thanks to (Jacod and Shiryaev 2003, Chap.VIII, Thm 2.29, p.426), and the fact that var(W n 1 ) + 2

∞ i=2 cov(W n 1 , W n i ) n→∞ → σ 2 , ( 44
)
the sequence of processes

∞ i=2 cov(W n 1 , W n i ) = α λ a λ v 2 a + β λ b λ v 2 b + 2ρ αβ √ λ a λ b λ v a v b ,
where ρ is given in ( 11) and

lim n →∞ E[W n i ] = α λ a λ V a + β λ b λ V b ,
which completes the proof of the convergence in (44). The law of large numbers for renewal processes implies that the following sequence of processes converges to zero in the J 1 topology [START_REF] Iglehart | The equivalence of functional central limit theorems for counting processes and associated partial sums[END_REF] To identify the infinitesimal generator of the process, we note that h ∈ C 0 (R 2 + ) is in the domain of the infinitesimal generator if for all (x, y) ∈ R 2

+ lim t→0 E[h(Q t ) -h(Q 0 )|Q 0 = (x, y)] t < ∞.
For x > 0, and y > 0, a classical computation shows that if h ∈ C 2 (]0, ∞[×]0, ∞[),

E[h(Q t )|Q 0 = (x, y)] = h(x, y)+t λ a V a ∂h ∂x + λ b V b ∂h ∂y + λ a v 2 a 2 ∂ 2 h ∂x 2 + λ b v 2 b 2 ∂ 2 h ∂y 2 + 2ρ √ λ a λ b v a v b ∂ 2 h ∂x∂y +o(t),
which leads to equation (13). To examine whether the operator G is closable on R 2 + we note that, for h ∈ C

Figure 2

 2 Figure 2 Number of shares per event for events affecting the ask. The stock is Citigroup on the 26th of June 2008

Figure 4

 4 Figure 4Left: Average lifetime, in milliseconds of a spread larger than one tick for Dow Jones stocks. Right: Average lifetime, in milliseconds of a spread equal to one tick.

Figure 5

 5 Figure 5Joint density of bid and ask queue sizes after a price move (Citigroup, June 26th 2008).

Figure 6

 6 Figure 6Autocorrelogram of the sequence of order sizes. Order coming at the ask on the left and at the bid on the right.

Figure 10

 10 Figure 10 represents the empirical distribution functions P[T a > u] and P[T b > u] in logarithmic scale. Both empirical distributions exhibit thin, exponential-type tails (which implies in particular that T a and T b have finite expectation).

Figure

  FigureAutocorrelogram of the sequence of durations for events at the ask (left) and the bid (right).

Figure 11

 11 Figure 11Empirical distribution of the ratio√ n/V n,a Var(V n,a1) showing the relative importance of average change vs fluctuations in queue size, for stocks in the Dow-Jones index during June 08 (see Section 4.1). Low values of the ratio indicate that intraday changes in bid/ask queue size are dominated by fluctuations, rather than the average motion of the queue. Left: bid side. Right: ask side.

Figure 13

 13 Figure 13Variance of batch sizes of n orders, for General Electric shares, on June 26th, 2008. Left: ask side. Right: bid side.

Figure 14

 14 Figure 14Correlation ρ between bid and ask queue sizes for different scenario. 1 -(l +m) represents the proportion of traders using both market and limit orders, γ the proportion of limit orders and (1-γ) the proportion of market orders.

  then shows that the process M τ stopped at τ is a martingale, and conditioning with respect to(Q b 0 , Q a 0 ) = (x, y) gives u(x, y) = p up (x, y) Assume now V a = V b = 0. Using a change of variable x → x √ λ b v b and y → y √ λ a v a ,one only needs to consider the case where √ λ b v b = √ λ a v a . Up to the first hitting time of the axes, (Q t , t ≥ 0) is identical in law to Q = AB where A = cos(β) sin(β) sin(β) cos(β) , with β satisfying ρ = sin(2β), β ≤ π/4 and B a standard planar Brownian Motion with identity covariance. Using polar coordinates (x, y) = (r cos θ, r sin θ) we have φ(r, θ) := p up 1 (r A -1 (cos(θ), sin(θ)) = p up 1 r cos 2 (β) -sin 2 (β) (cos(β + θ), sin(θβ)) C = {(r, θ), r > 0, θ ∈] -β, π 2 -β[}, with the boundary conditions

  Figure 15p up 1 as a function of the bid-ask imbalance variable θ = arctan(y/x) for ρ = 0 (blue line), ρ = -0.7 (green line) and ρ = -0.9 (red line).

6. 3 .

 3 Functional central limit theorem for the net order flow Proposition 3. Let (T a,n i , T b,n i ) i≥1 and (V a,n i , V b,n i

  As above, one can define an integer λ n such that λ a n λn ∈ Q andλ b n λn ∈ Q. Let for all (i, n) ∈ N 2 , W n i = α V a,n (λ a n /λn)(i-1)+1 + V a,n 2 + ... + V a,n λ a n i/λn + β V b,n (λ b n /λn)(i-1)+1 + V b,n 2 + ... + V b,n λ b n i/λn ,One has for all t > 0, above holds even if λ a or λ b are not rationals. On one hand,var(W n i ) = var α(V a,n (λ a n /λn)(i-1)+1 + ... + V a)(i-1)+1 ... + V a,n λ a n i/λn ) + β 2 var V b,n (λ b n /λn)(i-1)+1 ... + V b,n λ b n i/λn ) + 2αβcov V a,n (λ a n /λn)(i-1)+1 ... + V a,n λ a n i/λn , V b,n (λ b n /λn)(i-1)+1 ... + V b,n λ b n i/λn ) .On the other hand, for all i ≥ 2+ V a,nλ a n /λn , V b,n 1 ... + V b,n λ b n /λn + 2αβ ∞ i=2 cov V a,n 1 ... + V a,nλ a n /λn , V b,n (λ b n /λn)(i-1)+1 + ... + V b,

  : (N a,n nt ) t≥0 n→∞ ⇒ ([λ a t]) t≥0 , and (N b,n nt ) t≥0 n→∞ ⇒ ([λ b t]) t≥0, Identification of the heavy traffic limit Lemma 5. The process Q is a Markov process with values in R 2 + and infinitesimal generator (G, dom(G)) given by (13) anddom(G) = {h ∈ C 2 (]0, ∞[×]0, ∞[, R) ∩ C 0 (R 2+ , x, 0), (u, v)))F (du, dv), h(0, y) = ]0,∞[ 2 h(g((0, y), (u, v))) F (du, dv)}

2 +

 2 2 (]0, ∞[×]0, ∞[) ∩ C 0 ([0, ∞), R 2 ) and (x, y) ∈ R 2 + , E[h(Q t )|Q 0 = (x, 0)] = ]0,∞[ 2 E[h(Q t )|Q 0+ = g((x, 0), (u, v))]F (du, dv) = ]0,∞[ 2 (E[h(Q t )|Q 0+ = g((x, 0), (u, v))] -h(g((x, 0), (u, v))) + h(g((x, 0), (u, v)))) F (du, dv) = R(tGh(g((x, 0), (u, v))) + h(g((x, 0), (u, v)))) F (du, dv) + o(t).

Table 1

 1 A hierarchy of time scales.

		Average no. of Price changes
		orders in 10s	in 1 day
	Citigroup	4469	12499
	General Electric	2356	7862
	General Motors	1275	9016

Table 3

 3 Percentage of observations with a given bid-ask spread (June 26th, 2008).

  be a right-continuous function with left limits (i.e. a cadlag function), R = (R n ) n≥1 and R = ( Rn ) n≥1 two sequences with values in R 2 + . There exists a unique cadlag function Ψ

Table 4

 4

  The following table shows the parameters (19) estimated from high frequency records or order book events for three liquid US stocks.

		Std deviation of Std deviation of
		Bid queue	Ask queue	µ b	µ a	ρ
	Citigroup	6256	4457	-1033 -2467 0.07
	General Electric	2156	2928	-334 -1291 0.03
	General Motors	578	399	+78	-96 -0.04

Table 5

 5

so as t → 0, we have

Thus the limit t → 0 is well defined only if h verifies, for x > 0, y > 0,

This is a Wentzell boundary condition [START_REF] Taira | On the existence of Feller semigroups with Boundary conditions[END_REF]) which corresponds to a jump to the interior whenever the process reaches the boundary of the quadrant. G is thus closable on the set

and, for h ∈ dom(G) we have

The elliptic operator defined by the Laplacian on (0, ∞) 2 with Wentzell boundary conditions (45) thus admits a closure (G, dom(G)) on R 2 + and verifies the assumptions of [START_REF] Galakhov | On feller semigroups generated by elliptic operators with integrodifferential boundary conditions[END_REF] [Theorem 3.1]. [START_REF] Galakhov | On feller semigroups generated by elliptic operators with integrodifferential boundary conditions[END_REF][Theorem 3.1] then implies the existence of a R 2 + -valued Feller process Q, unique in law, whose infinitesimal generator (G, dom(G)). The limit process Q is thus a R 2 + -valued Markov process associated with this semigroup.