Real-Time Detection of Volatility in Liquidity Provision
RReal-Time Detection of Volatility in Liquidity Provision
Matt Brigida ∗ November 5, 2020
Abstract
Previous research has found that high-frequency traders will vary the bid or offer price rapidly overperiods of milliseconds. This is a benefit to fast traders who can time thier trades with microsecondprecision, however it is a cost to the average market participant due to increased trade execution priceuncertainty. In this analysis we attempt to construct real-time methods for determining whether theliquidity of a security is being altered rapidly. We find a four-state Markov switching model identifies astate where liquidity is being rapidly varied about a mean value. This state can be used to generate asignal to delay market participant orders until the price volatility subsides. Over our sample, the signalwould delay orders, in aggregate, over 0 to 10% of the trading day. Each individual delay would only lasttens of milliseconds, and so would not be noticable by the average market participant.
JEL Codes:
G10; G12; C24; C45
Keywords:
High-Frequency Trading; Liquidity; Markov-Switching Models ∗ SUNY Polytechnic Institute, 100 Seymour Rd., Utica, NY 13502, [email protected] a r X i v : . [ q -f i n . T R ] N ov he goal of this analysis is to construct methods to determine, in real-time, when the volatility of theliquidity provided is being rapidly changed around a mean value, which is consistent with the effect of analgorithm or set of algorithms. Such methods would allow the creation of orders which can be canceled, ordelayed, if the market switches to such a regime with unstable liquidity. This is analogous to the crumblingquote signal from the Investors Exchange (outlined in Bishop (2017)).Such real-time detection is a difficult task, though identification does not have to be perfect. Thethreshold is that investors choose to use the order—that it is correlated enough with undesirable activitythat it adds value to the investor to submit the order type. For the order type to have worth to investorsalgorithmic activity, or other processes which rapidly change liquidity around a mean value, which is a costto the average investor must exist.Hasbrouck (2018) found evidence for substantial volatility in the bid and offer prices which was notdue to fundamental changes in the asset value. The cost of this volatility is not borne equally by traders.Faster traders are able to choose the point (in microseconds) at which they trade. Slower traders, however,will receive a trade price some time later (maybe seconds) after they attempt to submit a marketable order.This trade price is a random variable, and they are exposed to price risk which is a function of the expectedvariation of the bid (or offer) price over the time from when they submitted the order to when it is matchedby the exchange.So when fast traders change the bid/ask price quickly, slower traders still expect to receive/pay thesame amount for each sell/buy order, however they have increased uncertainty. This increased risk withoutincreased compensation should be avoided by any rational investor. The goal of our analysis is to helpinvestors find ways to delay their order until the execution price of their order has more certainty. Since thevolatility can occur in milliseconds, the method of identification must itself be algorithmic.Note, investors should attempt to avoid these periods of increased uncertainty even if the source of theuncertainty is not high-frequency traders. We therefore don’t attempt to determine the source of uncertainty,but rather, in real time, identify when such variations in liquidity are occurring.Both spread and depth pose substantial risk, particularly for institutional investors who tend to trade inqualtities far larger than what is available at the inside quotes. Despite this many seminal models of marketmaking under asymmetric information ignore market depth by assuming a unit size for all trades (Copelandand Galai (1983); Glosten and Milgrom (1985); Easley (1992)). Alternatively, in Kyle (1985) market depth isimplicitly incorporated in the model through requiring specialists to supply complete pricing functions. Inour analysis we will consider the time-series of liquidity available in the orderbook within a set distance fromthe bid-ask midpoint.Our algorithm will attempt to filter out the other various drivers of price and market depth changes. Forexample, French and Roll (1986) found evidence that stock price volatility is driven by private informationbeing incorporated into market prices via trading. Lee, Mucklow, and Ready (1993) studied the relationshipbetween spreads and depth around earnings announcements. So we are attempting to find a state whereprice and market depth are changing in a manner inconsistent with trading on private information or aroundevents. Notably, this first source of price and depth change would impart a directional bias to prices, and inthe case of Lee, Mucklow, and Ready (1993) the spread widened. Alternatively, the high-frequency tradingwe are attempting to identify does not change mean price or market depth as in these former cases. We use data for the heavily traded E-Mini S&P 500 Futures contract. Price discovery in the equity marketoccurs in this contract (Hasbrouck (2003)). Trading hours from Sunday–Friday from 6:00 p.m. to 5:00 p.m.Eastern Time (ET). Contract value is $50 times the futures price. Cash delivery with expirations every 3months. Traded on the Chicago Mercantile Exchange (CME) (pit and electronic (Globex)).The reason we use CME Data ES is because, in addition to being the first place that information isincorporated into prices and trading overnight, all trades and quotes take place in this one central book. Sothere is no delay in orders due to location. 2ata are Market Depth Data for E-Mini S&P 500 futures (Globex), for the trading week from November7 to November 11, 2016. The data were purchased directly from the CME. We focus our results on November9 2016 because it was the trading day where results of the US Presidential election were released, and thereforethere were high levels of trade and quote volume, which makes the presence of algorithmic activity morelikely.Market Depth Data contains all market messages (trade/limit order updates) to and from the CME,and is time-stamped to the nanosecond. The data also includes tags for aggressor side. Using this data wecan recreate the ES orderbook with nanosecond resolution and up to 10 levels deep. The data are encoded inthe CME’s FIX/FAST message specification . We have made the translation scripts used in this analysisfreely available .In the following charts and analysis it is helpful to note the difference between clock and market time .When considering the nanosecond (one-billionth of a second) level, the market has long periods of inactivityinterspersed with periods of activity. Our data set only contains these periods of activity (and of course thelength of time since the previous period of activity). Otherwise we would require a time series of 1 billiondata points to analyze each second. Our challenge is that of unsurpervised learning —we are attempting to identify a state without trainingdata providing the states for a sample of data. A classic problem of this type in the economics literature isto determine if the economy is in an expansion or recession. In this expansion/recession analysis Markovregime-switching regressions are used (see for example the method employed by the US Federal Reserve).We’ll use a similar approach in our analysis to determine periods of stable, and unstable, liquidity driven byalgorithmic activity. Our exact model is outlined below.We measure liquidity on each side of the book as the amount of ES that can be bought within onepoint of the present bid-offer midpoint. One point is equivalent to 4 ticks (so maximum the inside quoteand 3 additional levels of the book). Results below are for the November 9, 2016 trading day, which is themost likely to exhibit algorithmic trading activity due to the large public release of information, and theconsequent portfolio rebalancing and increased trade volume.
There is no test for the proper number of states in a multiple state model. We thus estimate an increasingnumber of states and let the interpretation of the results and standard tests of the residuals, in each state, toguide us to finding a state consistent with algorithmic activity.The two-state version of our model is:
Liq t = ( α + β Liq t − + β ∆ BAM + (cid:15) , (cid:15) ∼ N (0 , σ ) α + β Liq t − + β ∆ BAM + (cid:15) , (cid:15) ∼ N (0 , σ ) P ( s t = j | s t − = i ) = p ij for i, j ∈ , and X j =1 p ij = 1where Liq t − is the liquidity in the previous period and ∆ BAM is the most recent change in the bid-askmidpoint. There are two states, denoted by s and s , and p ij denotes the probability that the state is j https://github.com/Matt-Brigida/CME-FIX-FAST-Translator i in the previous period. We estimate the model via the Hamilton Filter with a customimplementation in C++ due to the large number of points in our time series.Similar to the bid and ask volatility estimate in Hasbrouck (2018), we estimate the model for the bidand ask sides of the book separately. This is because the rapid deviations from a mean liquidity value, whichwe are attempting to identify, largely affect one side of the book, and so are more likely to be an artifact ofthe trading process rather than due to fundamental information. Nonetheless, modeling the entire book (bidand ask sides jointly) would include more information in the parameter estimates, such as spillover effects.However this would increase the time required to estimate parameters as well as the time it takes to create astate prediction. Since the algorithm must be very quick to be useful, we err on the side of speed relative tothe benefit of the information in both sides of the spread. The two-state model is picking up states of changing liquidity and stable liquidity. In both the bid and offermodels, the first state had a coefficient of 1 on the previous liquidity, and a small residual standard deviation.This state is consistent with no public or private information being incorporated into prices, and little in themarket changing.The second state, which has a higher residual variance, exhibits evidence of changing liquidity. Howeverthe coefficient on previous liquidity, and the intercept are significantly different between the two models.Accordingly, state 2 may be driven by liquidity changing for various reasons. These results motivate a 3 statemodel where we differentiate the state with changing liquidity into two states—one representing changingliquidity due to HFT activity:• Stable liquidity• Normal changing liquidity• Changing liquidity due to HFT
Liq t = ( .
00 + 1 . Liq t − + 0 . BAM + (cid:15) , (cid:15) ∼ N (0 , . − .
83 + 0 . Liq t − − . BAM + (cid:15) , (cid:15) ∼ N (0 , . Liq t = ( .
42 + 1 . Liq t − − . BAM + (cid:15) , (cid:15) ∼ N (0 , . .
00 + 1 . Liq t − + 0 . BAM + (cid:15) , (cid:15) ∼ N (0 , . The first state in the 3 state model again exhibits stable liquidity. The following two states exhibit varyingvolatility which is driven by different factors. In state 2 liquidity is driven by a change in the bid-ask midpoint.This is consistent with liquidity provision in reaction to a movement in the market—posssibly driven by newinformation.In state 3, however, a change in the bid-ask midpoint has no effect on liquidity. Similarly previousliquidity explains only a quarter to a third of present liquidity, and the variance of the residual is the highestin state 3. If there is HFT activity present, it is most likely within state 3. Note, these results are consistentacross both bids and asks. Lastly, we’ll estimate the parameters of a four state model to see if state 3 is acomposite of other states.
Liq t = − .
00 + 1
Liq t − − . BAM + (cid:15) − .
09 + 0 . Liq t − + 1 . BAM + (cid:15) − .
01 + 0 . Liq t − + 0 . BAM + (cid:15) ov 0914:56:56 Nov 0914:56:58 Nov 0914:56:59 Nov 0914:57:00 Nov 0914:57:01 Nov 0914:57:02 Nov 0914:57:03 Nov 0914:57:04 Figure 1: Two state Markov-Switching model of liquidity available at the bid.5 ov 0914:56:56 Nov 0914:56:58 Nov 0914:56:59 Nov 0914:57:00 Nov 0914:57:01 Nov 0914:57:02 Nov 0914:57:03 Nov 0914:57:04
Figure 2: Two state Markov-Switching model of liquidity available at the offer.6 here (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . Nov 0914:56:56 Nov 0914:56:58 Nov 0914:56:59 Nov 0914:57:00 Nov 0914:57:01 Nov 0914:57:02 Nov 0914:57:03 Nov 0914:57:04 s2 s3 Figure 3: Three state Markov-Switching model of liquidity available at the bid.
Liq t = − .
00 + 1
Liq t − − . BAM + (cid:15) .
38 + − . Liq t − + 0 . BAM + (cid:15) .
12 + 0 . Liq t − + 0 . BAM + (cid:15) here (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . Nov 0914:56:56 Nov 0914:56:58 Nov 0914:56:59 Nov 0914:57:00 Nov 0914:57:01 Nov 0914:57:02 Nov 0914:57:03 Nov 0914:57:04 s2 s3 Figure 4: Three state Markov-Switching model of liquidity available at the offer.
Similar to the three-state equation, the first two states represent stable liquidity, and changing liquiditydriven by changes in the bid-ask midpoint. State 3 exhibits negative relationships between previous andpresent liquidity. The standard deviation of the error term is moderately high in this state, however it isabout a quarter to a third of the standard deviation of the error term in state 4.8tate 4 is most consistent with the type of HFT activity we are trying to identify. In state 4 liquidityremains constant with substantial variability around the stable mean liquidity amount.
Liq t = . . Liq t − + 0 . BAM + (cid:15) − . − . Liq t − + 0 . BAM + (cid:15) . − . Liq t − − . BAM + (cid:15) − . . Liq t − + 0 . BAM + (cid:15) where (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . Liq t = . . Liq t − − . BAM + (cid:15) − . . Liq t − − . BAM + (cid:15) − . − . Liq t − − . BAM + (cid:15) − . . Liq t − − . BAM + (cid:15) where (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . (cid:15) ∼ N (0 , . Bid side of the orderbook . Below are coefficient esti-mates from the Markov-switching regressions. The standard errorsare next to the coefficient in parentheses. The coefficients were esti-mated using the nanosecond time-stamped orderbook ranging from6:00 PM EST on November 8, 2016 to 5:00 PM EST on November 9,2016. There are 9,965,673 changes to the orderbook for this period.Coefficient Two-State Three-State Four-State α α -0.83(0.0007) -0.09(0.0250) -0.05(0.0033)9oefficient Two-State Three-State Four-State α -0.01(0.0140) 0.37(0.0025) α -0.16(0.0018) β β β β -0.06(0.0075) 1.02(0.670) 0.85(1.1350) β β β β σ σ σ σ Ask side of the orderbook . Below are coefficientestimates from the Markov-switching regressions. The standarderrors are next to the coefficient in parentheses. The coefficients wereestimated using the nanosecond time-stamped orderbook rangingfrom 6:00 PM EST on November 8, 2016 to 5:00 PM EST onNovember 9, 2016. There are 9,965,673 changes to the orderbookfor this period.Coefficient Two-State Three-State Four-State α α α α -0.00(0.02269) β β -0.12(0.0059) -0.10(0.2259) -0.26(0.1421) β β β β β β -0.50(0.9778) σ σ σ σ In this analysis we have used Markov-Switching regression models to identify the presence of high-frequencytraders who are rapidly changing volatility. Using a model with four states, we identify a state with a stablemean liquidity, but substantial variability in liquidity around the mean. That is there is rapidly changingliquidity, which does not affect overall liquidity or the price.Since trading in this state benefits high-frequency traders at the expense of slower retail order flow, atransition to this state can serve as a signal to delay slower traders’ orders. The delay being mere tens of10 ov 0914:56:56 Nov 0914:56:58 Nov 0914:56:59 Nov 0914:57:00 Nov 0914:57:01 Nov 0914:57:02 Nov 0914:57:03 Nov 0914:57:04
Prob. State 1
Prob. State 2
Prob. State 3
Prob. State 4
Figure 5: Four state Markov-Switching model of liquidity available at the bid.11 ov 0914:56:56 Nov 0914:56:58 Nov 0914:56:59 Nov 0914:57:00 Nov 0914:57:01 Nov 0914:57:02 Nov 0914:57:03 Nov 0914:57:04
Prob. State 1
Prob. State 2
Prob. State 3
Prob. State 4
Figure 6: Four state Markov-Switching model of liquidity available at the offer.12illiseconds, it will not be perceptible to the typical trader. And while this may save each trade a smallamount, in aggregate such a delayed order type would provide substatial savings across all non-high-frequencytraders. Delaying orders due to the signal can be offered to retail traders through a particular order type. Asimilar strategy is used by the IEX’s ‘crumbling quote’ order.13
Appendix
In tables 3 and 4 below are parameter estimates from the following 4-state Markov-Switching model.Table 3: Parameter estimates from a 4-state Markov-switching model on the liquidity available on the bid sideof the orderbook. There are 2,917,466 entries to the book over the Nov. 7 trading day. There are 3,502,097book entries on Nov. 8. There are 9,965,673 book entries on Nov. 9, which is the trading day over which theresults of the election were announced. There were 7,346,604 book entries on Nov. 10, and 4,905,882 on Nov.11. The duration of the signal (Sig. Dur.) was calculated assuming a 10 millisecond delay for each signal,and a 0.2 threshold for the signal generation.Coefficient Nov. 7 Nov. 8 Nov. 9 Nov. 10 Nov. 11 α α -0.1132 -0.1694 -0.0594 -0.4849 -0.4917 α α -0.2210 -0.1783 -0.1626 -0.2966 -0.3563 β β -0.1579 0.0754 0.1319 0.0174 0.2716 β β β β -0.1324 -0.1707 -0.1802 -0.1676 -0.3864 β β σ σ σ σ α α -0.0007 0.0008 -0.0055 0.0011 -0.0051 α -1.1325 -1.1374 -1.1325 -0.1314 -1.1329 α -0.0042 0.0052 -0.0048 -0.0060 0.0015 β β -0.2681 -0.2707 -0.2681 -0.2643 -0.0033 β β -1.1161 -1.1034 -1.1200 -1.1195 -1.291 β β -0.0121 -0.0153 -0.0122 -0.0082 -0.0064 β β -0.5031 -0.5057 -0.5034 -0.5006 -0.5136 σ σ σ σ eferences Bishop, Allison. 2017. “The Evolution of the Crumbling Quote Signal.”
Available at SSRN 2956535 .Copeland, Thomas E., and Dan Galai. 1983. “Information Effects on the Bid-Ask Spread.”
The Journal ofFinance
38 (5): 1457–69. https://doi.org/10.1111/j.1540-6261.1983.tb03834.x.Easley, Maureen, David And O’Hara. 1992. “Time and the Process of Security Price Adjustment.”
TheJournal of Finance
47 (2): 577–605. https://doi.org/10.1111/j.1540-6261.1992.tb04402.x.French, Kenneth R., and Richard Roll. 1986. “Stock Return Variances.”
Journal of Financial Economics
Journal of Financial Economics
14 (1): 71–100.https://doi.org/10.1016/0304-405x(85)90044-3.Hasbrouck, Joel. 2003. “Intraday Price Formation in Us Equity Index Markets.”
The Journal of Finance
Journal of Financial andQuantitative Analysis
53 (2): 613–41.Hendershott, Terrence, Charles M Jones, and Albert J Menkveld. 2011. “Does Algorithmic Trading ImproveLiquidity?”
The Journal of Finance
66 (1): 1–33.Kyle, Albert S. 1985. “Continuous Auctions and Insider Trading.”
Econometrica
53 (6): 1315. https://doi.org/10.2307/1913210.Lee, Charles M. C., Belinda Mucklow, and Mark J. Ready. 1993. “Spreads, Depths, and the Impactof Earnings Information: An Intraday Analysis.”