# trend arbitrage, bidask spread and market dynamics

arXivphysics/0607076v1 physics.data-an 10 Jul 2006Trend arbitrage, bid-ask spread and market dynamicsNikolai Zaitsevted to ”Quantitative finance” journalMay-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 ination. 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 ation 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 ation through simulation of detailed market mechanics Smith et.al.1.These s 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 Dermanto account for such effect.Fortis Bank, Risk Management Merchant Bank, Correspondent e-mailnikzait- sevyahoo.co.uk 1Such simulations are part of so-called Experimental Finance.1In contrast to statistical s, 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 s 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 ination 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 cons 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 ination update, costs, trading activity and response time of the exchange. This ination 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 plat which helps to account and match trades through software and a wire connection to trader computers. Traders use electronic plats to trade. Both systems, of traders and of exchange, have theirrespective non-zero latencies and therefore the speed of ination 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 ination 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 spreadask-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.timepricep2Spreadp1t1t2AskBid3Investor 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 if0 p2 p1 Spr t2 t11Investor 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 setSpr || 2where t2t1. 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 fee3where 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 plats 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 1530 and 1730 of European time4. Dividend ination was notused because it does not affect our intraday analysis.Data were filtered. Only those bits of ination were used in analysis where price of either bid or ask has been updated.Any such change is treated as ”ination update”.3.2Trend identificationLinear fit details can be found elsewhere Wiki was applied to series of one day mid-prices, askti bidti/2. Bid-ask spread, ti askti bidti, is understood as an uncertainty of observed price ination thisitem to be discussed further. Data were fit continuously. This way real-timefeed is simulated, where only past ination is available. An output of fit is series of current trend parameters such as series of impact, p0ti, series of slope trend, ti, with respective errors, pti, ti. These parameters allow prediction of forward price, p, and price error, pti pp0ti1,ti1,ti, and4 ti p0ti1,ti1,pti1,ti1,ti.5Condition to trigger end of current trend| pti pti|q ti2 ti2 n6where 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 ination 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 2tcur 2tfwd, where 2tiare 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 ination4this 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 ination. uis also called average update time; 2tof the fit, where2tXi pti pti2 p2iTrends 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, Prob2t,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 s seem not acceptable since they do not bear instant in- ation 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,15peaking at 1.Figure 3 2probability for all found ABN-AMRO trends.00.20.40.60.810100200300400500600Prob2,Nu2The 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 Mfee ||7To test this expression we measure Spr asSpr, the average update time, S, as uand as trend slope all are defined in previous section sec. 3.2. Adistribution of respSpri |i|uivalue for all i-trends found in ABN-AMRO stock price, is plotted on Figure 4. Comparison of ABN-AMRO quantiles of logrespwith quantiles of normal distribution and with quantiles of logresp 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.02040608005101520resp,sec8Figure 5Quantiles of logrespof ABN-AMRO compared with quan- tiles of Normal distribution 1 and with quantiles of logrespof AE- GON/NL 2, Daimler-Crysler/GE 3, BBVA/SP 4, Repsol YPF/SP 5 and AXA/FR 6.4202410505Standard Normal QuantilesQuantiles of Sample11050510505X QuantilesY Quantiles2105051510505X QuantilesY Quantiles31050510505X QuantilesY Quantiles41050510505X QuantilesY Quantiles51050510505X QuantilesY Quantiles69Table 1 Exchange averages of measured M.ExchangeM Amsterdam NLD1.9 0.1 Frankfurt GER1.22 0.04 Madrid SPA5.5 0.5 Milano ITA5.1 0.6 Paris FRA2.1 0.1resp-distribution starts sharply at some moment after zero-time which is market reaction time, Msee 7, assumingfee equal to zero6. Mvalue is calibrated using max0,fx, where fx 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