7
1 HIGH FREQUENCY TRADING SYSTEMS AND LATENCY MEASUREMENTt Key elements of a low-latency trading system application architecture

HigH Frequency Trading SySTemS and LaTency … · HIGH-FREQUENCY TRADING SYSTEMS AND LATENCY MEASUREMENT ... Since the client API level will be impacted by the ... Alberta T2P 5C5

  • Upload
    lamdien

  • View
    221

  • Download
    0

Embed Size (px)

Citation preview

1

HigH Frequency Trading SySTemS and LaTency meaSuremenTtKey elements of a low-latency trading system application architecture

2HIGH-FREQUENCY TRADING SYSTEMS AND LATENCY MEASUREMENT

ABOUT THE AUTHOR

Ganesh Kumar is a subject matter expert and functional analyst in exchange trading

systems at Sapient Global Markets, London. His specialties include business analysis,

quality analysis, multilateral trading facility (MTF), high frequency trading (HFT),

exchange trading systems, dark pools, FIX and smart order routing (SOR).

3

In recent years, regulatory changes in the EU and US have resulted in the launch of various typesof electronic trading systems, specifically for high frequency trading (HFT) and dark pools. Thesenew electronic exchanges have quickly embraced regulations, building technologically robustand advanced trading systems. In terms of market volumes, these newly built HFTs are nowcatching up to the traditional exchanges. The speed of trading, also called the low latency factor,is a key element in these rapid-fire trading systems. This white paper discusses the variouselectronic trading systems and latency improvement measures.

TRADING SYSTEMS

A typical trading system employs a set of complex rules within its matching engine in an effort to match buy- and sell-side orders. These rules can be very complex depending on the combination of order types, attributes, away market quotes and rules governing priority and parity. Ultimately, today’s newer exchanges build their core trading platforms to:

• Be technologically stable and robust • Enable high frequency trading• Support high throughput and low latency

MATCHING ENGINE

A principal software component of an electronic exchange, the matching engine is the nucleus of a trading system and has a set of trade rules embedded in it. Matching engines continuously work to match buy and sell-side orders, ultimately resulting in a trade only if it meets specific criteria as defined in the rules. A matching engine houses the business logic required for trading and uses a proprietary rules engine to process the business logic, which prioritizes business rules by:

• Price• Time• Visibility – Dark (or) Transparent

Typically these matching engine rules are created bytraders, specialists and industry experts. Order types,such as Limit, Market - IOC/FOK, Iceberg, Pegged, Stop,etc., are created to provide traders with multiple orderentry options. Each order type has its own attributes andadvantages. The priority with which these orders are entered into the order book is typically based on three key factors: price, time and visibility.

In real-time trading, all orders arrive one after the otherand are placed in a queue. The speed of the system canbe slowed down by functionally complex orders, such aswhen a pegged order sends multiple price updates tothe market data gateway.

DARK POOLS

The “dark” in dark pools refers to liquidity in any stockthat is not transparent to the public. In the case oftransparent or “light” orders, market participants cansee all requests to buy or sell a stock, along with the topfive bid/ask prices and also the number of shares. Theterm “pool” refers to the wide array of dark-only shares.Liquidity is primarily provided by institutional investorstrading dark shares amongst themselves withoutcontributing to market volatility. Both the light and darkorders together can be traded as a part of an integratedorder book. In order to be part of a separate dark pool,however, the order book must accept only dark orders.

4HIGH-FREQUENCY TRADING SYSTEMS AND LATENCY MEASUREMENT

Dark pools are similar to standard markets with typicalorder types and pricing and prioritization rules. Themarket data feed is only constrained to the buying andselling parties involved in a private trade, and hence,there is no need for the market depth feed or top fivebid/ask prices in order to display it to the public. Forinstance, dark pools have no need for an iceberg ordertype as the iceberg order displays the tip/portion of theorder to the public. In addition, no trade data will beprinted to the public market data feed.

Ultimately the rise in dark liquidity/ATS volume is due tothe following reasons:

• The reduction of the tick size to fractions (0.00001) has further reduced the spread between the bid and the ask price.

• Alternative trading systems (ATS) and electronic communication networks (ECNs) have introduced various methods for accessing liquidity.

• The use of algorithmic trading enables processing orders with higher levels of complexity and better access to liquidity.

MESSAGE RESPONSE LATENCY

Latency or message response latency can be definedas the duration between the submission of a businessmessage (i.e., order entry, amendment or cancellation)and reception of the system response to that businessmessage through either an initial acknowledgement orinitial execution report. Subsequent execution reports asa result of passive trading are generally not measured aspart of latency. Even within this definition there could betwo interpretations of the measurement point: the clientapplication programming interface (API) level or wirelevel. Since the client API level will be impacted by thechoice of client-side network stack and operating system, the latency is measured at the physical wire level as a general industry practice.

Typical Order book of an Equity Trading System

5

MEASURING MESSAGE RESPONSE LATENCY

Trading system latency can be calculated as the summation of various latency parameters:

Trading system latency = (All the processing node latencies)+ (Operating system network stack latencies)+ (The entire network device latencies)+ (The entire wire time latencies)

In the above equation, each parameter can be referred to as follows:

• The “processing node” is the time spent within the application business rules and logic.

• The “operating system network stack” is the time spent within operating system calls and hardware network interfaces.

• “Network device latencies” is the time spent in networking equipment (load balancers, firewalls and routers).

• The “wire time” is the time it takes for a message to be transmitted on a physical medium (e.g., ethernet).

MINIMIZING THE LATENCY AND AMPLIFYING THROUGHOUT

Message throughput is the number of business messages per second as measured when submitted to the system. This means that message output from the system (resulting from the input load) is generally not included in any throughput figures. System message throughput can be derived by multiplying the message rate of the rate-limiting component by the number of components installed. Thus, it’s possible to speed message throughput by reducing the individual component latency.

To maximize throughput, trading system application architecture should be designed to minimize message response latency and keep response jitters, narrow deviations of latency, within standard limits. In addition, a trading system application should ideally be deployed with an asymmetric pattern of performance per instrument (i.e., not all instruments should be deployed

Latency measurement at the client and wire level

Client APITrading System

HFT/ATS

Network MonitoringHardware

Wire level latency measured T3 - T2

Client level latency measured T4 - T1

T1Network

Card

T4

6HIGH-FREQUENCY TRADING SYSTEMS AND LATENCY MEASUREMENT

on hardware with equal performance). It is also important to allot an appropriate percentage of available hardware to latency-sensitive/revenue-generating instruments. And, it is critical that message response latency is consistently low. Latency consistency can be defined as the degree of variance from the average message response latency. Generally, it takes 50 to 55 micro seconds for data to travel one way on 10kms of fiber optic cable and any guarantee would obviously require a response. Thus, the physical co-location of servers, coupled with the infiniband switches, can significantly contribute to the reduction of latency to a large extent. In this instance, co-location refers to the physical server location closer to the stock exchange/HFT—since the lesser distance will result in higher execution speeds.

CONCLUSION

High frequency/low latency trading systems symbolize today’s focus on eliminating various technical bottlenecks. Every millisecond advantage in trading applications can be worth millions of dollars. So, critical factors, such as co-location, computing hardware and a functionally robust system can create an advantage over other low-latency systems. But, what’s fast today will likely seem slow and outdated tomorrow with new and improved systems providing faster execution speeds. To stay in the high-speed race, trading systems should be built to maximize throughput today, and designed to accommodate additional functional and technical changes that allow them to remain competitive with future standards.

GLOBAL MARKETS 1

DüsseldorfSpeditionstrasse 2140221 DüsseldorfGermanyTel: +49 (0) 211 540 34 0

GenevaSuccursale Genèvec/o Florence Thiébaud, avocaterue du Cendrier 151201 GenevaSwitzerlandTel: +41 (0) 58 206 06 00

HoustonHeritage Plaza1111 Bagby Street Suite 1950Houston, TX 77002Tel: +1 (713) 493 6880

LondonEden House8 Spital SquareLondon, E1 6DUUnited KingdomTel: + 44 (0) 207 786 4500

Los Angeles1601 Cloverfield Blvd.Suite 400 SouthSanta Monica, CA 90404Tel: +1 (310) 264 6900

Munich Arnulfstrasse 6080335 MünchenGermanyTel: +49 (0) 89 552 987 0

New York40 Fulton Street22nd FloorNew York, NY 10038Tel: +1 (212) 206 1005

SingaporeAir View Building #02-012 Peck Seah StreetSingapore 079305Republic of SingaporeTel: +65 (3) 104 5308

Toronto129 Spadina AvenueSuite 500Toronto, Ontario M5V 2L3CanadaTel: +1 (416) 645 1500

ZürichSeefeldstrasse 358008 ZürichSwitzerlandTel: +41 (58) 206 06 00

Global Offices

AmsterdamPrins Bernhardplein 2001097 JB AmsterdamNetherlandsTel: +31 (0) 20 330 0011

BangaloreSalarpuria GR Tech Park6th Floor, “VAYU” Block#137, Bengaluru 560066KarnatakaIndiaTel: +91 (080) 410 47 000

Boston131 Dartmouth Street3rd FloorBoston, MA 02116Tel: +1 (617) 621 0200

Calgary888 3rd Street SWSuite 1000Calgary, Alberta T2P 5C5CanadaTel: +1 (403) 444 5574

Chicago30 West Monroe,12th floorChicago, IL 60603Tel: +1 (312) 458 1800

DelhiTowers D & E,DLF Cyber GreensDLF Phase IIISector 25-AGurgaon 122002HaryanaIndiaTel: +91 (124) 416 7000