Skip to main content
PLOS ONE logoLink to PLOS ONE
. 2014 Feb 18;9(2):e88095. doi: 10.1371/journal.pone.0088095

Ergodic Transition in a Simple Model of the Continuous Double Auction

Tijana Radivojević 1, Jonatha Anselmi 1, Enrico Scalas 2,1,*
Editor: Guido Germano3
PMCID: PMC3928121  PMID: 24558377

Abstract

We study a phenomenological model for the continuous double auction, whose aggregate order process is equivalent to two independent Inline graphic queues. The continuous double auction defines a continuous-time random walk for trade prices. The conditions for ergodicity of the auction are derived and, as a consequence, three possible regimes in the behavior of prices and logarithmic returns are observed. In the ergodic regime, prices are unstable and one can observe a heteroskedastic behavior in the logarithmic returns. On the contrary, non-ergodicity triggers stability of prices, even if two different regimes can be seen.

Introduction

The continuous double auction is the trading system used by most regulated equity markets. The auction is called double as demand and offer are collected in a book where orders to buy and to sell are registered, and continuous because orders can be placed at any instant in a given daily time window. The detailed rules for trading may be different from one stock exchange to the other, but, essentially, things work as follows. Traders can either place buy orders (bids) or sell orders (asks) which are then registered in a book for a particular stock traded in the exchange. The limit order is the typical one. A bid limit order is specified by two numbers: the quantity Inline graphic that trader Inline graphic wants to buy and the upper limit price Inline graphic she is willing to pay for a single share. An ask limit order is an order to sell Inline graphic units of the share at a price not smaller than a limit price Inline graphic selected by trader Inline graphic. The couples Inline graphic and Inline graphic are written in the book and ordered from the best bid to the worst bid and from the best ask to the worst ask, respectively. The best bid is the price Inline graphic, where Inline graphic is the set of traders placing bids, whereas the best ask is the price Inline graphic, where Inline graphic is the set of traders placing asks. At every time Inline graphic, one has that Inline graphic. Occasionally, a market order may take place, when a trader accepts a best bid or best ask price from the book, and the Inline graphic-th trade occurs at the epoch Inline graphic. Stock exchanges specify rules for the priorities of limit orders placed at the same price and for execution of market orders with quantities that are not totally available at the present best price. The sequence of prices Inline graphic at which trades take place at epochs Inline graphic is an important process for understanding market dynamics. As detailed below, one can describe this sequence in terms of a suitable continuous-time random walk.

Model

In our model, following [1], prices assume Inline graphic integer values from Inline graphic to Inline graphic. A price can be regarded as a class where orders are placed. This way of representing prices is a faithful representation of what happens in real markets due to price discretization. The only unrealistic feature is the presence of an upper limit to prices which we keep to ensure partial analytical tractability. Note that orders can be considered as objects to be classified by prices at which they are placed (see [2] for a general discussion on the problem of allocating objects to classes). We only consider two kinds of orders, namely, limit orders and market orders.

As discussed above, limit orders can be of two types: limit bid orders, i.e. orders to buy one share and limit ask orders, i.e. orders to sell one share. Market orders are also of two types as either the best limit bid order or the best limit ask order are accepted when a transaction occurs. When a market order arrives, only one limit order will be removed either from the best bid category or the best ask category, provided that these categories contain at least one order. In other words, we assume that all the orders are characterized by quantities equal to one share. We shall further assume that limit ask orders arrive following a Poisson process with rate Inline graphic and that limit bid orders arrive at a rate Inline graphic. These orders are written in the book and they wait until a market order arrives. Remember that the best limit bid orders, namely the limit bid orders offered at the highest price are always strictly smaller than the best limit ask orders, that is the limit ask orders offered at the lowest price. Market orders to buy, accepting one of the best ask orders, arrive in the market separated by exponentially distributed waiting times with parameter Inline graphic, whereas market orders to sell arrive with an exponential distribution of waiting times with parameter Inline graphic. If the book is empty, or if the appropriate side of the book is empty, market orders are not executed. It is necessary to remark that order inter-arrival times are not exponentially distributed in real markets [3] due to the non-stationary behavior of humans [4]. However, to ensure analytical tractability, here we assume that inter-arrival times are exponentially distributed. We shall further assume that limit ask orders are uniformly placed in the price classes from Inline graphic to Inline graphic, where Inline graphic is the class of the current best bids. Conversely, limit bid orders are uniformly placed in the price classes from Inline graphic to Inline graphic, where Inline graphic is the class of the current best asks. As mentioned above, the accessible system states are limited by the condition Inline graphic. When Inline graphic is between Inline graphic and Inline graphic (Inline graphic between Inline graphic and Inline graphic), the bid (respectively, ask) interval is restricted correspondingly. For instance, if Inline graphic, no bids are possible. Finally, if no orders are present in the book, the next bid, Inline graphic, will be uniformly chosen in Inline graphic and the next ask, Inline graphic in Inline graphic, where Inline graphic is the price of the last trade. The specification of an initial price (which can be interpreted as the opening auction price) is then sufficient to start the auction. Figure 1 shows a state of this system and illustrates the meaning of the various descriptions. Note that the model outlined above is essentially the same as in [5] and [6]. In terms of agent-based models, it is a zero intelligence agent-based model [7]. However, our version does not suffer from using odd mathematical objects such as uniform distributions over semi-infinite intervals as in [5] and we do not assume that limit orders arrive only at the best bid/ask prices as in [6]. Actually, in our case limit orders arrive at prices that are different from the best bid/ask. A preliminary discussion of our model was presented in [8].

Figure 1. A state of the system.

Figure 1

Limit bid orders are depicted by circles whereas squares represent limit ask. Each order can be described by a label. An individual description is a list showing, for each limit order, whether it is a bid or an ask and to which category (price) it belongs. Here, it is Inline graphic. A statistical description is a list that gives us the number of limit orders either of bid or of ask type contained in each category. In this case it is Inline graphic for ask orders and Inline graphic for bid orders. Finally, a partition description is the number of categories (prices) with zero limit ask or limit bid orders, one ask/bid limit order, etc.. In this case we have Inline graphic for ask orders and Inline graphic for bid orders.

The trade price process Inline graphic is a continuous-time random walk that we wish to characterize as Cont and de Larrard did in Sections 3 and 4 of [9]. However, they considered fixed bid-ask spread equal to one tick, whereas in our case the bid-ask spread is a random variable. Let Inline graphic denote the epoch of the Inline graphic-th trade; in particular, we are interested in the behaviour of the following random variable

graphic file with name pone.0088095.e054.jpg (1)

called the tick-by-tick logarithmic return, where Inline graphic stands for the natural logarithm. This is the usual variable used in statistical finance and financial econometrics for the analysis of tick-by-tick data [10]. It turns out that the behaviour of Inline graphic crucially depends on the presence or absence of statistical equilibrium in the supply mechanism.

Main Results

Indeed, there are two main regimes in this model and they are triggered by an ergodic transition. Let us denote by Inline graphic the total number of limit ask orders and by Inline graphic the total number of limit bid orders present in the book. By definition, these two random processes are independent and they are Inline graphic queues with rates Inline graphic and Inline graphic and Inline graphic and Inline graphic, respectively [11]. Inline graphic queues are the continuous-time equivalent of birth and death Markov chains. The conditions for the existence of statistical equilibrium (ergodicity) are given by the following inequalities

graphic file with name pone.0088095.e065.jpg (2)

and

graphic file with name pone.0088095.e066.jpg (3)

The intuitive meaning of these conditions is as follows. If the rate of arrival for limit orders is larger than the rate of market orders, then the number of orders in the book eventually explodes. However, in this case, prices will be able to fluctuate only among a few values. When the rate of market orders is larger than the rate of limit orders, the number of orders in the book remains finite and prices are free to fluctuate over the whole available range. In the ergodic regime, the invariant (and equilibrium) distributions of Inline graphic and Inline graphic are given by two geometric distributions

graphic file with name pone.0088095.e069.jpg (4)

and

graphic file with name pone.0088095.e070.jpg (5)

Given the independence between Inline graphic and Inline graphic, the joint probability density is

graphic file with name pone.0088095.e073.jpg (6)

from which one can find the probability of finding an empty book

graphic file with name pone.0088095.e074.jpg (7)

For our further analysis, we shall focus on the case of a symmetric auction, assuming Inline graphic and Inline graphic and we shall consider the ratio Inline graphic as the basic order parameter of the model. In fact, there is no reason for a random auction to be unbalanced towards selling or buying. As discussed above, if Inline graphic, we are in the ergodic regime, whereas for Inline graphic, we are in a regime where the orders accumulate and Inline graphic, for Inline graphic. The two regimes give rise to two radically different behaviours for the tick-by-tick log-returns (1). This is qualitatively shown in Fig. 2, where we report the behavior of prices and log-returns in a Monte Carlo simulation for Inline graphic (Fig. 2 (a)), Inline graphic (Fig. 2 (b)) and for Inline graphic (Fig. 2 (c)). One can see by eye that, in the ergodic regime, high and low log-returns are clustered, whereas, in the non-ergodic one, such a volatility clustering does not occur. Fig. 2 (a) clarifies the origin of clustering. When the price is lower, log-returns are higher and the price process has the persistence behavior typical of random walks which immediately leads to clusters of low and high volatility as the price slowly moves up and down, respectively. The comparison between Fig. 2 (b) and Fig. 2 (c) shows that there are two sub-regimes in the non-ergodic case. If Inline graphic, even if Inline graphic and Inline graphic diverge, the limit orders belonging to the best bid and the best ask can be removed by market orders and prices can fluctuate among a set, whereas if Inline graphic, then after a transient, the number of limit orders belonging to the best bid and the best ask diverges and prices can only fluctuate between two values. In this condition, the price process becomes a random telegraph process. This behavior is justified by the fact that the process of the number of orders at the best bid price (respectively, best ask) can be coupled with the state of an Inline graphic queue with arrival rate Inline graphic (Inline graphic) and service rate Inline graphic (Inline graphic); this is so because limit orders, upon arrival, distribute uniformly over the Inline graphic best prices. If Inline graphic, then the number of orders at the best bid price converges to infinity, as Inline graphic, meaning that all trades will occur at the price where the bids accumulate. If Inline graphic, then the queue of the best bids eventually empties with probability one, meaning that there is a positive probability that the trading price changes. However, if we are in the region Inline graphic, then we know that Inline graphic, as Inline graphic. This means that the queue of the bids at some price will eventually never empty, which means that trades at lower prices will never occur. By symmetry, the same argument holds for asks.

Figure 2. Time series of prices and log-returns.

Figure 2

Time series of prices and log-returns in a system of Inline graphic prices, length of interval for placing orders Inline graphic, with initial price Inline graphic and number of simulated events Inline graphic. (a) ergodic case (Inline graphic); (b) non-ergodic case for Inline graphic (Inline graphic) and (c) non-ergodic case for Inline graphic (Inline graphic).

The transition between regimes can be detected studying the moments of log-returns. In Table 1, we give the descriptive statistics for log-returns, including mean, standard deviation, skewness and kurtosis as well as the autocorrelation coefficient at the first lag of absolute log-returns, Inline graphic, for different values of the parameter Inline graphic. These statistics are computed on 1000 simulation runs with Inline graphic events.

Table 1. Descriptive statistics of log-returns.

Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
mean Inline graphic Inline graphic Inline graphic Inline graphic Inline graphic
st. dev. 0.092 0.078 0.018 0.008 0.003
skewness 0.896 0.287 −0.034 Inline graphic Inline graphic
kurtosis 227.089 277.33 116.679 3.373 2.004
Inline graphic 0.515 0.538 0.304 0.164 Inline graphic

Descriptive statistics of log-returns and the autocorrelation coefficient at the first lag of absolute log-returns (Inline graphic) for different Inline graphic, made on 1000 runs of simulation of Inline graphic events.

Figure 3 shows standard deviation, kurtosis and Inline graphic in more detail, namely mean values and error bars are given for these three quantities estimated from 1000 runs. One can see that these quantities increase in the non-ergodic case.

Figure 3. Mean values and error bars.

Figure 3

Mean values and error bars of the standard deviation (a), kurtosis (b) of log-returns and the first-lag autocorrelation of absolute log-returns (c) as functions of the parameter Inline graphic, estimated from 1000 Monte Carlo simulations.

Our findings can be compared with those presented in a recent study of financial stylized facts [12], where authors find that higher rate of limit orders stabilizes the market by decreasing the standard deviation of returns. In Fig. 4, we plot the sample autocorrelation for the tick-by-tick absolute log-return series for Inline graphic, Inline graphic and for Inline graphic. A slow decay of the ACF in ergodic case, showing long range-memory as well as heteroskedasticity, reminds the stylized facts found in financial data. One can see that this decay is much faster if Inline graphic increases.

Figure 4. Sample autocorrelation functions for the absolute log-returns.

Figure 4

(a) ergodic case (Inline graphic); (b) non-ergodic case for Inline graphic (Inline graphic) and (c) non-ergodic case for Inline graphic (Inline graphic).

In Fig. 5, we plot the complementary cumulative distribution of kurtosis values (Fig. 5 (a)) and of Inline graphic (Fig. 5 (b)) for 1000 simulations and for different values of Inline graphic in order to corroborate the observation made above: there is a jump in the kurtosis of logarithmic returns as well as a jump in the first-lag autocorrelation of absolute log-returns as Inline graphic moves from values larger than Inline graphic to values smaller than Inline graphic.

Figure 5. Empirical complementary cumulative distribution functions.

Figure 5

Empirical complementary cumulative distribution functions of the kurtosis of logarithmic returns (a) and the autocorrelation at the first-lag of absolute log-returns (b) for different values of Inline graphic.

Conclusions

In summary, in this paper we have shown that a symmetric continuous double auction model has three regimes depending on the value of the parameter Inline graphic. If Inline graphic, we are in the ergodic regime and prices are free to fluctuate over the full available price range. In this regime, some of the so-called stylised facts of finance appear, such as the heteroskedasticity of log-returns as shown in Fig. 4 (a). However, this particular behaviour is simply due to the persistence of the price process which is stronger when the parameter Inline graphic is smaller. An eye inspection of Fig. 2 (a) shows that volatility clustering is caused by the fact that when the price is small (close to zero), returns are larger than when the price is large (close to Inline graphic). If Inline graphic is small, the probability of large price jumps is zero and the trade price remains close to its current value for some time. For Inline graphic, we have the transition to a non-ergodic regime which stabilizes prices; they are no longer allowed to freely fluctuate over all the available price range. However, there is a further transition. If Inline graphic, where Inline graphic is the size of the allowed range for limit orders, prices can still fluctuate within a limited range. If Inline graphic, then prices will eventually fluctuate between two values. If one sets Inline graphic, this transition disappears. In fact, if Inline graphic, in the non-ergodic regime, limit orders accumulate only at the best bid and best ask value. Even if this further transition is a feature of our simplified model, the distinction between the ergodic and non-ergodic regimes is relevant for real equity markets. A consequence of these results is that too frequent order removals may lead to price instability. Our educated guess, which will be the subject of further research, is that real markets live in the non-ergodic regime, but not too far from the threshold.

Methods

Monte Carlo simulations

Monte Carlo simulations of the auction model were performed with a MATLAB®code that is included in File S1. There are two functions: cda.m and order.m. cda.m is a plain simulation of the auction following the description in section Model. It calls the function order.m that generates the flow of orders according to the described distributions.

Theory

All the theoretical results presented here are corollaries of theorems on Inline graphic queues from queueing theory [11]. The notation Inline graphic means Markovian arrival process, Markovian server process and 1 server and it is due to Kendall [13].

Supporting Information

File S1

Supporting information.

(PDF)

Acknowledgments

We wish to thank Mauro Politi for inspiring discussions.

Funding Statement

This study was supported by the University of Sussex. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

References

  • 1. Cont R, Stojkov S, Tareja R (2010) A stochastic model for order book dynamics. Operations Research 58: 549–563. [Google Scholar]
  • 2.Garibaldi U, Scalas E (2010) Finitary Probabilistic Methods in Econophysics. Cambridge UK: Cambridge University Press. [Google Scholar]
  • 3. Scalas E, Kaizoji T, Kirchler M, Huber J, Tedeschi A (2006) Waiting times between orders and trades in double-auction markets. Physica A 366: 463–471. [Google Scholar]
  • 4.Barabási AL (2010) Bursts: The Hidden Pattern Behind Everything We Do. Penguin Group US.
  • 5. Smith E, Farmer JD, Gillemot L, Krishnamurthy S (2002) Statistical theory of the continuous double auction. Quant Financ 3: 481–514. [Google Scholar]
  • 6.Zuo S, Li M, Kishimoto K, Endo M (2009) A queuing model for a continuous double- auction trading system. In: 22nd Australasian Finance and Banking Conference 2009. http://ssrn.com/abstract=1456762.
  • 7. Gode DK, Sunder S (1993) Allocative efficiency of markets with zero-intelligence traders: Market as a partial substitute for individual rationality. Journal of Political Economy 101: 119–137. [Google Scholar]
  • 8.Radivojević T, Anselmi J, Scalas E (2012) A stylized model for the continuous double auction. In: Managing Market Complexity, Lecture Notes in Economics and Mathematical Systems. Berlin: Springer, volume 662, pp. 115–125. [Google Scholar]
  • 9. Cont R, de Larrard A (2013) Price dynamics in a Markovian limit order market. SIAM Journal on Financial Mathematics 4: 1–25. [Google Scholar]
  • 10. Scalas E (2006) The application of continuous-time random walks in finance and economics. Physica A 362: 225–239. [Google Scholar]
  • 11.Asmussen S (2003) Applied Probability and Queues. Springer, Berlin.
  • 12. Brandouy O, Corelli A, Veryzhenko I, Waldeck R (2012) A re-examination of the “zero is enough” hypothesis in the emergence of financial stylized facts. J Econ Interact Coord 7: 223–248. [Google Scholar]
  • 13. Kendall DG (1953) Stochastic processes occurring in the theory of queues and their analysis by the method of the imbedded Markov chain. Ann Math Statist 24: 338–354. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

File S1

Supporting information.

(PDF)


Articles from PLoS ONE are provided here courtesy of PLOS

RESOURCES