High-frequency trading (HFT): algorithms and strategies

People are no longer responsible for what is happening on the market because computers make all decisions, says Flash Boys author Michael Lewis. This statement most fully characterizes the high-frequency trading of HFT. More than half of all stocks sold in the United States are not committed by people, but by supercomputers, capable of placing millions of orders every day and gaining an advantage in milliseconds by competing for markets.

History of HFT

History of HFT

HFT is a form of algorithmic trading in finance, created in 1998. As of 2009, high-frequency negotiations accounted for 60-73% of total US stock trading. In 2012, this number dropped to about 50%. The level of high-frequency transactions today ranges from 50% to 70% of financial markets. Companies that work in the field of high-frequency trading compensate for the low margin with incredibly high trading volumes in the millions. Over the past decade, the opportunities and returns on such trade have declined sharply.

HFT uses sophisticated computer programs that predict how markets will operate based on the quantitative method. The algorithm analyzes market data in search of placement opportunities, observing market parameters and other information in real time. Based on this information, a map emerges in which the machine determines the right moment to agree on price and quantity. Focusing on the separation of orders by time and markets, she makes the choice of investment strategies in limit and market orders, these algorithms are implemented in a very short time.

The ability to directly enter the markets and place orders at positions with a speed in milliseconds caused the rapid growth of this type of operations in the total market. According to experts, high-frequency trading accounts for more than 60% of operations in the United States, 40% in Europe and 10% in Asia. Initially, HFT was developed in the context of stock markets, and in recent years it has been expanded to options, futures, ETFS (exchange of contractual funds) currencies and goods.

Algorithmic trading: terms

Algorithmic trading: terms

Before entering the HFT topic, you need to know some terms that make the explanations of the strategy more accurate:

  1. The algorithm is an ordered and finite set of operations that allows you to find a solution to the problem.
  2. A programming language is a formal language designed to describe a set of sequential actions and processes that a computer must follow. This is a practical method by which a person can tell the machine what to do.
  3. A computer program is a sequence of written instructions for performing a specific task on a computer. This is an algorithm written in a programming language.
  4. Backtest is the process of optimizing a trading strategy in the past. It allows you to find out, to a first approximation, possible performance and evaluate whether the operation is expected.
  5. Message server - a computer designed to match purchase orders with sales of a specific asset or market. In the case of FOREX, each liquidity provider has its own servers that provide online trading.
  6. Collocation (co-location) - determines how to place the executive server, as close as possible to the message server.
  7. Quantitative analysis is the financial branch of mathematics, which, through the prism of theories of physics and statistics, trading strategies, research, analysis, portfolio optimization and diversification, risk management and hedging strategies, gives the result.
  8. Arbitration is a practice based on the use of price differences (inefficiencies) between the two markets.

The nature of High Frequency Trading

The nature of High Frequency Trading

These systems have absolutely nothing to do with advisers. The algorithms that control these machines do not correspond to the main style of the adviser - "if the price crosses down, the moving average enters into a short position." They use quantitative analysis tools, forecasting systems based on psychology and human behavior, and other methods that most users are likely to never know. Scientists and engineers who develop and code these high-frequency trading algorithms are called quanta.

These are systems that really make money, with huge capabilities of up to 120 million dollars a day. Therefore, the cost of introducing these systems is certainly high. It is enough to calculate the costs of software development, the salary of quanta, the cost of the necessary servers to run the specified software, the construction of data centers, land, energy, colocalization, legal services and much more.

This trading system is called "high frequency" by the number of operations that it performs every second. Therefore, speed is the most important variable in these systems, the key from which the solution follows. Therefore, the colocalization of servers computing the high-frequency cryptocurrency trading algorithm is very important.

This follows from this specific fact: in 2009, Spread Network installed a fiber-optic cable in a straight line from Chicago to New Jersey, where the New York Stock Exchange is located, paying $ 20,000,000 for work. This network reconstruction reduced the transmission time of information from 17 to 13 milliseconds.

An example of a trade transaction. A trader wants to buy 100 shares of IBM. There are 600 shares on the BATS market at a price of $ 145.50, and another 400 shares on the Nasdaq market at the same price. When he completes his purchase order, high-frequency machines detect it before the order reaches the market and buy these shares. Then, when the order reaches the market, these machines will put them up for sale at a higher price, so in the end, the trader will buy 1000 shares at a price of 145.51, and market makers will receive a difference due to the higher connection and processing speed. For HFT, this operation will take place without risk.

Opaque platforms and infrastructure

Taking into account the previous example, you need to understand how the HFT finds out on the market about the purchase order for 1000 shares. Opaque algorithmic trading platforms appear here that use the same “brokers” and represent a room with servers. The gain is that instead of sending orders to the market, some brokers send them to their opaque HFT platform, which uses speed and buys stocks on the market, and then sells them at a higher price than the initial price to the investor, in just a few milliseconds. In other words, the broker, who theoretically follows the interests of the trader, actually sells it HFT, for which he charges a good fee.

Opaque platforms and infrastructure

The infrastructure that high-frequency markets need is amazing. It is located in data centers, often the financial institutions themselves, near the offices of exchanges, which are also data centers. The proximity of the data center location is extremely important, since speed matters in this strategy, and the smaller the distance the signal must travel, the faster it will reach its destination. This applies to large financial firms that can take the cost of buying land and build their own data center with thousands of servers, emergency power supply systems, private security, pay astronomical bills for electricity and other expenses.

Smaller companies that devote themselves to this business prefer to host their servers inside opaque broker platforms or in data centers in the same markets. This is a controversial point, because the same brokers and markets “rent” space for HFT to minimize access time to prices.

Advantages and disadvantages of trading

Advantages and disadvantages of trading

According to the above, the image of HFT in public debates is very negative, especially in the media, and in a broader sense, it is perceived as an emanation of “cold” finances, dehumanization with harmful social consequences. In this context, it is often difficult to rationally talk about a subject that is traditionally based on financial passion and sensation, whether in the political or media sphere.

In certain circumstances, HFT may have implications for the stability of financial markets. In addition to the purely technical aspects associated with trading strategies for high-frequency trading on low-volatility securities, the main risk at the global level is systemic risk and system instability. For some HFTs, innovation that increases the risk of financial crisis is a prerequisite for adapting to the market ecosystem.

Three main reasons for the instability of high-frequency trading in Russia:

  1. Loop retroactivity can be built and self-reinforced using automated computerized transactions. Small changes in the cycle can cause a large modification and lead to undesirable results.
  2. Instability. This process is known as “normalization of deviations”. Specifically, there is a risk that unexpected and risky actions, such as small disruptions, will gradually be considered increasingly normal until a disaster occurs.
  3. Not an instinctive risk inherent in financial markets. One of the reasons for potential instability is that individually tested algorithms that give satisfactory and encouraging results may actually be incompatible with algorithms introduced by other firms, which makes the market unstable.

In this debate about the benefits and harms of HFT high-frequency trading, there are enough fans of this type of world trade with their own arguments:

  1. Increased liquidity.
  2. Lack of psychological dependence on market operators.
  3. The spread, which is the difference between the offer price and the sale price, is mechanically reduced by increasing the liquidity generated by the HFT.
  4. Markets may be more efficient.
  5. Indeed, algorithms can exhibit market anomalies that people cannot see due to cognitive abilities and limited computations. Thus, compromises can be made between different classes of assets (stocks, bonds and others) and stock markets (Paris, London, New York , Moscow), so that an equilibrium price will be established.

The financial industry opposes

The financial industry opposes such regulation, arguing that the consequences will be counter-productive. Indeed, too much regulation is equivalent to a smaller exchange and turnover of loans, mechanically increases the cost of the latter, ultimately access to capital becomes more expensive for business, and has negative consequences for the labor market, goods and services.

Therefore, several countries want to officially regulate and even ban HFT. However, any purely national regulation will affect only a small area, since, for example, HFT for securities in this country can be done on platforms located outside it. A purely national law will have the same weakness as any territorial law in the face of free capital that can be distributed and exchanged around the world. A country that wants to unilaterally implement such regulation will lose. At the same time, other countries will win doubly, on its weakening.

The only viable option in the short and medium term is legislation at the regional level. In this context, Europe can accept it, if it makes significant progress in this direction, then countries outside Europe, the United Kingdom and the United States will benefit.

Characteristics of trading tables

Agents using such transactions are private trading table firms in investment banks and hedge funds that, based on these strategies, are able to generate large volumes of transactions in short periods of time.

Companies engaged in high-frequency trading are inherent in:

  1. The use of computer equipment equipped with high-performance software and hardware - routing, execution and cancellation generators.
  2. Use of co-location services, with the help of which they establish their servers physically close to the central processing system.
  3. Submission of numerous orders that are canceled shortly after the presentation, the goal of the income of such orders is to capture expanded sales in front of other players.
  4. Very short deadlines for the creation and liquidation of positions.

Features of different strategies

Features of different strategies

There are various types of HFT strategies, each of which has its own proprietary features, usually this:

  • market creation;
  • statistical arbitration;
  • liquidity identification;
  • price manipulation.

The market creation strategy constantly issues competitive limit buy and sell orders, thereby ensuring liquidity for the market, and its average profit is determined by the demand / offer spread, which, along with the introduction of liquidity, provides its advantage, since fast operations are less influenced by price movements.

In strategies called liquidity detection, HFT algorithms try to determine the benefits of the actions of other large operators, for example, by adding several data points from various exchanges and searching for characteristic patterns in variables such as order depth. The purpose of this tactic is to capitalize on price fluctuations created by other traders so that they can buy, immediately before executing large orders, from other traders.

Market manipulation strategies. These methods, used by high-frequency operators are not so clean, create problems in the market and, in a sense, are illegal. They mask offers, not allowing other market participants to disclose commercial intentions.

Common Algorithms:

  1. Filling is when the HFT algorithm sends more orders to the market than the market can handle, potentially causing problems for so-called slower traders.
  2. Smoking is an algorithm that includes the submission of orders attractive to slow traders, after which the orders are quickly reissued with less favorable conditions.
  3. Substitution is when the HFT algorithm publishes sell orders, when the real intention is to buy.

Online Trading Courses

Online Trading Courses

Creating automated trading systems is an excellent skill for traders of any level. You can create complete systems that trade without constant monitoring. And effectively test your new ideas. Trader save time and money by learning how to code yourself. And even if you outsource coding, it’s better to communicate if you know the basics of the process.

It is important to choose the right trading courses. When choosing take into account such factors:

  1. Number and quality of reviews.
  2. Course content and curriculum.
  3. A variety of platforms and markets.
  4. Coding language.

If the future trader is new to programming, MQL4 is an excellent choice where you can take a basic programming course in any Python or C # language.

MetaTrader 4 (MT4) is the most popular graphical platform among retail Forex traders with a scripting language - MQL4. The main advantage of MQL4 is the huge amount of resources for Forex trading. In forums such as ForexFactory, you can find the strategies used in MQL4.

On the Internet there are enough online courses on this strategy that have several basic and common strategies, including crossovers and fractals. This gives the beginner enough knowledge to learn advanced trading strategies.

Another course “Black Algo Trading: Create Your Trading Robot” is a high-quality product, and is the most comprehensive for MQL4. It is noteworthy that it covers optimization methods that are skipped by other courses and is comprehensive for any beginner.

The teacher, Kirill Eremenko, has many popular courses with enthusiastic user reviews. Course "Create your first robot at FOREX!" is one of them. This is the main practical course that introduces high frequency trading programs in MQL4. It is aimed at absolute beginners and begins with training in installing MetaTrader 4 software.

Moscow Exchange

Moscow Exchange

Young traders think that the largest Russian stock holding is trading exclusively in the stock market, which is certainly wrong. It has many markets, such as urgent, innovative, investment and others. These markets differ not only in the types of trading assets, but in the way they organize sales, which indicates the versatility of the IB.

Last year, the CBR analyzed trading on the Moscow Exchange of HFT participants and their impact on the work of the CBR. It was conducted by specialists from the Department for Combating Unfair Practices. The need for this topic is explained by the growing importance of HFT in the Russian markets. According to the Central Bank, HFT-participants account for a significant part of the transactions of the IB of Russia, which is comparable with data from developed financial markets. In total, 486 solid HFT accounts are officially operating on the MB markets. Bank experts divided the HFT participants into four categories depending on the volume of work on the MB:

  • Directional;
  • Maker
  • Taker;
  • Mixed

According to the results, HFT firms actively participate in the work of MB, which allows online trading dealers to quote rates in a very wide range and confirms the positive result of HFT operations on market liquidity. In addition, the transaction costs of HFT participants involved in the purchase / sale of foreign currency will decrease. This level of instant liquidity increases the prestige of the foreign exchange market, experts say the CBR.

Experts record the diversity of trading activity on the Moscow Exchange, with the ability to influence the characteristics of the market. These are real algorithmic trading systems of financial markets. There are systems responsible for absorbing or injecting liquidity in very short periods of time that embody the figure of the “beholder”, which ultimately makes the price move.

Prospects for high-frequency trading

In this trade, market makers and major players use algorithms and data to make money by placing huge volumes of orders and earning small margins. But today it has become even smaller, and the possibilities of such a business have declined: income on world markets last year was approximately 86% lower than ten years ago at the peak of high-frequency trading. In the face of continued pressure on the sector, high-frequency traders are trying to defend more stringent working conditions.

Prospects for high-frequency trading

There are many reasons why the income of this practice has declined over the past decade. In a nutshell: increased competition, increased costs and low volatility, all played a role. Vikas Shah, an investment banker at Rosenblatt Securities, told the Financial Times that high-frequency traders have two raw materials they need to work efficiently: volumes and volatility. The algorithm comes down to a zero-sum game based on how fast modern technology can be. Once they reach the same speed, the benefits of high frequency trading will disappear.

Obviously, this is a very large and interesting topic, and the secrecy that surrounds it is quite justified - whoever has a chicken that lays golden eggs does not want to share it.

Source: https://habr.com/ru/post/G32255/


All Articles