Semi-Markov model for market microstructure and HFT LPMA, University Paris Diderot EXQIM 6th General AMaMeF and Banach Center Conference 10-15 June 2013 Joint work with Huyên PHAM LPMA, University Paris Diderot
Figure: One day Pietroquotations FODRA of Semi-Markov the EURIBOR model for market future microstructure and HFT INTRADAY EVOLUTION OF THE BID ASK SPREAD 98.80 98.81 98.82 98.83 98.84 98.85 Feb 02 09:00:00 Feb 02 11:00:00 Feb 02 13:00:01 Feb 02 15:00:00 Feb 02 17:00:01
What price do we want to model? Several prices in the limit order book: quote prices best ask price, best bid price, mid price (offered liquidity) trade prices last transaction price, vwap (consummed liquidity) We have chosen to model: the mid price of liquid assets where the bid-ask spread is constantly one tick all the quotes prices can be derived from the mid one
Stylized fact 1 - Microscopic mean reversion Short-term returns are usually anticorrelated. 2 - Clustering Independently from the seasonal patterns, market alternates period of high and low activity. 3 - Point process with diffusive limit The price process is piecewise constant, and so not diffusive. Anyway, at large scales, its behavior can be approximated by a Brownian motion. 4 - Explosion of the realized volatility The volatility estimation depends on the sample frequency: the higher is the frequency the biggest is the realized volatility.
Tracability requirements Estimation Easy, fast and non parametric Simulation Easy, fast and exact Markov property Markov embedding with few state variables to use and solve numerically HJB equations
Model-free description of asset mid-price Constant bid-ask spread = 1 tick = 2δ The timestamps (T k ) k of its jump times modeling of volatility clustering The marks (J k ) k valued in 2δZ \ {0}, representing the price increment at T k : modeling of the microstructure noise via mean-reversion of price increments Model-free dynamic of the price P t = P 0 + 2δ k: T k t J k
Jump side modeling Case J k = 1 J k valued in {+1, 1}: side of the jump (upwards or downwards) J k = J k 1 B k E[J k ] = 0 under stationary prob (B k ) k i.i.d. with law: P[B k = ±1] = 1 ± α, α [ 1, 1) 2 (J k ) k irreducible Markov chain with symmetric transition matrix: ( 1+α ) 1 α Q α = 2 2 1 α 2 1+α 2
Mean reversion First level limit orders Second level limit orders First level limit orders BEST ASK PRX BEST BID PRX First level limit orders First level limit orders BEST ASK PRX BEST BID PRX BEST ASK PRX BEST BID PRX First level limit orders Second level limit orders First level limit orders Second level limit orders
1 - Microscopic mean reversion: α < 0 Under the stationary probability of (J k ) k, we have: α = Cor(J k, J k 1 ) Estimation of α: ˆα n = 1 n n J k J k 1 k=1 α 87.5% (Euribor, 2010, 10h-14h): strong mean reversion of price returns
2 - Clustering Renewal law Conditionally on {J k J k 1 = ±1}, the sequence of inter-arrival jump times {S k = T k T k 1 } is i.i.d. with distribution function F ± and density f ± : F ± (t) = P [S k t J k J k 1 = ±1]. f (s) f+(s) Density 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Density 0.00 0.02 0.04 0.06 0.08 1 5 9 14 20 26 32 38 44 50 56 62 68 74 80 86 92 s 1 5 9 14 20 26 32 38 44 50 56 62 68 74 80 86 92 s
Non parametric estimation of the jump intensity The price changes with intensity: ĥ ± (s) = 1 ± α 2 f ± (s) 1 1+α 2 F +(s) 1 α 2 F (s) h (tau) h+(tau) 0.0 0.5 1.0 1.5 0.02 0.03 0.04 0.05 0 0.31 0.93 1.85 3.15 5.22 8.01 12.47 20.58 40.63 62.84 s 0 0.31 0.93 1.85 3.15 5.22 8.01 12.47 20.58 40.63 62.84 s
3 - Point process with diffusive limit P (T ) t = P tt T, t [0, 1]. Diffusive behaviour lim T P(T ) (d) = σ W, where W is a Brownian motion, and: σ 2 = function(f, α)
Simulated price Price simulation 10 9 8 7 6 5 4 3 2 1 0 1 P 0 47 111 176 349 447 533 599 688 755 818 886 968 1039 1121 1215 1295 1406 1493 1623 1700 1785 t(s) Figure: 30 minutes simulation Price simulation 62 56 50 44 38 32 26 20 14 9 4 0 P 0 804 1919 3148 4384 5623 6851 8079 9311 10650 12117 13670 15129 16650 18105 19558 21010 22463 23943 25491 26951 28424 t(s) Figure: 1 day simulation
4 - Explosition of the realized volatility In the special case when (T k ) k and (J k ) k are independent Mean Signature Plot V (τ) := 1 τ E[ (P τ P 0 ) 2 ] = σ 2 + φ(α, τ) φ is semi-explicit φ is finite for α < 0, φ is decreasing in τ φ(τ, α) goes to 0 when τ
Signature Plot C(tau) 0.0005 0.0010 0.0015 0.0020 0.0025 Data Simulation Gamma Poisson 0 500 1000 1500 2000 2500 3000 3500 tau(s) Figure: Mean signature plot for α < 0
Trading issue Agent submitting limit orders on both sides of the LOB: limit buy order at the best bid price limit sell order at the best ask price with the aim to gain the spread. need to model the market order flow, i.e. the counterpart trade of the limit order need to model the agent execution
Market trades Market order flow marked point process (θ k, Z k ) k θ k : arrival time of the market order M t counting process Z k : valued in { 1, +1}: side of the trade Z k = 1: trade at the best BID price (market sell order) Z k = +1: trade at the best ASK price (market buy order) index n θ k best ask best bid traded price Z k 1 9:00:01.123 98.47 98.46 98.47 +1 2 9:00:02.517 98.47 98.46 98.46-1 3 9:00:02.985 98.48 98.47 98.47-1 Dependence modeling between market order flow and price in LOB
Trade timestamp modeling The trade counting process M t The counting process (M t ) of the market order timestamps (θ k ) k is a Cox process with conditional intensity λ(s t ),where: S t = time elapsed since the last price change Parametric examples (positive parameters): λ exp (s) = λ 0 + λ 1 s r e ks λ pow (s) = λ 0 + λ 1s r Estimation by MLE minimizing Sk λ(s) ds 0 j k 1 + s k ln[λ(s(θ j ))]
Strong and weak side of LOB We call strong side (+) of the LOB, the side in the same direction than the last jump, e.g. best ask when price jumped upwards. We call weak side ( ) of the LOB, the side in the opposite direction than the last jump, e.g. best bid when price jumped upwards. Empirical fact We observe that trades (market orders) arrive mostly on the weak side.
Mean reversion First level limit orders Second level limit orders First level limit orders BEST ASK PRX BEST BID PRX First level limit orders First level limit orders BEST ASK PRX BEST BID PRX BEST ASK PRX BEST BID PRX First level limit orders Second level limit orders First level limit orders Second level limit orders
Trade side modelling For an incoming trade, the probability that the trade is exchanged on the strong(+)/weak(-) side is: 1 ± ρ, ρ [ 1, 1] 2 ρ = 0: market order flow arrive independently at best bid and best ask (usual assumption in the existing literature) ρ > 0: market orders arrive more often in the strong side of the LOB ρ < 0: market orders arrive more often in the weak side of the LOB 1 ˆρ n = 1 n n k=1 Z k I θ 50%: 3/4 trades on the weak side k 2 ρ has an impact on the stragegy performance
strategy Agent control Predictable process (l + t, l t ) t {0, 1} l + t l t = 1: limit order of size L on the strong side: +I t = 1: limit order of size L on the weak side: I t Agent execution If the agent is placed, she can be executed: entirely, if the price jumps over her limit order randomly if a trade arrives
optimization Value function S t the time past since the last price change I t the last direction taken by the price X t the cash process Y t the inventory process v(t, s, p, i, x, y) = where η 0 is the agent risk aversion and: sup E [ ] PNL T CLOSE(Y T ) η RISK t,t (l +,l ) PNL t = X t + Y t P t (ptf valued at the mid price) CLOSE(y) = (δ + ɛ) y (closure market order) RISK t,t = T t Y 2 u d[p] u (no inventory imbalance)
Variable reduction Theorem The value function is given by: v(t, s, p, i, x, y) = x + yp + ω yi (t, s) where ω q (t, s) = ω(t, s, q) is the unique viscosity solution to: [ t + s ˆκ(s)] ω + σ 2 (s) [αq ηq 2 ] + max L l + ω + l {0,1},q ll Y in [0, T ] R + Y. max L l ω = 0 l {0,1},q+lL Y ω q (T, s) = q (δ + ɛ)
The effect of ρ (adverse selection) Value function at trading start rho 0.33 rho 0 rho 0.33 T N M y_max eta delta fees l_max tau_max vartheta 3600 1000 250 10 0 1 0 1 6 0.05 0 0.1 0.25 0.42 0.62 0.84 1.09 1.37 1.7 2.06 2.48 2.96 3.5 4.11 4.81 5.61 6.51 7.53 8.7 10.02 11.94 14.18 16.81 19.91 23.53 27.79 32.78 38.65 45.53 53.6 Time Figure: Adverse selection: value function increasing in ρ
Optimal policy shape OPTIMAL CONTROL AT TRADING START 1 2 3 ASK_UP BID_UP 10 1.0 5 0 0.8 5 0.6 Y 10 ASK_DW BID_DW 10 0.4 5 0 0.2 5 0.0 10 1 2 3 log(s+1) Figure: Always play on the strong side!