Algo trading: its essence, trading strategies and risks

Алготрейдинг Другое

Currently, most operations on exchanges are carried out using special robots, in which various algorithms are embedded. This tactic is called algorithmic trading. This is a trend of recent decades that has changed the market in many ways.

What is algorithmic trading?

The main form of algorithmic trading is HFT trading. The point is to complete the transaction instantly. In other words, this type uses its main advantage – speed. The concept of algorithmic trading has two main definitions:

  • Algo trading. An autosystem that can trade without a trader in the algorithm given to it. The system is necessary for receiving direct profit due to auto-analysis of the market and opening positions. This algorithm is also called a “trading robot” or “adviser”.
  • Algorithmic trading. Execution of large orders in the market, when they are automatically divided into parts and gradually opened in accordance with the specified rules. The system is used to facilitate the manual labor of traders when conducting transactions. For example, if there is a task to buy 100 thousand shares, and you need to open positions on 1-3 shares at the same time, without attracting attention in the order feed.

To put it simply, algorithmic trading is the automation of day-to-day operations performed by traders, which reduces the time required to analyze stock information, calculate mathematical models, and complete transactions. The system also removes the role of the human factor in the functioning of the market (emotions, speculation, “trader’s intuition”), which sometimes negates even the profitability of the most promising strategy.

The history of the emergence of algorithmic trading

1971 is considered the starting point of algorithmic trading (it appeared simultaneously with the first automatic trading system NASDAQ). In 1998, the US Securities Commission (SEC) officially authorized the use of electronic trading platforms. Then the real competition of high technologies began. The following significant moments in the development of algorithmic trading, which are worth mentioning:

  • Early 2000s. Automated transactions were completed in just a few seconds. The market share of robots was less than 10%.
  • year 2009. The speed of order execution was reduced several times, reaching several milliseconds. The share of trading assistants has skyrocketed to 60%.
  • 2012 and beyond. The unpredictability of events on the exchanges has led to a large number of errors in the rigid algorithms of most software. This led to a reduction in the volume of automated trading to 50% of the total. Artificial intelligence technology is being developed and is being introduced.

Today, high-frequency trading is still relevant. Many routine operations (for example, market scaling) are performed automatically, which significantly reduces the burden on traders. However, the machine has not yet been able to completely replace the living intellect and developed intuition of a person. This is especially true when the volatility of the stock market increases strongly due to the publication of significant economic international news. During this period, it is highly recommended not to rely on robots.

Advantages and disadvantages of algorithmic trading

The advantages of the algorithm are all the disadvantages of manual trading. Humans are easily influenced by emotions, but robots are not. The robot will trade strictly according to the algorithm. If the deal can make a profit in the future, the robot will bring it to you. Also, a person is far from always able to fully concentrate on his own actions and from time to time he needs rest. Robots are devoid of such shortcomings. But they have their own and among them:

  • due to strict adherence to algorithms, the robot cannot adapt to changing market conditions;
  • the complexity of algorithmic trading itself and high requirements for preparation;
  • errors of the introduced algorithms that the robot itself is not able to detect (this, of course, is already a human factor, but a person can detect and correct his errors, while robots are not yet able to do this).

You should not consider trading robots as the only possible way to make money on trading, because the profitability of automatic trading and manual trading has become almost the same over the past 30 years.

The essence of algorithmic trading

Algo traders (another name – quantum traders) use only the theory of probability that prices fall within the required range. The calculation is based on the previous price series or several financial instruments. The rules will change with changes in market behavior.
Algo trading Algorithmic traders are always looking for market inefficiencies, patterns of recurring quotes in history, and the ability to calculate future recurring quotes. Therefore, the essence of algorithmic trading lies in the rules for choosing open positions and groups of robots. The choice can be:

  • manual – the execution is carried out by the researcher on the basis of mathematical and physical models;
  • automatic – necessary for mass enumeration of rules and tests within the program;
  • genetic – here the rules are developed by a program that has elements of artificial intelligence.

Other ideas and utopias about algorithmic trading are fiction. Even robots cannot “predict” the future with a 100% guarantee. The market cannot be so inefficient that there is a set of rules that apply to robots anytime, anywhere. In large investment companies that use algorithms (for example, Renessaince Technology, Citadel, Virtu), there are hundreds of groups (families) of trading robots covering thousands of instruments. It is this method, which is a diversification of algorithms, that brings them daily profit.

Types of Algorithms

An algorithm is a set of clear instructions designed to perform a specific task. In the financial market, user algorithms are executed by computers. To create a set of rules, data on the price, volume and execution time of future transactions will be used. Algo trading in the stock and currency markets is divided into four main types:

  • Statistical. This method is based on statistical analysis using historical time series to identify trading opportunities.
  • Auto. The purpose of this strategy is to create rules that allow market participants to reduce the riskiness of transactions.
  • Executive. This method was created to perform specific tasks related to opening and closing trade orders.
  • Straight. This technology is aimed at obtaining the maximum speed of access to the market and reducing the cost of entry and connection of algorithmic traders to the trading terminal.

High-frequency algorithmic trading can be singled out as a separate area for mechanized trading. The main feature of this category is the high frequency of order creation: transactions are completed in milliseconds. This approach can provide great benefits, but it also carries certain risks.

Automated Trading: Robots and Expert Advisors

In 1997, analyst Tushar Chand in his book “Beyond Technical Analysis” (originally called “Beyond Technical Analysis”) first described the mechanical trading system (MTS). This system is called a trading robot or an adviser on currency transactions. These are software modules that monitor the market, issue trade orders and control the execution of these orders. There are two types of robot trading programs:

  • automated “from” and “to” – they are able to make independent independent decisions on trading;
  • that give the trader signals to open a deal manually, they themselves do not send orders.

In the case of algorithmic trading, only the 1st type of robot or advisor is considered, and its “super task” is the implementation of those strategies that are not possible when trading manually.

The Renaissance Institutiona Equlties Fund is the largest private fund that uses algorithmic trading. It was opened in the USA by Renaissance Technologies LLC, which was founded in 1982 by James Harris Simons. The Financial Times later called Simons “the smartest billionaire”.

How are trading robots created?

Robots used for algorithmic trading in the stock market are specialized computer programs. Their development begins, first of all, with the appearance of a clear plan for all the tasks that robots will perform, including strategies. The task facing a programmer-trader is to create an algorithm that takes into account his knowledge and personal preferences. Of course, it is necessary to clearly understand in advance all the nuances of the system that automates transactions. Therefore, novice traders are not recommended to create the TC algorithm on their own. For the technical implementation of trading robots, you need to know at least one programming language. Use mql4, Python, C#, C++, Java, R, MathLab to write programs.
Algo trading The ability to program gives traders many advantages:

  • the ability to create databases;
  • launch and test systems;
  • analyze high-frequency strategies;
  • fix errors quickly.

There are many very useful open source libraries and projects for each language. One of the largest algorithmic trading projects is QuantLib, built in C++. If you need to connect directly to Currenex, LMAX, Integral, or other liquidity providers to use high-frequency algorithms, you must be proficient in writing connection APIs in Java. In the absence of programming skills, it is possible to use special algorithmic trading programs to create simple mechanical trading systems. Examples of such platforms:

  • TSLab;
  • whelthlab;
  • Metatrader;
  • S#.Studio;
  • multicharts;
  • tradestation.

Algorithmic trading in the stock market

The stock and futures markets provide ample opportunities for automated systems, but algorithmic trading is more common among large funds than among private investors. There are several types of algorithmic trading in the stock market:

  • A system based on technical analysis. Created to use market inefficiencies and several indicators to identify trends, market movements. Often this strategy is aimed at profiting from the methods of classical technical analysis.
  • Pair and basket trading. The system uses a ratio of two or more instruments (one of them is a “guide”, i.e. first changes occur in it, and then the 2nd and subsequent instruments are pulled up) with a relatively high percentage, but not equal to 1. If the instrument deviates from given route, he will probably return to his group. By tracking this deviation, the algorithm can trade and make a profit for the owner.
  • Marketmaking. This is another strategy whose task is to maintain market liquidity. So that at any time a private trader or a hedge fund could buy or sell a trading instrument. Market makers can even use their profits to meet the demand for various instruments and profit from the exchange. But this does not prevent the use of special strategies based on fast traffic and market data.
  • front running. As part of such a system, tools are used to analyze the volume of transactions and identify large orders. The algorithm takes into account that large orders will hold the price and cause opposite trades to appear in the opposite direction. Due to the speed of analyzing market data in order books and feeds, they will encounter volatility, try to outperform other participants, and accept little volatility when executing very large orders.
  • Arbitration. This is a transaction using financial instruments, the correlation between them is close to one. As a rule, such instruments have the smallest deviations. The system monitors price changes for related instruments and conducts arbitrage operations to equalize prices. Example: 2 different types of shares of the same company are taken, which change synchronously with 100% correlation. Or take the same shares, but in different markets. On one exchange, it will rise / fall a little earlier than on the other. Having “caught” this moment on the 1st, you can open deals on the 2nd.
  • Volatility trading. This is the most complex type of trading, based on buying various types of options and expecting an increase in the volatility of a particular instrument. This algorithmic trading requires a lot of computing power and a team of experts. Here, the best minds analyze various instruments, making predictions about which of them can increase volatility. They put their analysis mechanisms into robots, and they buy options on these instruments at the right time.

Risks of algorithmic trading

The influence of algorithmic trading has increased significantly in recent times. Naturally, new trading methods carry certain risks that were not previously expected. HFT transactions especially come with risks that need to be taken into account.
Algo trading The most dangerous when working with algorithms:

  • Price manipulation. Algorithms can be configured to directly affect individual instruments. The consequences here can be very dangerous. In 2013, on the 1st day of trading on the global BATS market, there was a real drop in the value of the company’s securities. In just 10 seconds, the price dropped from $15 to just a couple of cents. The reason was the activity of the robot, which was deliberately programmed to reduce share prices. This policy can mislead other participants and greatly distort the situation on the exchange.
  • Outflow of working capital. If there is a stressful situation in the market, participants using robots suspend trading. Since most of the orders come from auto-advisers, there is a global outflow, which immediately brings down all quotes. The consequences of such an exchange “swing” can be very serious. Moreover, the outflow of liquidity is causing widespread panic that will exacerbate the difficult situation.
  • Volatility has risen sharply. Sometimes there are unnecessary fluctuations in the value of assets in all world markets. It can be a sharp rise in prices or a catastrophic fall. This situation is called a sudden failure. Often the cause of fluctuations is the behavior of high-frequency robots, because their share of the total number of market participants is very large.
  • Increasing costs. A large number of mechanical consultants need to constantly improve their technical capabilities. As a result, the tariff policy is changing, which, of course, is not to the benefit of traders.
  • operational risk. A large number of simultaneously incoming orders can overload servers of huge capacity. Therefore, sometimes during the peak period of active trading, the system ceases to function, all capital flows are suspended, and participants incur large losses.
  • The level of market predictability decreases. Robots have a significant impact on transaction prices. Because of this, the accuracy of the forecast is reduced and the foundations of basic analysis are undermined. Also auto assistants deprive traditional traders of good prices.

Robots are gradually discrediting ordinary market participants and this leads to a complete rejection of manual operations in the future. The situation will strengthen the position of the system of algorithms, which will lead to an increase in the risks associated with them.

Algorithmic Forex Trading

The growth of algorithmic foreign exchange trading is largely due to the automation of processes and the reduction in the time for conducting foreign exchange transactions using software algorithms. This also reduces operating costs. Forex mainly uses robots based on technical analysis methods. And since the most common terminal is the MetaTrader platform, the MQL programming language provided by the platform developers has become the most common method for writing robots.

Quantitative Trading

Quantitative trading is the direction of trading, the purpose of which is to form a model that describes the dynamics of various financial assets and allows you to make accurate forecasts. Quantity traders, also known as quantum traders, are usually highly educated in their field: economists, mathematicians, programmers. To become a quantum trader, you must at least know the basics of mathematical statistics and econometrics.

High frequency algorithmic trading/HFT trading

This is the most common form of automated trading. A feature of this method is that transactions can be executed at high speed in various instruments, in which the cycle of creating/closing positions is completed within one second.

HFT transactions use the main advantage of computers over humans – mega-high speed.

It is believed that the author of the idea is Stephen Sonson, who, together with D. Whitcomb and D. Hawks, created the world’s first automatic trading device in 1989 (Automatic Trading Desk). Although the formal development of the technology began only in 1998, when the use of electronic platforms on the American exchanges was approved.

Basic principles of HFT trading

This trading is based on the following whales:

  • the use of high-tech systems keeps the period of execution of positions at the level of 1-3 milliseconds;
  • profit from micro-changes in prices and margins;
  • execution of large-scale high-speed transactions and profit at the lowest real level, which is sometimes less than a cent (the potential of HFT is many times greater than traditional strategies);
  • application of all types of arbitrage transactions;
  • transactions are made strictly during the trading day, the volume of transactions of each session can reach tens of thousands.

HFT trading

High Frequency Trading Strategies

Here you can use any algorithmic trading strategy, but at the same time trade at a speed inaccessible to humans. Here are some examples of HFT strategies:

  • Identification of pools with high liquidity. This technology is aimed at detecting hidden (“dark”) or bulk orders by opening small test transactions. The goal is to combat the strong movement generated by volume pools.
  • Creation of the electronic market. In the process of increasing liquidity in the market, profits are realized through trading within the spread. Usually, when trading on the stock exchange, the spread will widen. If the market maker does not have clients who can maintain the balance, then high-frequency traders must use their own funds to cover the supply and demand of the instrument. Exchanges and ECNs will provide discounts on operating expenses as a reward.
  • Frontrunning. The name translates as “run forward.” This strategy is based on the analysis of current buy and sell orders, asset liquidity and average open interest. The essence of this method is to detect large orders and place your own small ones at a slightly higher price. After the order is executed, the algorithm uses the high probability of price fluctuations around another large order to set another higher one.
  • Delayed Arbitration. This strategy takes advantage of active access to exchange data due to geographic proximity to servers or the acquisition of expensive direct connections to major sites. It is often used by traders who rely on currency regulators.
  • Statistical arbitrage. This method of high-frequency trading is based on identifying the correlation of various instruments between platforms or corresponding forms of assets (currency pair futures and their spot counterparties, derivatives and stocks). Such transactions are usually carried out by private banks, investment funds and other licensed dealers.

High-frequency operations are performed in micro volumes, which is compensated by a large number of transactions. In this case, profit and loss are immediately fixed.

Overview of programs for algorithmic traders

There is a small part of the software used for algorithmic trading and robot programming:

  • TSlab. Russian-made C# software. Compatible with most forex and stock brokers. Thanks to a special block diagram, it has a fairly simple and easy-to-learn interface. You can use the program for free to test and optimize the system, but for real transactions you will need to purchase a subscription.
  • WealthLab. A program used to develop algorithms in C#. With it, you can use the Wealth Script library to write algorithmic trading software, which greatly simplifies the coding process. You can also connect quotes from various sources to the program. In addition to backtesting, real transactions can also take place in the financial market.
  • r studio. More advanced program for quants (not suitable for beginners). The software integrates several languages, one of which uses a special R language for data and time series processing. Algorithms and interfaces are created here, tests and optimization are carried out, statistics and other data can be obtained. R Studio is free, but it’s pretty serious. The program uses various built-in libraries, testers, models, etc.

Strategies for algorithmic trading

Algo trading has the following strategies:

  • TWAP. This algorithm regularly opens orders at the best bid or offer price.
  • execution strategy.  The algorithm requires large purchases of assets at weighted average prices, usually used by large participants (hedge funds and brokers).
  • VWAP. The algorithm is used to open positions in an equal part of a given volume within a certain period of time, and the price should not be higher than the weighted average price at launch.
  • data mining. It is a search for new patterns for new algorithms. Before the start of the test, more than 75% of production dates were data collection. Search results depend only on professional and detailed methods. The search itself is configured manually using various algorithms.
  • iceberg. Used to place orders, the total number of which does not exceed the number specified in the parameters. On many exchanges, this algorithm is built into the core of the system, and it allows you to specify the volume in the order parameters.
  • speculative strategy. This is a standard model for private traders who seeks to get the best possible price for trading with the aim of making a subsequent profit.

Strategies for algorithmic trading

Training and books on algorithmic trading

You won’t get that kind of knowledge in school circles. This is a very narrow and specific area. It is difficult to single out really reliable studies here, but if we generalize, then the following key knowledge is needed to engage in algorithmic trading:

  • mathematical as well as economic models;
  • programming languages ​​— Python, С++, MQL4 (for Forex);
  • information about contracts on the exchange and features of instruments (options, futures, etc.).

This direction will have to be mastered mainly on your own. For reading educational literature on this topic, you can consider books:

  • “Quantum Trading” and “Algorithmic Trading” – Ernest Chen;
  • “Algorithmic trading and direct access to the exchange” – Barry Johnsen;
  • “Methods and algorithms of financial mathematics” – Lyu Yu-Dau;
  • “Inside the black box” – Rishi K. Narang;
  • “Trade and exchanges: the microstructure of the market for practitioners” – Larry Harris.

The most productive way to start the learning process is to learn the basics of stock trading and technical analysis, and then buy books on algorithmic trading. It should also be noted that most professional publications can only be found in English.

In addition to books with a bias, it will also be useful to read any exchange literature.

Famous myths about algorithmic trading

Many believe that using robot trading can only be profitable and traders don’t have to do anything at all. Of course not. It is always necessary to monitor the robot, optimize it and control it so that errors and failures do not occur. Some people think robots can’t make money. These are people who, most likely, have previously encountered low-quality robots sold by scammers for foreign exchange transactions. There are quality robots in currency trading that can make money. But no one will sell them, because they already bring good money. Trading on the stock exchange has a huge potential for earning. Algorithmic trading is a real breakthrough in the field of investing. Robots are taking over almost every day-to-day task that used to take a lot of time.

opexflow
Rate author
Add a comment