3 views

Uploaded by Antonello Camiletti

Time is Money: Estimating the Cost of Latency in Trading

- Trade Mogul Trading Guide
- Stakeholders’ Consultative Paper Kenya Regulatory Sandbox Fintech to Support
- Baron_Brogaard_Kirilenko
- 22nd to 27th Sept III Sem. PGDM - AICTE 2013-15Bt. Time Table
- AdaptradeBuilderUG_v220
- Research Paper Proposal
- group5
- Trade Surveillance with Big Data
- MyTopCharting Draft High
- 2006bai6438
- Lifelong Passion for Dance Revealed in The Star's Up Close & Personal with Edgar Perez
- Pvts Trading Sytem
- HighFrequencyAutomatedFXTradingFXandMM
- At 9000 Rationale 15
- Notice: Self-regulatory organizations; proposed rule changes: National Association of Securities Dealers, Inc.
- Annual Marketing Budget Template
- Marketing
- The ABC of Options and Arbitrage
- SSM Slides
- MS-45 Question Bank

You are on page 1of 60

Time is Money:

Estimating the Cost of Latency in Trading

Sasha Stoikov

Cornell University

December 10, 2014

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion

Background

**• Automated or computerized trading
**

• Accounts for 70% of equity trades taking place in the US

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion

Background

**• Automated or computerized trading
**

• Accounts for 70% of equity trades taking place in the US

• High frequency trading

• Short position-holding periods

• Market-making (payment for order flow)

• Latency arbitrage across trading venues

Ambush. Guerrilla.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Background • Automated or computerized trading • Accounts for 70% of equity trades taking place in the US • High frequency trading • Short position-holding periods • Market-making (payment for order flow) • Latency arbitrage across trading venues • Algorithmic trading • Brokers executing large client transactions • Optimally splitting client orders • Opportunistic trading algorithms (React. Sniper) . Bolt. Stealth.

Bolt. Ambush. Sniper) • Why low-latency trading? . Stealth.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Background • Automated or computerized trading • Accounts for 70% of equity trades taking place in the US • High frequency trading • Short position-holding periods • Market-making (payment for order flow) • Latency arbitrage across trading venues • Algorithmic trading • Brokers executing large client transactions • Optimally splitting client orders • Opportunistic trading algorithms (React. Guerrilla.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Market twenty years ago: the pit .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Market today: the order book .

5 Counts 1 0. where x= bid size and y= ask size x 10 4 Imbalance before trade 2.5 0 0 0.5 0.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The worst kept secret in HFT x SELL when imbalance I = x+y is small.5 2 1.75 1 I .25 0.

Avellaneda and J. with M.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Outline • Why bid and ask sizes matter: • Forecasting Prices from Level-I Quotes in the Presence of Hidden Liquidity. Reed • Modeling bid and ask sizes • P(up): the probability that the price will move up • The imbalance: I = x+yx .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Outline • Why bid and ask sizes matter: • Forecasting Prices from Level-I Quotes in the Presence of Hidden Liquidity. with M. Waeber • Modeling latency • Optimal liquidation time • Trade regions . Reed • Modeling bid and ask sizes • P(up): the probability that the price will move up • The imbalance: I = x+yx • Why latency matters: • Optimal Asset Liquidation using Limit Order Book Information. with R. Avellaneda and J.

2 The bid queue is depleted and the price “moves down”. .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Modeling Level I quotes Assume the bid-ask spread is 1 tick One of the following must happen first: 1 The ask queue is depleted and the price “moves up”.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Continuous model • Bid size: xt • Ask size: yt .

yt ) can be approximated by the diffusion dxt = σdWt dyt = σdZt E (dWdZ ) = ρdt.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Continuous model • Bid size: xt • Ask size: yt • The process (xt . .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Continuous model • Bid size: xt • Ask size: yt • The process (xt . yt ) can be approximated by the diffusion dxt = σdWt dyt = σdZt E (dWdZ ) = ρdt. • τx and τy are the times when the sizes hit zero .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The diffusion .

yt = y ) be the probability that the next price move is up. .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The partial differential equation • Let u(x. y ) = P(τy < τx |xt = x. given the bid and ask sizes.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion

The partial differential equation

**• Let u(x, y ) = P(τy < τx |xt = x, yt = y ) be the probability
**

that the next price move is up, given the bid and ask sizes.

• It solves the following PDE:

σ 2 (uxx + 2ρuxy + uyy ) = 0, x > 0, y > 0,

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion

The partial differential equation

**• Let u(x, y ) = P(τy < τx |xt = x, yt = y ) be the probability
**

that the next price move is up, given the bid and ask sizes.

• It solves the following PDE:

σ 2 (uxx + 2ρuxy + uyy ) = 0, x > 0, y > 0,

• Boundary conditions

u(0, y ) = 0, for y > 0,

u(x, 0) = 1, for x > 0.

The price moves as soon as xt or yt hit zero

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion

Solution

Theorem

The probability of an upward move in the mid price is given by

q

1+ρ y −x

1 Arctan 1−ρ y +x

u(x, y ) = 1 − q . (1)

2 Arctan 1+ρ

1−ρ

. for x > 0. 0) = 1. x > 0. y ) = 0. y > 0. u(x.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Uncorrelated queues (ρ = 0) • Problem uxx + uyy = 0. and u(0. for y > 0.

for y > 0. for x > 0. y ) = Arctan . π y . • Solution 2 x u(x.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Uncorrelated queues (ρ = 0) • Problem uxx + uyy = 0. 0) = 1. u(x. x > 0. y ) = 0. y > 0. and u(0.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Perfectly negatively correlated queues (ρ = −1) • Problem uxx − 2uxy + uyy = 0. y > 0. u(x. and u(0. for x > 0. . 0) = 1. y ) = 0. x > 0. for y > 0.

and u(0. y > 0. y ) = . 0) = 1. for x > 0. x +y .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Perfectly negatively correlated queues (ρ = −1) • Problem uxx − 2uxy + uyy = 0. u(x. • Solution x u(x. for y > 0. y ) = 0. x > 0.

XLF. over the first five trading days in 2010 .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The data • Best bid and ask quotes for tickers QQQQ. JPM.

XLF.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The data • Best bid and ask quotes for tickers QQQQ. NYSE and BATS) . over the first five trading days in 2010 • All tickers are traded on various exchanges (NASDAQ. JPM.

y ) = x +y .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The data • Best bid and ask quotes for tickers QQQQ. XLF. x u(x.e. NYSE and BATS) • Consider the perfectly negatively correlated queues model. i. JPM. over the first five trading days in 2010 • All tickers are traded on various exchanges (NASDAQ.

32 46.33 161 271 P .33 264 242 T QQQQ 2010-01-04 09:30:24 46.33 210 271 P QQQQ 2010-01-04 09:30:24 46.32 46.32 46.32 46.32 46.32 46.33 260 242 T QQQQ 2010-01-04 09:30:23 46. provided by WRDS symbol date time bid ask bsize asize exchange QQQQ 2010-01-04 09:30:23 46.33 210 271 P QQQQ 2010-01-04 09:30:24 46.33 258 242 T QQQQ 2010-01-04 09:30:23 46.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Data sample Obtained from the consolidated quotes of the NYSE-TAQ database.

4M 4 0.7M 6 0.27 QQQQ BATS 1.82 Table: Summary statistics .4M 4 0.011 7505 14.99 QQQQ NASDAQ 2.2M 11 0.010 10463 15.010 1455 46.7M 25 0.0M 36 0.011 1055 46.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Summary statistics Ticker Exchange num qt qt/sec spread bsize+asize price XLF NASDAQ 0.01 XLF BATS 0.6M 15 0.011 1152 46.77 JPM BATS 0.30 QQQQ NYSE 4.011 87 43.012 47 43.02 XLF NYSE 0.010 8797 15.28 JPM NASDAQ 1.014 39 43.7M 7 0.6M 5 0.81 JPM NYSE 0.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker .

05.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance x I = x +y into intervals: 0 < I ≤ 0. etc.05 < I ≤ 0.1. 0. ..

1. we compute the empirical probability that the price goes up at the next price move.05 < I ≤ 0. 3 For each bucket.05. . u(I ). 0..Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance x I = x +y into intervals: 0 < I ≤ 0. etc.

. 4 We plot the probability that the next price move is up.. u(I ). conditional on the imbalance.05 < I ≤ 0. 0.05.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance x I = x +y into intervals: 0 < I ≤ 0. 3 For each bucket. we compute the empirical probability that the price goes up at the next price move. etc.1.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Probability of an upward move as a function of the imbalance .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Hidden liquidity • Empirically. . the probability of the price going up when the ask size is small BUT does not tend to zero.

• Orders on other exchanges prevent the price from moving up (REG NMS) . the probability of the price going up when the ask size is small BUT does not tend to zero.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Hidden liquidity • Empirically.

• Orders on other exchanges prevent the price from moving up (REG NMS) • Hidden orders.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Hidden liquidity • Empirically. iceberg orders. the probability of the price going up when the ask size is small BUT does not tend to zero. dark pools .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Boundary condition • We model a fixed hidden liquidity H .

for x > −H. x > −H. p(x.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Boundary condition • We model a fixed hidden liquidity H • This translates in σ 2 (pxx + 2ρpxy + pyy ) = 0. with the boundary condition p(−H. for y > −H. y ) = 0. −H) = 1. y > −H. .

for y > −H. y ) = 0. . with the boundary condition p(−H. for x > −H.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Boundary condition • We model a fixed hidden liquidity H • This translates in σ 2 (pxx + 2ρpxy + pyy ) = 0. p(x. −H) = 1. x > −H. y > −H.

for x > −H. y . for y > −H. y > −H. H) = u(x + H. y + H) . y ) = 0. • In other words we can solve the problem with boundary conditions at zero and use the relation p(x. p(x. −H) = 1. x > −H. with the boundary condition p(−H.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Boundary condition • We model a fixed hidden liquidity H • This translates in σ 2 (pxx + 2ρpxy + pyy ) = 0.

H) = .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Perfectly negatively correlated queues (ρ = −1) Solution x +H p(x. y . x + y + 2H .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance in the intervals [0. .1). 0.05.05). 0. [0. etc...

1). 0..05). .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance in the intervals [0. [0. 0.. etc. we compute the empirical probability that the price goes up p(I ˆ ).05. 3 For each bucket.

[0..5)+0.05).05.. 0. 4 The correlation −1 model predicts H x +H I + x+y I +h 1 p= = H = = (I −0.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance in the intervals [0. 3 For each bucket.5 x + y + 2H 1 + 2 x+y 1 + 2h 1 + 2h where h is the normalized hidden size . 0. etc.1). we compute the empirical probability that the price goes up p(I ˆ ).

05). we compute the empirical probability that the price goes up p(I ˆ ).5 x + y + 2H 1 + 2 x+y 1 + 2h 1 + 2h where h is the normalized hidden size 5 We regress ˆ ) − 0. [0.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Estimation procedure 1 We filter the data set by exchange and ticker 2 We “bucket” the imbalance in the intervals [0.1). 4 The correlation −1 model predicts H x +H I + x+y I +h 1 p= = H = = (I −0. . 0.5(1/β − 1) for each exchange.. 3 For each bucket. 0..5 = β(I − 0.5) + p(I and obtain an implied hidden liquidity h = 0.05.5)+0. etc.

09 .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Probability of an upward move hidden size= 0.

09 0.42 0.21 0. Ticker NYSE BATS NASDAQ XLF 0.32 0.09 QQQQ 0.18 Table: Implied hidden liquidity across tickers and exchanges But this information decays with latency .39 0.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Results The hidden size tells us of how informative the level I quotes are.23 0.28 JPM 0.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Latency • Latency arises in every trade execution: 1 Time of datafeed to travel from exchange to execution machine. • We assume there is a fixed latency L • What you see is not what you get . 2 The algorithm making a decision. 3 The order being sent back to the market.

record the imbalance Ii and the bid price Sib • At a later quote in the future j. record the bid price Sjb • Take averages of (Sjb − Sib ) for Ii in different buckets .Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The cost of latency There is empirical evidence that selling on small imbalances can be profitable: • On each quote i. L milliseconds later.

.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Cost as a fraction of the spread x axis is time. Each graph is an imbalance decile. y axis is cost.

100ms.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The cost of latency Transaction cost for L=1ms. 10ms. 1000ms .

. . 0≤τ ≤T −L for x ∈ [0.e. x) = sup E [Pτb+L − P0b |It = x]. T − L] to sell the share at the bid price. 1].Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The Optimal Liquidation Problem The imbalance process It is a Markov process. i. • Goal: Identify an optimal time τ in [0. V (t.

etc..1].05.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Modeling the imbalance • I (n) for 0 ≤ n ≤ N is a finite state Markov process. (0. 0. 0.. pijdown and pijstay empirically . • 20 transient states.05]. (0. • We estimate the payoff function G L (x) = E [PLb − P0b |I0 = x] for a given latency L and imbalance x • We estimate the transition probabilities pijup .

k) k=1 20 20 up X X + pik (V L (n + 1. k) − 1) k=1 k=1 . i) = max G L (i). I (n + 1))|I (n) = i] = pik V (n + 1. • Conditional probability: 20 stay L X L E [V (n + 1. E [V L (n + 1. I (n + 1))|I (n) = i] . k) + 1) + down pik (V L (n + 1.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Dynamic Program • Bellman’s recursion: n o V L (n.

x) ∈ [0. n o C = (t. T ] × [0. x) < G L (x) . x) ∈ [0. T ] × [0. . 1) : V (t. 1) : V (t. T ]. 1]. T ]. x) is decreasing in L for L ∈ [0.Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Trade/no Trade Regions Define n o D = (t. Proposition Fix t ∈ [0. x ∈ [0. then V L (t. x) = G L (x) .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Trade/no Trade Regions .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion The value function .

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Backtesting the Trade Regions 1 Calibrate the trade region based on 1 day of 5 year US treasuries data 2 Backtest the trade region on 10 out of sample days 3 Results: • Pτb+L − P0b = 42% of the bid ask spread. for L=10ms • Pτb+L − P0b = 20% of the bid ask spread. for L=100ms • Pτb+L − P0b = 9% of the bid ask spread. for L=1000ms . for L=1ms • Pτb+L − P0b = 31% of the bid ask spread.

Introduction P(up) Hidden liquidity Latency Optimal liquidation Conclusion Conclusion 1 We can estimate the probability of the next price move: • Conditional on the bid and ask sizes • Conditional on imbalance if the sizes are negatively correlated • Conditional on hidden liquidity for a ticker/exchange pair 2 We can estimate the cost of latency: • By solving an optimal stopping problem • Backtesting trade/no trade regions on level I data .

- Trade Mogul Trading GuideUploaded bysamrainova
- Stakeholders’ Consultative Paper Kenya Regulatory Sandbox Fintech to SupportUploaded byArkanudDin Yasin
- Baron_Brogaard_KirilenkoUploaded bycaitlynharvey
- 22nd to 27th Sept III Sem. PGDM - AICTE 2013-15Bt. Time TableUploaded bygauade
- AdaptradeBuilderUG_v220Uploaded bymaurice bertrand
- Research Paper ProposalUploaded byAnthony Calvo
- group5Uploaded bybk
- Trade Surveillance with Big DataUploaded byCognizant
- MyTopCharting Draft HighUploaded byDavid Hunt
- 2006bai6438Uploaded byAhseek
- Lifelong Passion for Dance Revealed in The Star's Up Close & Personal with Edgar PerezUploaded byStar One Public Relations
- Pvts Trading SytemUploaded byMihirkumar Shah
- HighFrequencyAutomatedFXTradingFXandMMUploaded bybrick44
- At 9000 Rationale 15Uploaded byMarketsWiki
- Notice: Self-regulatory organizations; proposed rule changes: National Association of Securities Dealers, Inc.Uploaded byJustia.com
- Annual Marketing Budget TemplateUploaded byLiyana Nasarudin
- MarketingUploaded byNuha Azhar
- The ABC of Options and ArbitrageUploaded byaveros12
- SSM SlidesUploaded byJonas Leve
- MS-45 Question BankUploaded bymail2rnatincom
- 2Uploaded bymjrf14
- Retail FormatUploaded byAman Ahuja
- Harshad Mehta ScamUploaded byvanitathakur91
- Summary Evolution of RMUploaded byahsanlone
- Ba Case Analysis FinalsUploaded byPaul Ryndel Sonquipal Baquial
- Project Flow Chart_rev1Uploaded byGurinder Parmar
- Stock ExchangesUploaded byekarup
- Internal Test Paper Format.4188Uploaded byAadil Kakar
- HdfcUploaded bypriyasangtani89
- MonopolyUploaded byArpit Govind

- Ichimoku Cloud E BookUploaded bypudiwala
- Tesi-PedoneUploaded byAntonello Camiletti
- Traders WeeUploaded byAntonello Camiletti
- Nicola ZarattiniUploaded byAntonello Camiletti
- Successful Short Yerm TradingUploaded bysustajenny
- h Gs i Volume Price Analysis IndicatorUploaded byAntonello Camiletti
- Elenco Vie 2013 FoggiaUploaded byAntonello Camiletti
- traderlink.pdfUploaded byAntonello Camiletti
- You Know Your Child is Gifted WhenUploaded byMarijanaLončarDesančić
- YTC the Greatest Trading Book EverUploaded byMoody Infinity
- Paolo SerafiniUploaded byAntonello Camiletti
- Traders ChecklistUploaded byRamachandra Reddy
- Bressert, Walter (Article) Cycle Timing Can Improve Your Timing Performance -RUploaded byhofrath
- Heikin Ashi Two Bar StrategyUploaded bytraian47
- (the New Rules of Internet Marketing (55 Pages)Uploaded byAntonello Camiletti
- Heikin-AshiChartsRUploaded byif1313
- Blade Forex StrategiesUploaded bylittledeedee123
- Il Price OscillatorUploaded byAntonello Camiletti

- interest ratesUploaded byDung Duc Nguyen
- kebs108Uploaded byvichmega
- Chapter 3 - Test BankUploaded bygilli1tr
- Family Takaful.docUploaded byAbdul Hadi
- ch10.doc.pdfUploaded byerylpaez
- Theory of AccountsUploaded byChristopher Price
- Net losers do $28.5mUploaded bycpscapital
- Head Retail Banking President in Memphis TN Resume Terry RenouxUploaded byTerryRenoux
- Surya Karan Sambyal-Film Review.docxUploaded byPrashant Maurya
- HDFC Long Term Advantage Fund SID Apr 17Uploaded byAnkur Khanna
- StatisticsUploaded byAbhijit Pathak
- RumorsUploaded bydsmile1
- Request ListUploaded byHadi Sumartono
- The Playing Field – Graham Duncan – MediumUploaded byPradeep Raghunathan
- Cherokee Spring2013Uploaded byEnjoyMagazine
- Valuation, Pricing & ContractUploaded byDebanjan Banerjee
- Presentation on Economic Value Added (EVA)Uploaded byrockygoa
- BRPD Circular No-18 Dated December 21, 2014Uploaded byমোঃ সালেহ উদ্দিন সোহাগ
- May 2005Uploaded byArc Angel M
- Marriot Corp._cost of CapitalUploaded byone990scribd
- Markowitz Mean-Variance Portfolio TheoryUploaded bymimo1911
- Chief Financial Officer CFO in NYC NY CT Resume William AlvarezUploaded byWilliamAlvarez2
- Ch 5 answers 2014.pdfUploaded byDenise Villanueva
- marketing planUploaded byBettylaFea
- 328100379 Quasimodo PatternUploaded byDue Torri
- AbbottUploaded bysaandeepchandra
- FMGT 3510 Chapter 1Uploaded byTSEvans
- 47445344 Internship Report on Bank Alfalah on MarkeintgUploaded byFarrukh Bashir
- COR Etrade Memo in SupportUploaded byjaniceshell
- Investment AgreementUploaded byGardel Ambos