33
Flash Crash Simulator Flash Crash Simulator Analyzing HFT's Impact on Market Quality Analyzing HFT's Impact on Market Quality Yoshiharu Sato Yoshiharu Sato University of Warsaw, 2015 University of Warsaw, 2015 https://sites.google.com/site/yoshi2233/ https://sites.google.com/site/yoshi2233/

A Flash Crash Simulator: Analyzing HFT's Impact on Market Quality

Embed Size (px)

Citation preview

Flash Crash SimulatorFlash Crash SimulatorAnalyzing HFT's Impact on Market QualityAnalyzing HFT's Impact on Market Quality

Yoshiharu SatoYoshiharu SatoUniversity of Warsaw, 2015University of Warsaw, 2015

https://sites.google.com/site/yoshi2233/https://sites.google.com/site/yoshi2233/

About MeAbout Me

BackgroundBackground・・ 3D Graphics Programming (C/C++)3D Graphics Programming (C/C++)

・・ Derivatives Trading (CFDs, Vanilla Options)Derivatives Trading (CFDs, Vanilla Options)

・・ BSc in Quantitative Analysis & InformaticsBSc in Quantitative Analysis & Informatics

ExpertiseExpertise・・ Real-Time, High-Performance Systems in C++Real-Time, High-Performance Systems in C++

My Previous Work: My Previous Work: 3D Engine in C/C++3D Engine in C/C++(Geometry, Quaternion, Optics, SIMD)(Geometry, Quaternion, Optics, SIMD)

My Previous Work: My Previous Work: Algorithm Backtester in C++Algorithm Backtester in C++(Statistics, Econometrics, Time-Series Analysis, Multithreading)(Statistics, Econometrics, Time-Series Analysis, Multithreading)

Current Research (MSc in Quantitative Finance):Current Research (MSc in Quantitative Finance):

High Frequency TradingHigh Frequency Trading

HFT has been criticized for:HFT has been criticized for:・・ unfair speed advantageunfair speed advantage (direct feed, colocation) (direct feed, colocation)

・・ predatory trading practicespredatory trading practices (front-running) (front-running)

・・ allegedly causing flash crashesallegedly causing flash crashes

Empirical studies show that HFT has:Empirical studies show that HFT has:・・ narrowed bid-ask spreadsnarrowed bid-ask spreads

・・ reduced transaction costsreduced transaction costs

・・ made price formations more efficientmade price formations more efficient

Two Types of HFTTwo Types of HFT

・・ OpportunisticOpportunistic- statistical arbitrage- statistical arbitrage- news feed arbitrage- news feed arbitrage- latency arbitrage- latency arbitrage- momentum detection- momentum detection- order flow prediction, etc- order flow prediction, etc

・・ Market MakingMarket Making - rebate arbitrage (ELP)- rebate arbitrage (ELP)- ETF market making- ETF market making- option market making, etc- option market making, etc

Rebate Arbitrage (ELP)Rebate Arbitrage (ELP)

・・ A market-making HFT strategy that seeks to earn both A market-making HFT strategy that seeks to earn both the bid-ask spreads and the rebates paid by exchangesthe bid-ask spreads and the rebates paid by exchangesas incentives for providing liquidity as incentives for providing liquidity

・・ TheThe Maker-TakerMaker-Taker pricing model gives rebates to pricing model gives rebates to liquidity providers (passive flow liquidity providers (passive flow with limit orderswith limit orders) while ) while charging liquidity takers (active flow with market charging liquidity takers (active flow with market orders)orders)

・・ These ELP-HFTs can afford to breakeven or even lose These ELP-HFTs can afford to breakeven or even lose money on each trade as long as the rebates they receive money on each trade as long as the rebates they receive covers their costscovers their costs

Market-Making HFT: Market-Making HFT: Virtu FinancialVirtu Financial

Virtu made money on 1,484 out of 1,485 trading days (only one losing Virtu made money on 1,484 out of 1,485 trading days (only one losing trading day = trading day = 99.93% winning rate99.93% winning rate) from Jan 2009 to Dec 2014, and ) from Jan 2009 to Dec 2014, and made money EVERY trading day in 2014, generating profit of $190 made money EVERY trading day in 2014, generating profit of $190 million from revenue of $723 millionmillion from revenue of $723 million

Virtu Financial (cont.)Virtu Financial (cont.)

Case Study: Case Study: Tokyo Stock ExchangeTokyo Stock Exchange

HFT @ TSEHFT @ TSE

・・ TSE introduced a new exchange system TSE introduced a new exchange system 'Arrowhead''Arrowhead'in 2010, offering in 2010, offering ULLDMAULLDMA (Ultra-Low Latency Direct (Ultra-Low Latency Direct Market Access)Market Access) to HFTs to HFTs

・・ System development started in 2007 by 500 staffs from System development started in 2007 by 500 staffs from Fujitsu, based on “V-model with feedback”Fujitsu, based on “V-model with feedback”((4,000+ 4,000+ pages of system requirement)pages of system requirement)

・・ 200+ exchange servers are connected via high-speed 200+ exchange servers are connected via high-speed networks, each using networks, each using IMDB (In-Memory Database)IMDB (In-Memory Database)

HFT @ TSE (cont.)HFT @ TSE (cont.)

・・ Trade volume shares of HFTs increased from 10% in Trade volume shares of HFTs increased from 10% in 2010 to 2010 to 72%72% (270 trillion yen or $2.3 trillion) in 2014 (270 trillion yen or $2.3 trillion) in 2014

・・ 8,000+8,000+ human dealers lost their job over the past 5 years human dealers lost their job over the past 5 yearsdue to the rise of HFTdue to the rise of HFT ((Japan Securities Dealers Association)Japan Securities Dealers Association)

・・ Arrowhead v2.0 started operation in September 2015,Arrowhead v2.0 started operation in September 2015,reducing transaction latency to reducing transaction latency to 0.5 millisecond0.5 millisecond and andincreasing transaction capacity to increasing transaction capacity to 270 million orders/day270 million orders/day

・・ New safety mechanisms: Cancel On Disconnect, Kill New safety mechanisms: Cancel On Disconnect, Kill Switch, User-Set Hard Limits, Dummy SymbolSwitch, User-Set Hard Limits, Dummy Symbol

Did HFT really cause the Flash CrashDid HFT really cause the Flash Crashon May 6, 2010?on May 6, 2010?

The Answer Is No, The Answer Is No, ButBut

・・ CFTC official report concludes that HFTs did CFTC official report concludes that HFTs did not cause the Flash Crash but they amplified it not cause the Flash Crash but they amplified it by reducing liquidity and by reducing liquidity and inducing downward inducing downward price spiralprice spiral

→ → How?How?

Order Book ImbalanceOrder Book Imbalance

・・ Large sell orders (total Large sell orders (total $4.1 billion$4.1 billion)) by by Waddell Waddell & Reed& Reed and and large 'spoofing' sell orderslarge 'spoofing' sell orders by by Nav Nav SaraoSarao caused an order book imbalance in S&P caused an order book imbalance in S&P 500 E-Mini futures, starting the price drop500 E-Mini futures, starting the price drop

・・ As HFTs detected the drop in E-Mini, many of As HFTs detected the drop in E-Mini, many of them paused trading in equities market due tothem paused trading in equities market due tohigh volatility and high risk of adverse selection, high volatility and high risk of adverse selection, making liquidity evaporated from the marketmaking liquidity evaporated from the market

CFTC Official ExplanationCFTC Official Explanation

・・ When prices are moving directionally due to When prices are moving directionally due to order book imbalance, ELP-HFT can exacerbate order book imbalance, ELP-HFT can exacerbate a price move and contribute to high volatility a price move and contribute to high volatility

・・ Higher volatility further increases the speed at Higher volatility further increases the speed at which the best bid and offer queues get depleted which the best bid and offer queues get depleted by ELP-HFT, leading to a spike in trade volumeby ELP-HFT, leading to a spike in trade volume(“(“hot-potato effect”hot-potato effect”)) and induce a flash crash and induce a flash crash

Research GoalResearch Goal

・・ If the CFTC's explanation is true, then I should If the CFTC's explanation is true, then I should be able to induce a flash crash by implementingbe able to induce a flash crash by implementingthe ELP strategy in an order book simulator the ELP strategy in an order book simulator

→ → Analyze the impact of ELP-HFT on core market Analyze the impact of ELP-HFT on core market quality in order book simulationsquality in order book simulations

IssuesIssues

Car Crash SimulationCar Crash Simulation

・・ Car/engine structuresCar/engine structures→ → KnownKnown

・・ Material propertiesMaterial properties→ → KnownKnown

・・ Deformation modelDeformation model→ → KnownKnown

・・ Simulation Real≒Simulation Real≒

Flash Crash SimulationFlash Crash Simulation

・・ Market structureMarket structure→ → Unknown Unknown (lack of comprehensive audit trail)(lack of comprehensive audit trail)

・・ Strategies mechanicsStrategies mechanics→ → UnknownUnknown (undisclosed intellectual properties) (undisclosed intellectual properties)

・・ Interaction modelInteraction model→ → UnknownUnknown (too much interactive complexity) (too much interactive complexity)

・・ Simulation ≠ Real (simulation has to be simplified)Simulation ≠ Real (simulation has to be simplified)

Limit Order Book (LOB) SimulationLimit Order Book (LOB) Simulation

・・ ELP market-making strategy can NOT be ELP market-making strategy can NOT be simulated using static historical data due to its simulated using static historical data due to its interactions with the LOB (interactions with the LOB (== no backtesting no backtesting))

・・ Requires a full LOB matching engine insteadRequires a full LOB matching engine instead

→ → Implement it in multithreaded C++Implement it in multithreaded C++

Zero-Intelligence LOB SimulationZero-Intelligence LOB Simulation

・・ Numerical models (developed mainly by Numerical models (developed mainly by econophysicists) in which random orders are econophysicists) in which random orders are submitted at random prices to the LOB withoutsubmitted at random prices to the LOB withoutany AI / trading strategiesany AI / trading strategies

・・ Particles of 2 types (bids and asks) in 1-D grid Particles of 2 types (bids and asks) in 1-D grid are subject to 3 types of events are subject to 3 types of events (Challet et al., 2001)(Challet et al., 2001)

(1) (1) depositiondeposition (limit orders) (limit orders)(2) (2) annihilationannihilation (market orders) (market orders)(3) (3) evaporationevaporation (cancellation) (cancellation)

Limit & Market OrdersLimit & Market Orders

・・ New order arrival follows a New order arrival follows a Poisson distributionPoisson distribution

・・ Trade volume at the best bid or ask (market Trade volume at the best bid or ask (market orders & marketable limit orders) follows a orders & marketable limit orders) follows a Gamma distributionGamma distribution (Bouchaud et al., 2002)(Bouchaud et al., 2002)

Cancellation OrdersCancellation Orders

・・ Probability of cancellation depends:Probability of cancellation depends:- exponentially on the position in the LOB (- exponentially on the position in the LOB (yy))- linearly on the order book imbalance (- linearly on the order book imbalance (NNimbimb))- decreases by the total number of orders (- decreases by the total number of orders (NN))(Mike et al., 2008)(Mike et al., 2008)

Einstein-Smoluchowski Relation (FDR)Einstein-Smoluchowski Relation (FDR)

・・ LOB seen as a colloidal Brownian particle LOB seen as a colloidal Brownian particle embedded in smaller fluid molecules embedded in smaller fluid molecules (Yura et al., 2014)(Yura et al., 2014)

My LOB Simulator (C++) ArchitectureMy LOB Simulator (C++) Architecture

・・ Asynchronous Function Parallel ModelAsynchronous Function Parallel Model

Demo Available for Download:Demo Available for Download:https://sites.google.com/site/yoshi2233/hft-flashcrashhttps://sites.google.com/site/yoshi2233/hft-flashcrash

Simulation ResultsSimulation Results

・・ ConsistentConsistent with empirical studies with empirical studies

・・ HFT reduces bid-ask spreadsHFT reduces bid-ask spreads (Hendershott et al., 2011 / Hasbrouck et al., 2013 /(Hendershott et al., 2011 / Hasbrouck et al., 2013 /Moriyasu et al., 2013 / Nanex Research, 2014 / Hruska et al., 2015)Moriyasu et al., 2013 / Nanex Research, 2014 / Hruska et al., 2015)

・・ HFT mitigates short-term price volatilityHFT mitigates short-term price volatility (Hagstromer et al., 2013 / ASIC, 2015)(Hagstromer et al., 2013 / ASIC, 2015)

Simulation Results (cont.)Simulation Results (cont.)

・・ InconsistentInconsistent with the CFTC official explanation with the CFTC official explanation

・・ ELP-HFT causes hot-potato effects,ELP-HFT causes hot-potato effects, but does not but does not amplify directional price movesamplify directional price moves

→ → Some other HFT strategies amplified the drop?Some other HFT strategies amplified the drop?

(e.g. Momentum Ignition, Order Flow Detection)(e.g. Momentum Ignition, Order Flow Detection)

ConclusionConclusion

・・ It's important to distinguish between It's important to distinguish between opportunistic HFT and market-making HFTopportunistic HFT and market-making HFT

・・ To test HFT strategies, you need a limit order To test HFT strategies, you need a limit order book (LOB) matching engine and simulatorbook (LOB) matching engine and simulator

・・ ELP market-making strategy by itself does notELP market-making strategy by itself does not

induce flash crashes, yet it can be used to initiate induce flash crashes, yet it can be used to initiate other opportunistic, volatility-inducing strategies other opportunistic, volatility-inducing strategies (e.g. Order Flow Detection)(e.g. Order Flow Detection)

ThanksThanks