arXiv:physics/0607076v1 [physics.data-an] 10 Jul 2006Trend arbitrage, bid-ask spread and market dynamicsNikolai Zaitsev∗(submitted to ”Quantitative finance” journal)May-June 2006AbstractMicrostructure of market dynamics is studied through analysis of tick price data. Linear trend is introduced as a tool for such analysis. Trend arbitrage inequality is developed and tested. The inequality sets limiting relationship between trend, bid-ask spread, market reaction and average update frequency of price information. Average time of market reaction is measured from market data.This parameter is interpreted as a constant value of the stock exchange and is attributed to the latency of exchange reaction to actions of traders. This latency and cost of trade are shown to be the main limit of bid-ask spread. Data analysis also suggests some relationships between trend, bid-ask spread and average frequency of price update process.1IntroductionQuestion about market microdynamics is of fundamental importance. It in-fluences wide range of items: bid-ask spread dynamics, interaction of market agents setting market and limit orders, patterns of price formation and provi- sion of liquidity. These subjects are investigated using wide range of analytic tools, trying to capture cross-correlation structure of price evolution and volatilities through time series analysis [Roll] or studying dynamics of price formation through simulation of detailed market mechanics [Smith et.al.]1.These methods concentrate on search of the source of random forces acting over continuous or discrete time sets. These sets are considered homoge- neous when long-term returns are considered. On the shorter scale (in tick data), it is noticed that the trading frequency scales the returns making time sets non-homogeneous. Theoretical construction is built in [Derman]to account for such effect.∗Fortis Bank, Risk Management Merchant Bank, Correspondent e-mail:nikzait-

[email protected] 1Such simulations are part of so-called ’Experimental Finance’.1In contrast to statistical methods, the behavioral finance searches pat- terns of dynamics of collective actions of various market agents making as- sumptions about their perception and searching for equilibrium and/or lim- iting solution to price/spread prediction problem [Schleifer, Bondarenko]. All above mentioned methods analyze price returns. In this article we introduce new object for such analysis, a trend2. Common definition of trend is ”the general direction in which something tends to move”. Visuallytrend can be identified as a line with little random deviations. Of course, trends were studied many times before. However, they were studied often in relation to question of deterministic behavior of price. We think, that the existence of trend is not necessarily determinis- tic and in general does not disapprove statistical nature of price behavior.Indeed, there is a non-zero probability to find straight line in price path gen- erated using, for example, Black-Scholes model [Durlauf]. Despite this fact, crowd of market participants still believes that such trends are due to some hidden bits of information and therefore contribute to trend persistence or otherwise. In this paper we would like to merge these two ideas of considering price evolution through scope of trend and through random walk. Indeed, the presentation of price path in terms of price returns (random walk) issuitable in connection to CAPM and alike theories, where profit and risks are related in search of optimal investment portfolio. On the other side, presentation of price evolution in terms of short-term price trends better conforms description of market microdynamics. The trend is an object worth to study because as we show it gives in- sight into microstructure of market dynamics. It allows direct observation of spread dynamics, price information update, costs, trading activity and response time of the exchange. This information is diluted when correlation analysis of price return series is used. In this paper trends are studied with- out consideration of news impact to the price move but only in relation to dynamics of agents interaction via exchange. Exchange is a dynamic system. It allows traders to interact with each other. It consists of many components. These parts are specialists on thefloor, electronic platform which helps to account and match trades through software and a wire connection to trader computers. Traders use electronic platforms to trade. Both systems, of traders and of exchange, have theirrespective non-zero latencies and therefore the speed of information diffusion is non-zero3. The latencies influence price dynamics and respective trading algorithms.This study draws attention to the influence of dynamics of systems used2In fact, trend was studied many times before, but in context of technical analysisand it was always interpreted as an evidence to some non-random (deterministic) price behavior. 3At the end, there is a hard limit of speed of light in the transmission cables.2for trading on the dynamics of price. We extract information content of such dynamics from trends and spreads data. The article is organized as follows. First, we discuss trend arbitrage. The respective relationship has been derived and is taken as starting point to further analysis. Second, one applies an algorithm searching for linear trend in time series of bids and asks observed on stock markets. Third, several distributions are obtained to support the relationship developed from trend arbitrage requirement. Several outcomes have been discussed as well.2Trend ArbitrageIn the following, one analyze intra-day trend seen in prices of an asset which is traded in double auction. For brevity of explanation we assume two kind of market agents: Special- ists and Investors. Specialists maintain sell- and buy-prices (asks and bids, respectively) in continuous manner. Bids and asks generally move together. Spread between them (spread=ask-bid) tends to some minimum level due to competition between Specialists. This level depends on risk perceived by Specialists to take their market share. In stress situations, especially when price directionally moves to the new level, spread increases. The question now is what this dependency is.A simple example helps to find an answer. Specialist provides bid and askprices earning spread. Investor profits by taking directional bets. Suppose now that the price moves within up-trend, µ, with spread, Spr, see Figure 1.Figure 1: Trend arbitrage relationship.timepricep2Spreadp1t1t2µAskBid3Investor buys asset at ask-price, p1, at t1moment. After a while he sells it. If the trend did not change its direction and Investor waits long enough, till time t2, he can sell asset at bid-price, p2. Investor will make no profit if:0 ≥ p2− p1− Spr + µ · (t2− t1)(1)Investor must meet three conditions to profit for sure:• |µ| is non decreasing during the period between t1and t2;• trading system of Investor is faster than that of Specialist and trading system of Specialist is slower than some market reaction value, τ;• spread is small enough, satisfying (1).Knowing these conditions (consciously or not), Specialist sets spread such that he makes no losses, i.e. p2is kept equal to p1or less. Same arguments are applied to down-trend, which changes µ to |µ|.Therefore, (1) is modified and limit on spread can be set:Spr ≥ |µ| · τ(2)where τ = t2−t1. More general expression must also include additional costs to be paid by Investor related to his trading activity and some structure of characteristic time, τ:Spr ≥ |µ| · (τM+ τS) + fee(3)where fee is a broker fee and similar additive costs, τMis exchange-wide latency and τSis stock specific latency. τScan be attributed to aggregated latencies of trading platforms used by Investors to trade the same stock. These inequalities suggest that the non-zero spread is due to both, trans- action costs and latencies of trading and exchange systems. Now, let us look at the relationships through data analysis perspective.3Data analysis3.1DataTick price/volume data of 33 stocks traded at Amsterdam (NLD), Frankfurt (GER), Madrid (SPA), Paris (FRA) and Milan (ITL) were collected over the second half of the year 2003. This data includes bid, ask and trade prices and respective volumes attached to time stamps. Time period considered is4between 15:30 and 17:30 of European time4. Dividend information was notused because it does not affect our intraday analysis.Data were filtered. Only those bits of information were used in analysis where price of either bid or ask has been updated.Any such change is treated as ”information update”.3.2Trend identificationLinear fit (details can be found elsewhere [Wiki]) was applied to series of one day mid-prices, (ask(ti) + bid(ti))/2. Bid-ask spread, ǫ(ti) = (ask(ti) − bid(ti)), is understood as an uncertainty of observed price information (thisitem to be discussed further). Data were fit continuously. This way real-timefeed is simulated, where only past information is available. An output of fit is series of current trend parameters such as series of impact, p0(ti), series of slope (trend), µ(ti), with respective errors, ǫp(ti), ǫµ(ti). These parameters allow prediction of forward price, ˜ p, and price error, ǫ:˜ p(ti) = p(p0(ti−1),µ(ti−1),ti), and(4)˜ ǫ(ti) = ǫ(p0(ti−1),µ(ti−1),ǫp(ti−1),ǫµ(ti−1),ti).(5)Condition to trigger end of current trend:|˜ p(ti) − p(ti)|q ˜ǫ(ti)2+ ǫ(ti)2> n(6)where n is cut value, which is chosen to be equal to 2.3. This particularchoice of cut-offvalue was determined visually from trends superimposed on the price plot (see Figure (2).There is an intuitive feeling that theless cut-offvalue generates too many spurious trends and dilutes effects we are looking for. Use of price returns is a limiting case for trends with justtwo points. On the other side, the larger cut-offvalue will lead to reduced sensitivity of spread information to trends. Trend search starts at the beginning of each day series with a seed ofthree points. Algorithm continues to fit line till the trigger (6) is hit. It then assumes that within the search time window (between current point and the beginning of current trend) there are two trends. Algorithm startsbackward search in order to find an optimal breaking time point between current and forward trends. The point is found at the minimum of χ2t= (χ2t)cur+ (χ2t)fwd, where (χ2t)iare of current (i = cur) and of forward (i = fwd) trends. This point becomes the end of current trend and the start of forward one. The forward trend becomes current. And so on till the end of day. Each trend is then accompanied with respective information:4this specific choice of time was motivated by wish to study cross-dynamics of European and American markets.5• start and end point within time series, t0and te;• duration of trend in seconds, ∆T = te− t0;• slope, µ, impact, p0, and respective errors, ǫs, ǫpfound at end-point, te;• quadratic average spread,˜Spr =q Σǫ2 n;• number of data points in the fit, Nu.τu= ∆T/Nuaverage time between updates of price (bid or ask) information. τuis also called average update time;• χ2tof the fit, whereχ2t=Xi(˜ p(ti) − p(ti))2 (ǫp)2iTrends and associated data found from intraday data were merged into one single dataset day-by-day. For further analysis a selection cut wasapplied to filter badly fit trends:– χ2t-probability, Prob(χ2t,n.d.f.) 4;Figure 2: Trend fit to bid-ask series of ABN-AMRO. Star-points connected with lines are bid and ask prices (in blue and red, respectively), piece-wisesolid lines in between are fitted trends.1616.0516.116.1516.216.2516.316.3517.2517.317.3517.417.4517.5Time, hoursPrice, euro63.3Price uncertaintyTrend measurement rises important question: what is the measure- ment error of observed price? One possibility is to interpret mid-pricesas observed exactly with equal weights. The errors of fitted line param- eters can be estimated from the sample in a standard way. Anotherway is to assume that the price is governed by some diffusion process and therefore to interpret estimated volatility as current price errors. Both methods seem not acceptable since they do not bear instant in- formation about price uncertainty.We believe that the bid-ask spread is a good candidate to estimate in- stant price uncertainty. In principle, the price error (and spread) must be dependent on the volume to be traded by some arbitrage algorithm,which uses the trend fit. In this case all analysis will change. In this research we concentrate on analysis of the best bids-asks dynamics alone.Example of distribution of χ2t-probability (see Figure 3) demonstrates that our choice is overall correct because the probability is mostlyflattened in range [0,1]5peaking at 1.Figure 3: χ2probability for all found ABN-AMRO trends.00.20.40.60.810100200300400500600Prob(χ2,Nu−2)The rejected trends with χ2t> 0.99 tend to have smaller |µ|. In case of5flat distribution of χ2-probability generally indicates that model errors correctly de- scribe the measurement process.7less expressed trends the market enters intermediate regime known from technical analysis as ”side trend”.4Results4.1Test of trend arbitrage4.1.1Market reaction time, τMLet us make trivial rearrangement of Equation (3) by moving observables to the left side of inequality and dividing both sides by µ:Spr |µ|− τS≥ τM+fee |µ|(7)To test this expression we measure Spr as˜Spr, the average update time, τS, as τuand µ as trend slope (all are defined in previous section (sec. 3.2)). Adistribution of τresp=˜Spri |µi|−(τu)ivalue for all i-trends found in ABN-AMRO stock price, is plotted on Figure 4. Comparison of ABN-AMRO quantiles of logτrespwith quantiles of normal distribution and with quantiles of logτresp for several other stocks indicate their similarity to log-normal p.d.f. and between each other, see Figure 5.Figure 4: Distribution of τrespfor ABN-AMRO stock. Red line indicateslog-normal fit.02040608005101520τresp,sec8Figure 5:Quantiles of logτrespof ABN-AMRO compared with quan- tiles of Normal distribution (1) and with quantiles of logτrespof AE- GON/NL (2), Daimler-Crysler/GE (3), BBVA/SP (4), Repsol YPF/SP (5) and AXA/FR (6).−4−2024−10−505Standard Normal QuantilesQuantiles of Input Sample(1)−10−505−10−505X QuantilesY Quantiles(2)−10−505−15−10−505X QuantilesY Quantiles(3)−10−505−10−505X QuantilesY Quantiles(4)−10−505−10−505X QuantilesY Quantiles(5)−10−505−10−505X QuantilesY Quantiles(6)9Table 1: Exchange averages of measured τM.Exchange˜τM Amsterdam (NLD)1.9 ± 0.1 Frankfurt (GER)1.22 ± 0.04 Madrid (SPA)5.5 ± 0.5 Milano (ITA)5.1 ± 0.6 Paris (FRA)2.1 ± 0.1τresp-distribution starts sharply at some moment after ’zero’-time which is market reaction time, τM(see (7)), assumingfee µequal to zero6. τMvalue is calibrated using max(0,f(x)), where f(x) is log-normal function. Thefront-end value is calculated at 1% of fitted log-normal p.d.f τMvalues per stock are plotted in Figure 6. Exchange