High-Frequency Trading - mysmu.edu · Detect order flow that influences market direction - Order...
Transcript of High-Frequency Trading - mysmu.edu · Detect order flow that influences market direction - Order...
1 of 56 February 13, 2017
High-Frequency Trading
Fast & Furious Algorithmic Trading
© Christopher Ting
2 of 56 February 13, 2017
Algorithmic Trading Recalled
© Christopher Ting
Algorithmic trading (also called automated trading, black box trading and robotrading) is typically used to break up large orders into smaller orders to reduce execution risk, preserve anonymity and to minimize the price impact of a trade.
Orders are often partially revealed with iceberg or hidden-size orders
Hidden portions of large institutional orders are sometimes referred to as dark liquidity pools.
Image Source http://www.mooretechllc.com/
3 of 56 February 13, 2017
Algorithmic Strategies
© Christopher Ting
Algorithmic trading results from mathematical models, which analyze quotes and trades, identify liquidity opportunities, and use this information to make intelligent trading decisions.
Some algo models seek to trade at or better than the average price over a day (e.g. VWAP, volume weighted average price)
Some seek to execute slowly so as to have minimal price impact.
Some seek to exploit arbitrage opportunities or price spreads between correlated securities.
Algorithms sometimes are set to produce more volume at market opens and closes when volume is high, and less during slower periods such as around lunch.
4 of 56 February 13, 2017
Short Definition of Algo Trading
© Christopher Ting
Algorithmic trading strategies also includes “Alpha Models” to make trade decisions to generate trading profits and/or to control risk.
Thus, more generally, algorithmic trading can be defined as trading based on the use of computer programs and trading analytics to execute orders according to pre-defined strategies.
Image Source: http://www.tothetick.com/forex-trading-basics-tutorial-9-automated-forex-trading
5 of 56 February 13, 2017
Risk and Caveat
© Christopher Ting
Algorithmic trading does have risks, including:
Leaks that might arise from competitors’ efforts to reverse engineer them.
lack of capacity to handle or respond to exceptional or rare events.
Thus, careful human supervision of algorithmic trading and other safeguards is still crucial.
6 of 56 February 13, 2017
Insight!
© Christopher Ting
What is quantitative trading, really?
At the core it is about distilling useful information from among myriad sources in the “crowd” quickly so as to
Buy before the crowd buys.
Sell before the crowd sells.
So, it is about getting information fast and exploit your edge quickly.
7 of 56 February 13, 2017
Technology Advancement
© Christopher Ting
How to
Obtain and gather information
Process and analyze information
Decide to trade or don’t trade
If trade, decide whether buy or sell, and also determine the trade size
Send the orders to the exchange
Receive the acknowledge and confirmation
as quickly as possible, and quicker than the crowd?
Answer: Technology
RESULT:
8 of 56 February 13, 2017
CFTC’s Definition
HFT is a form of automated trading that employs:
A. algorithms for decision making, order initiation,
generation, routing, or execution, for each individual
transaction without human direction;
B. low-latency technology that is designed to minimize
response times, including the subscription to proximity
and co-location services;
C. high speed connections to markets for order entry;
D. recurring high message rates (orders, quotes or
cancellations) determined using one or more objective
forms of measurement, including cancel-to-fill ratios.
© Christopher Ting
9 of 56 February 13, 2017
SEC’s Broad Definition of HFT
© Christopher Ting
Utilisation of high-speed, complex computer programs and equipment to effect trades
Utilisation of co-location services to reduce latencies
Extremely small time-frames for opening and closing positions
Placing numerous orders and as quickly cancelling them
Ending the trading day in as close to a flat position as possible
Remark: In the US equity market, HFT amounts to more than 50% of all trading activity by volume and represents a significant source of liquidity.
10 of 56 February 13, 2017
Three Bare Essentials o HFT
Trading infrastructure Reliable and fast execution platforms
Trading strategies Comprehensive and accurate prediction models
Automated execution Decisions, risk management, and orders are completely
driven by quantitative models of the markets.
© Christopher Ting
12 of 56 February 13, 2017
Frequency and Latency
© Christopher Ting
High frequency reaction requires ultra-low latency in the pathway connecting the order generating machine to the exchange order matching system.
Category Reaction speed Trade duration
Very Low-Frequency >several hours > 1 week
Low-Frequency up to several minutes 1 day to 1 week
Medium Frequency up to several seconds 10 minutes to 1 day
High Frequency 100 milliseconds or less 10 seconds to 10 minutes
Ultra High-Frequency <1 millisecond <10 seconds
13 of 56 February 13, 2017
Characteristics of HFT
Rapid submission and cancelation of orders
Fast opening and closing of a position
High turnover of capital
Automation
Millisecond speed
Ultra-low latency
© Christopher Ting
14 of 56 February 13, 2017
Milliseconds
On Singapore’s exchange, the share of derivatives tradesaccounted for by HFT has risen from 10% to 30% in two years.
What about equities?
© Christopher Ting
15 of 56 February 13, 2017
Algo Strategies that Need HFT
© Christopher Ting
Concept Description Example strategy Profit source
Liquidity provision
Provide bids and asks to the market. Update on new information.
- Market making Bid-ask spread
Arbitrage Determine ‘fair value’ and relationship between correlated products; buy cheap and sell expensive. Combines passive and aggressive orders .
- Spread trading- Index /ETF arb- Cross-exchange- Pairs trading- Statistical arbitrage
Short-term market inefficiencies
Short-term Momentum
Determine impact of newinformation (news, sharp market moves) and trade accordingly
- News based Short-termshift in fair value
Liquidity detection
Detect order flow that influences market direction
- Order book pressure
Short-termtrend
16 of 56 February 13, 2017
Examples of HFT Strategies
© Christopher Ting
Spread trading: SPY vs E-Mini, Front month futures vs Back Month Futures. Near perfect correlation, same underlying.
Index/ETF arbitrage: Basket of stocks vs futures, ETF constituents vsETF if NAV deviates.
Cross exchange: In Europe Shell in NL & UK. In U.S. 13 exchanges Order inserted on one exchange impacts algos on all other exchanges.
Pairs trading: Correlated products – mean reversion. Big buyer in BHP moves price up. Sell BHP buy RIO – wait till reverse.
Stat arb: more complex version of pairs trading. Multiple instruments, e.g. relationships between 6 currencies and short-term interest rate futures. Based on real-time regression models, GARCH etc.
News based: Expected impact of economic figures. Link system to datafeed and insert orders when better/worse than expected. Link to datafeed and scan for keywords e.g. take-over, rights issue etc.
17 of 56 February 13, 2017
What is Market Making?
Buyers and sellers’ orders arrive at the market at different time with varied order sizes.
Need a middle man to intermediate the buying and selling demand
Buy at the lower bid price and sell at the higher ask (also called the offer) price.
The bid-ask spread is the compensation for bearing market risk and liquidity provision
© Christopher Ting
18 of 56 February 13, 2017
News + Financial Market Data
Data analysis News + Data quant models
Mainstream
News
Pre-News
Web 2.0
Social Media
Pre-Analysis Classifiers
Sentiment
Scores
(Numeric) financial
market data
Analysis Consolidated
News+Data
Updated beliefs,
Ex-ante view of market
environment
Quant Models
A. Return Predictions
B. Fund Management
C. Trading Decisions
D. Volatility estimates
and risk control
© Christopher Ting
21 of 56 February 13, 2017
Schematics of a HFT Infrastructures
© Christopher Ting
Orders
Exchange
FPGA/Co-Lo
Live feed Last Traded Price Trade confirmation
Ticker Plant
Other Co-Lo’s
Trader
Trading parameters
Order/Trade updates
Trading parameters
22 of 56 February 13, 2017
Why Co-location?
Distance does
matter.
Speed of light
299,792,458 m/s
If a trader is 3,000
km away from the
exchange, the
signal takes at least
10 milliseconds to
reach the exchange.High-speed cable tray for co-location services at Equinix 4 market center, New Jersey.
© Christopher Ting
23 of 56 February 13, 2017
ACTIV Financial
(Chicago)
ACTIV Financial
(New York)
NA
OPRA-NBBO
OPRA-FULL
UCSs
UCS:
DCS:
TSS:
CG:
UDP
OPRA
CTA,
CBOT,
CME,
etc
Option 2, the client has a backup circuit.
Option 1, the client has no backup circuit.
Option 3, the client DCS receives the
feed twice, diversely routed (and
arbitrates at a datagram level if possible
or processes one of the feeds if not).
NEWS
Republisher
ActivFeed Delivery Options
Client (Option 2)
Republisher
NA
OPRA-NBBO
OPRA-FULL
UCSs
UDP
OPRA
CTA,
CBOT,
CME,
etc
NEWS
DCS /
TSS / CG
API
Client
UDP TCP
Client (Option 1)
DCS /
TSS / CG
API
Client
UDP TCP
Client (Option 3)
DCS /
TSS / CG
API
Client
UDP TCP
Upstream Content Server
Downstream Content Server
Time Series Server
Content Gateway
DJNW
Comtex
etc.
DJNW
Comtex
etc.
© Christopher Ting
24 of 56 February 13, 2017
Market Data Feed
DCs Across Asia:
Tokyo
Seoul
Hong Kong
Singapore
Efficient:
DCs are landing points for Pan-Asian network
No unnecessary hops
Distributed:
No central consolidation point
Point-to-point delivery
Lowest Latency
65ms
© Christopher Ting
25 of 56 February 13, 2017
Technological Arms Race
© Christopher Ting
Software Platform ~300μsMPU 1st Generation ~40 μsMPU 2nd Generation 40 μs > 6 μs
26 of 56 February 13, 2017
2nd Generation MPU - PCI-E
PCI-E Card: Full height half length Gen II PCI-E Can be deployed in Application Server Down to Single-Digit Microsecond Latency
© Christopher Ting
27 of 56 February 13, 2017
Field-Programmable Gate Array
An integrated circuit designed to be configured by a customer or designer after manufacturing. The configuration is done via a hardware description language (i.e. changes to the electronic circuit to allow for automated analysis and simulation).
© Christopher Ting
28 of 56 February 13, 2017
FPGA and High Frequency Trading
The Need For Speed
In HFT, money is made and lost in milliseconds (and even microseconds)
Speed provides the competitive advantage and the fastest players get the profits
Inadequacy of Computers
Computer hardware is designed to perform a myriad of tasks
Operating Systems Burden: The OS uses “time-slicing” to share the processor’s time between trading software and other applications
Protocol Stack Burden: There are many protocol layers between trading software and the market which results in delay
© Christopher Ting
29 of 56 February 13, 2017
Why Use Specialized Hardware
Gain edge over competitors with faster speed
Don’t share processing time with other applications
Operate on lesser protocol layers
The FPGA Solution
Simple strategies (e.g. Order Flow strategy) can be coded onto the FPGA to be executed
Uses hardware to bypass the OS and protocol stack
Lightning fast connection to the market
© Christopher Ting
30 of 56 February 13, 2017
Benefits of FPGA
Ultra low latency to get orders in the queue first
Spot arbitrage opportunities quickly before they are gone
Exit market quickly during “flash crash”
Inexpensive
© Christopher Ting
31 of 56 February 13, 2017
More High-Tech
© Christopher Ting
Microwave
The first microwave connections between London and Frankfurt have been launched, cutting the time to send a trade by about 40% compared with optic fiber cables
Nasdaq-CME Microwave
Is it fair to let some market participants obtain quotes information tens of milliseconds earlier than others?
32 of 56 February 13, 2017
Dark Pools
© Christopher Ting
Dark Pools, Internalization, and Equity Market Quality
33 of 56 February 13, 2017
Why Dark Pools?
© Christopher Ting
Shares trading is not done exclusively at the exchange in the U.S.
In the past, block traders trading 10,000 shares and more trade them off the exchange to minimize the price impact while getting their orders filled completely.
Brokers and broker-dealers provide the service to match the buyer with the seller.
Recently, human brokers are being replaced by electronic systems.
Crossing Networks
34 of 56 February 13, 2017
Dark Pools and the Changing Landscape
© Christopher Ting
The number of market makers on the NYSE had fallen to five from 25 since 2000 as the business of providing liquidity became dominated by hundreds of automated traders across markets with less stringent rules about when they must buy and sell.
35 of 56 February 13, 2017
Market Fragmentation
© Christopher Ting
The U.S. equity market structure is fragmented. As of 2013, equity trading is dispersed across 13 exchanges, at least one electronic communications network (ECN), approximately 16 reporting dark pools, and more than 200 broker/dealers who internalize order flow.
Most exchanges and ECN are structured as electronic limit order book markets. Exchanges are generally both pre-trade and post-trade transparent:
Prices and trading interest are displayed prior to execution, and transaction details are publicly disseminated in real time.
36 of 56 February 13, 2017
U.S. ``Market Centers’’
© Christopher Ting
Code New Name Old NameA NYSE MKT American Stock ExchangeB NASDAQ OMX BX Boston Stock ExchangeC National Stock Exchange Cincinnati Stock ExchangeD FINRA NASDJ EDGA ExchangeK EDGX ExchangeN NYSE Equities New York Stock ExchangeM Chicago Stock Exchange MidWest Stock ExchangeO CBOE Stock ExchangeP NYSE ARCA Pacific Stock Exchange
T, Q NASDAQ NASDAQX NASDAQ OMX PHLX Philadelphia Stock ExchangeY BATS Y ExchangeZ BATS Z Exchange
37 of 56 February 13, 2017
“OTC” Markets
© Christopher Ting
OTC Markets Group operates open, transparent and financial marketplaces for 10,000 U.S. and global securities.
The OTCQX, OTCQB and OTC Pink marketplaces represent U.S. and global public companies that are traded in the U.S. off the exchanges.
38 of 56 February 13, 2017
The OTC Bulletin Board®
© Christopher Ting
OTCBB is a regulated quotation service that displays real-time quotes, last-sale prices, and volume information in over-the-counter (OTC) equity securities. An OTC equity security generally is any equity that is not listed or traded on NASDAQ® or a national securities exchange.
39 of 56 February 13, 2017
Why the Name Dark Pools?
© Christopher Ting
Quotes are not published for public, “unlit”
systematized execution facilities that operate with limited pre-trade transparency. The prices of orders entered into the dark pool are not displayed to other market participants and are matched anonymously against contra-side orders.
Anonymous liquidity pools
Classified as alternative trading systems by SEC
Dark pools provide an avenue for large institutional investors to trade anonymously with minimal market impact and can help operators improve pricing and reduce transaction costs for clients.
41 of 56 February 13, 2017
SEC versus Pipeline Trading Systems LLC
© Christopher Ting
The seven-year-old dark pool operator specializing in block trades, will pay $1.2 million to resolve U.S. claims it failed to provide the confidentiality and liquidity it advertised to customers. Sources: http://online.wsj.com/news/articles/SB10001424052970204777904576651111404462184
http://www.bloomberg.com/news/2011-10-24/pipeline-agrees-to-pay-1-million-over-sec-dark-pool-claims.html
42 of 56 February 13, 2017
Predict What Customers Might Buy or Sell
© Christopher Ting
According to the SEC, New York-based Pipeline enlisted traders of its own to make its platform look more attractive to institutional clientele—but kept the arrangement hidden from customers.
Clients of Pipeline's private market nearly all the time wound up trading with an entity called MilstreamStrategy Group LLC, an affiliate of Pipeline.
Milstream, according to regulators, tried to predict what shares Pipeline's customers might buy or sell, and made similar trades on other markets before filling customer orders on the Pipeline platform.
43 of 56 February 13, 2017
SEC versus eBX LLC
© Christopher Ting
eBX agreed to pay $800,000 to settle the SEC's allegations. It did so without admitting or denying wrongdoing.
Source:: http://online.wsj.com/news/articles/SB10000872396390444223104578034413566549332
44 of 56 February 13, 2017
Transaction liquidity
Liquidity: How readily a security or asset is bought or sold at the current market price.
Does HF spread trading contribute to liquidity provision?
© Christopher Ting
45 of 56 February 13, 2017
Volatility
How violent does a security price swing
Does HF spreading trading contribute to market volatility?
May 6, 2010 Flash crashes
© Christopher Ting
46 of 56 February 13, 2017
CFTC-SEC Investigation
Kansas-based investment company Waddell & Reed Financial Inc.
At 2:32 p.m., the company triggered a cascade of selling by trying to unload 75,000 E-mini S&P 500 futures contracts
Waddell & Reed’s sell order was so large and hit the market so hard that it overwhelmed the available buyers. This sucked liquidity out of the market and allowed prices to go into free fall.
© Christopher Ting
47 of 56 February 13, 2017
Many other flash crashes
59 wrong orders cause stock dive on NSE in Mumbai
End of the World for SIMSCI?
© Christopher Ting
48 of 56 February 13, 2017
October 19, 1987 (Black Monday)
The 23 percent plunge in the Dow Jones Industrial Average came amid signs of a slowing economy, the threat of higher taxes and concern among individuals that trading was rigged for insiders.
Japan's Nikkei 225 Stock Average fell 2.4 percent before market opened. By midday, stocks in London were down 10 percent.
In New York, 11 of the 30 Dow components didn't open in the first hour of trading. The Dow went on to fall 508 points, while the S&P 500 tumbled to 224 from 282.
© Christopher Ting
50 of 56 February 13, 2017
Automated Exchange
© Christopher Ting
The NYSE, predominantly a market run by and for humans in 1987, is now an automated exchange with so-called designated market makers overseeing trading in their assigned stocks.
There are four main market makers on the exchange's trading floor, including Getco LLC, one of the largest automated trading firms, compared to more than 50 specialists at the time of the Black Monday crash.
51 of 56 February 13, 2017
Myth of Market Making
© Christopher Ting
Financial market is inherently an unstable system. When a critical mass is reached, the chain reaction occurs spontaneously. On Black Monday, there was a lot of selling pressure and some (human) specialist firms in NYSE didn’t open to make the market, as they deemed the costs of market making were far too high.
When everyone realizes that everyone else wants to sell fast at the same time, panic strikes. It doesn’t matter whether humans or automated algorithms are making the market.
53 of 56 February 13, 2017
What Happened in Singapore?
© Christopher Ting
Straits Times 1987 Oct 20
Market Suffers 169-Point Drop
Straits Times 1987 Oct 21
Another 261 Points Down
54 of 56 February 13, 2017
Exit Door Hasn’t Changed a Bit
© Christopher Ting
While Procter and Gamble Co. and McDonald's Corp. are up
more than 800 percent since 1987, protections adopted after the
crash couldn't stop unharnessed computer trading from erasing
almost $900 billion of value in less than 20 minutes on May 6,
2010, based on data compiled by Bloomberg.
E.E. "Buzzy" Geduld, 69, who oversaw about 60 equity traders 25
years ago at Herzog, Heine & Geduld Inc. and now runs
investment firm Cougar Trading LLC, says crashes happen when
investors become convinced they've lost control.
“In 1987 everybody tried to go to the exit at the same time, but the
exit door wasn't big enough," Geduld said. "You had literally a
panic. Fast forward to 2012. The volumes we can handle are
gigantic, but the exit door hasn't changed in size.”
55 of 56 February 13, 2017
Circuit Breakers: Did They Work?
© Christopher Ting
“The theory of the circuit breakers was that if there were predetermined
stopping points for the market, then the market participants would
know this wasn’t a panic closing,” said Ruder.
BUT, the plunge in May 2010 didn't trigger those circuit breakers. The
Dow average fell 9.2 percent, most of it between 2:30 p.m. and 3 p.m.,
after aggressive selling of E-mini S&P 500 futures by a mutual fund
company caused a flight of liquidity. As equity market makers and other
providers of bids and offers withdrew, trades in individual stocks took
place at prices including fractions of 1 cent and $99,999.99.
While the flash crash wasn't caused by high-frequency traders, their
habit of buying and selling rapidly led to the sudden removal of
liquidity, kicking off a related plunge in stocks, a report by the SEC and
CFTC said on Sept. 30, 2010.
56 of 56 February 13, 2017
Crash versus Flash Crash
© Christopher Ting
In 1987, panic spread on Wall Street by phone and ticker
tape. About $1 trillion in stock-market value was erased in
four days, according to a report by a task force led by
Treasury Secretary Nicholas Brady in January 1988.
It took more than a year to restore the 1987 crash, compared
with a week following the retreat on May 6, 2010.
Both these routs proved to be buying opportunities. Within
10 years of the 1987 crash the Dow average had quadrupled
and investors were enjoying the biggest bull market ever.
After falling 999 points on May 6, 2010, the gauge ended the
day down 348. The Dow rose 6.5 percent through the end of
the year.