Book Image

Developing High-Frequency Trading Systems

By : Sebastien Donadio, Sourav Ghosh, Romain Rossier
5 (1)
Book Image

Developing High-Frequency Trading Systems

5 (1)
By: Sebastien Donadio, Sourav Ghosh, Romain Rossier

Overview of this book

The world of trading markets is complex, but it can be made easier with technology. Sure, you know how to code, but where do you start? What programming language do you use? How do you solve the problem of latency? This book answers all these questions. It will help you navigate the world of algorithmic trading and show you how to build a high-frequency trading (HFT) system from complex technological components, supported by accurate data. Starting off with an introduction to HFT, exchanges, and the critical components of a trading system, this book quickly moves on to the nitty-gritty of optimizing hardware and your operating system for low-latency trading, such as bypassing the kernel, memory allocation, and the danger of context switching. Monitoring your system’s performance is vital, so you’ll also focus on logging and statistics. As you move beyond the traditional HFT programming languages, such as C++ and Java, you’ll learn how to use Python to achieve high levels of performance. And what book on trading is complete without diving into cryptocurrency? This guide delivers on that front as well, teaching how to perform high-frequency crypto trading with confidence. By the end of this trading book, you’ll be ready to take on the markets with HFT systems.
Table of Contents (16 chapters)
1
Part 1: Trading Strategies, Trading Systems, and Exchanges
5
Part 2: How to Architect a High-Frequency Trading System
10
Part 3: Implementation of a High-Frequency Trading System

What makes HFT so different from regular trading?

HFT trading should have the shortest feasible data latency (time delays) and the highest level of automation possible. HFT relates to algorithmic trading and automated trading. As a result, participants choose to trade in markets that have a high level of automation and integration in their trading platforms. Firms utilize computers programmed with precise algorithms to find trading opportunities and execute orders in algorithmic trading. To increase the speed of transactions, high-frequency traders use automated trading and fast connections (and cancellations or modifications). This is possible because of the technology that trading firms have in place but also because of the exchange technologies. The following exchanges have invested hundreds of millions of dollars in HFT technologies:

  • NASDAQ, New York City, is the first electronic stock exchange in the world. All of its equities are traded over a computerized network. It revolutionized the financial markets in 1971 by removing the requirement for a physical trading floor and in-person trading. It is the world's second-biggest stock exchange by market capitalization. Half of NASDAQ's composite offering was made up of technology firms. With less than 20% of the overall composite, the consumer sector came in second, followed by healthcare.
  • New York Stock Exchange (NYSE), New York City, is the world's largest exchange for the equity market. In 2013, Intercontinental Exchange, Inc. (ICE) bought NYSE.
  • London Stock Exchange (LSE), London, UK, is the largest stock exchange in Europe and the principal stock exchange in the United Kingdom mainly with regard to trading in company stocks and bonds. It was created about 300 years ago.
  • The Tokyo Stock Exchange (TSE), is Japan's largest stock exchange, with its headquarters in Tokyo. It was founded in 1878. The exchange has more than 3,500 listed businesses. The TSE, which is operated by the Japan Exchange Group, is home to the world's largest and most well-known Japanese corporations, including Toyota, Honda, and Mitsubishi.
  • The Chicago Mercantile Market (CME), sometimes known as the Chicago Merc, is a regulated futures and options exchange in Chicago, Illinois. Agriculture, energy, stock indices, foreign exchange, interest rates, metals, real estate, and weather are among the industries in which the CME trades futures and, in most cases, options.
  • Direct Edge, Jersey City. Its market share rapidly rose to tenth in the US stock market, and it typically transacted more than two billion shares daily. Better Alternative Trading System (BATS) Global Markets was a US-based exchange that traded a variety of assets, including stocks, options, and foreign exchange. CBOE Holdings purchased it in 2017 after it was created in 2005. BATS Global Market was one of the largest US exchanges prior to being bought, and it was well known for its services to broker-dealers, retail, and institutional investors.
  • The CBOE Options Exchange, which was founded in 1973, is the world's largest options exchange, with contracts centered on individual stocks, indexes, and interest rates.

All the preceding exchanges are controlled on several levels:

  • Trading limitations
  • Trading system transparency (information shared among market participants on the specificities of the architecture, as well as the way of handling orders)
  • The type of accepted financial instruments
  • Constraints by security issuers

For most regulated exchanges, the order size is an issue. Large trades have an important effect on the market (they can create market impact). Traders use Alternate Trading Systems (ATS), which have much less regulation in comparison to traditional exchanges (they don't have to be transparent). Dark pools are the most common sorts of ATS. The USA presently has around 30 dark pools, which represent a quarter of the US consolidated trading volume.

Dark pools are beneficial to HFTs because they can handle the speed and the level of automation demands while having reduced fees. This is not the case for any other type of trading, which makes HFT different from regular trading. In the following section, let's learn more about dark pools.

Effect of dark pools

For financial security, buy and sell orders are not displayed in dark pools (price and volume). Dark pools, in other words, are both opaque and anonymous since the order book is not advertised. Because it is not possible to see the size of the orders in this type of trading exchange, investors who place huge orders do not impact markets. Since the other participants do not see the size of the orders, the dark pools execute these large orders at a fixed price. It reduces the negative slippage given by trading exchanges.

Dark pools are obliged to notify deals once they have occurred, notwithstanding the lack of pre-trade transparency.

HFTs and dark pools have a complicated interaction. Dark pools rose in popularity partially as a result of investors seeking protection from HFTs' fraudulent activities on public exchanges, and HFTs finding it impossible to know the large orders in dark pools through pinging. Dark pools introduced a lack of transparency in the markets that allowed ill-equipped players (that is, on the sell side) to keep up with business practices that didn't match the state of the art at the time. And, of course, Haim Bodek wrote two books (The Problem of HFT and The Market Structure Crisis) about finding unordinary order types in dark pools.

On the other hand, a few dark pools encourage HFT traders to trade on their exchange. HFT strategies increase liquidity and the likelihood of having orders filled. Dark pools help HFTs to meet their speed and automation demands while still having reduced expenses. HFTs are responsible for the decrease in order sizes in dark pools. The dark pools have been hit by pinging trading strategies locating hidden large orders.

As a result, if these HFT tactics are present, the benefits of dark pools may be harmed. For example, in 2014, the Attorney General of New York filed a lawsuit against Barclays for its dark pool operations, alleging that it misrepresented the volume of Barclays's activity in dark pools. In 2016, Barclays paid a $35 million fine to the SEC and $70 million to the State of New York.

Dark pools can apply certain constraints to prevent HFTs from engaging in predatory behavior. The goal is to reduce pinging trading strategies. In 2017, Petrescu and Wedow imposed a minimum order size to minimize this type of strategy.

We could spend more time discussing the pros and cons of the impact of HFTs on dark pools, but we end up saying that the advantages of having more liquidity and faster execution are beneficial enough to have some dark pools being in favor of HFTs. It is fair for investors as long as they have a thorough understanding of how trading venues work so they can make educated judgments.

We have talked about the location of the major trading exchanges. Now we will introduce the HFT participants in the next section.