Algo trading: its essence, trading strategies and risks

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

Currently, most of the 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 takes advantage of its main advantage – speed. Algorithmic trading has two main definitions:

  • Algo trading. An autosystem that can trade without a trader in a given algorithm. The system is necessary to generate direct profit through market autoanalysis and opening positions. This algorithm is also called a “trading robot” or “advisor”.
  • 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 you have a task to buy 100 thousand shares, and you need to simultaneously open positions for 1-3 shares, without attracting attention in the order feed.

Simplified, algorithmic trading is the automation of day-to-day operations performed by traders, which reduces the time it takes to analyze stock information, calculate mathematical models, and execute 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 for algorithmic trading (it appeared concurrently with the first automated 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 that 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 execution of applications was reduced several times, reaching several milliseconds. The share of sales assistants rose sharply to 60%.
  • 2012 and beyond. The unpredictability of events on 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.

High-frequency trading is still relevant today. 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 human intuition. This is especially true when the volatility of the stock exchange rises strongly due to the publication of significant international economic news. Relying on robots is strongly discouraged during this period.

Advantages and disadvantages of algorithmic trading

The advantages of the algorithm are all the disadvantages of manual trading. A person is easily influenced by emotions, but robots are not. The robot will trade strictly according to the algorithm. If the deal can be profitable 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 he needs rest from time to time. Robots do not have such disadvantages. 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 the algorithmic trading itself and high requirements for preparation;
  • errors of the introduced algorithms, which the robot itself is not able to detect (this, of course, is already a human factor, but a person can detect and correct his mistakes, but robots cannot do this yet).

You should not consider trading robots as the only possible way to make money on trading, since 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 (also called quantum traders) use only the theory of the 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 tradingAlgorithmic traders are always looking for market inefficiencies, recurring quote patterns 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 implementation is carried out by the researcher on the basis of mathematical and physical models;
  • automatic – it is 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. Large investment companies using algorithms (for example, Renessaince Technology, Citadel, Virtu) have 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.

Algorithm types

An algorithm is a set of clear instructions designed to perform a specific task. In the financial market, users’ 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 foreign exchange 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 is designed to perform specific tasks related to the opening and closing of trade orders.
  • Straight. This technology aims to maximize the speed of market access and reduce the cost of entering and connecting algorithmic traders to the trading terminal.

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

Automated trading: robots and advisors

In 1997, analyst Tushar Chand, in his book Beyond Technical Analysis (originally called Beyond Technical Analysis), first described a mechanical trading system (MTS). This system is called a trading robot or a currency advisor. 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;
  • giving signals to the trader 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 United States 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?

The robots used for algorithmic trading in the stock market are specialized computer programs. Their development begins, first of all, with the emergence of a clear plan of all tasks that robots will perform, including strategies. The challenge facing the trader programmer 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, it is not recommended for novice traders to create a TC algorithm on their own. For the technical implementation of trading robots, you need to know at least one programming language. To write programs, use mql4, Python, C #, C ++, Java, R, MathLab.
Algo tradingThe ability to program gives traders many benefits:

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

There are many very useful open source libraries and projects for each language. One of the largest algorithmic trading projects is QuantLib, created in C ++. If you need to connect directly to Currenex, LMAX, Integral, or other liquidity providers to use high frequency algorithms, you must master the skills of writing Java connection APIs. 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 stock market trading

The stock and derivatives 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. Designed to take advantage of market inefficiencies and multiple indicators to identify trends, market movements. Often, this strategy is aimed at making a profit from the methods of classical technical analysis.
  • Pair and basketball trading. The system uses the ratio of two or more instruments (one of them is a “guide”, ie first changes occur in it, and then the 2nd and subsequent instruments are pulled) 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 generate profits for the owner.
  • Market making. This is another strategy that aims to maintain market liquidity. So that at any time a private trader or hedge fund can 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. Within the framework 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 face volatility, try to outperform other participants, and accept little volatility when filling 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 linked instruments and conducts arbitrage transactions that equalize prices. Example: 2 different types of shares of the same company are taken, which change synchronously with 100% correlation. Or the same shares are taken, 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.
  • Trading on volatility. This is the most difficult 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 may increase volatility. They put their analysis mechanisms into robots, and they buy options for these instruments at the right time.

Algorithmic trading risks

The influence of algorithmic trading has grown significantly in recent times. Naturally, new trading methods carry certain risks that were not previously expected. HFT transactions are particularly fraught with risks that need to be considered.
Algo tradingThe most dangerous thing when working with algorithms:

  • Price manipulation. You can customize algorithms to directly affect individual instruments. The consequences here can be very dangerous. In 2013, on the first 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 a robot that was deliberately programmed to reduce stock prices. This policy can mislead other participants and greatly distort the situation on the exchange.
  • Outflow of working capital. If the market is under stress, participants using robots suspend trading. Since most of the orders come from auto advisors, there is a global outflow that immediately crashes all quotes. The consequences of such an exchange “swing” can be very serious. Moreover, the outflow of liquidity is causing widespread panic, which will exacerbate the difficult situation.
  • Volatility has sharply increased. Sometimes there are unnecessary fluctuations in asset values ​​in all of the world’s markets. This can be a sharp rise in prices or a catastrophic fall. This situation is called flash crash. Often the reason for fluctuations is the behavior of high-frequency robots, because their share of the total number of market participants is very large.
  • Increased 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 good for traders.
  • Operational risk. A large number of simultaneously incoming orders can overload servers of enormous 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 predictability of the market decreases. Robots have a significant impact on transaction prices. This reduces the accuracy of the forecast and undermines the foundations of the underlying analysis. Also, auto-helpers rob 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 a 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 trade, the purpose of which is to form a model that describes the dynamics of various financial assets and allows you to make accurate predictions. Quantitative traders, also known as quantum traders, are usually highly educated specialists 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 performed at high speed in various instruments, in which the cycle of creating / closing positions is completed within one second.

HFT transactions take advantage of 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. Hawkes, created the world’s first automatic trading device in 1989 (Automatic Trading Desk). Although the formal development of technology began only in 1998, when the use of electronic platforms on 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;
  • profits from micro-changes in prices and margins;
  • execution of large-scale high-speed transactions and making a profit at the lowest real level, which is sometimes less than a cent (the potential of HFT is many times higher than traditional strategies);
  • the use of all types of arbitration transactions;
  • transactions are made strictly during the trading day, the volume of transactions for each session can reach tens of thousands.

HFT trading

High frequency trading strategies

Any algorithmic trading strategy can be used here, but at the same time trade at a speed beyond the reach of humans. Here are some HFT strategies for example:

  • 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 created by the volumetric pools.
  • Creation of an electronic market. In the process of increasing liquidity in the market, profit is realized through trading within the spread. Usually, when trading on an exchange, the spread will widen. If the market maker does not have clients who can maintain a balance, then high-frequency traders must use their own funds to close the supply and demand of the instrument. Exchanges and ECNs will provide discounts on operating expenses as a reward.
  • Front running. The name translates as “run ahead”. 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 fluctuations in quotes around another large order in order to place another higher one.
  • Deferred Arbitration. This strategy takes advantage of active access to stock data through geographic proximity to servers or the acquisition of expensive direct connections to major sites. It is often used by traders who rely on foreign exchange regulators.
  • Statistical arbitration. This method of high-frequency trading is based on identifying the correlation of various instruments between sites or the corresponding forms of assets (futures for currency pairs and their spot counterparties, derivatives and stocks). These transactions are usually conducted by private banks, investment funds and other licensed dealers.

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

Review of programs for algorithmic traders

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

  • TSLab. Russian-made C # software. Compatible with most foreign exchange 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 its help, you can use the Wealth Script library to write algorithmic trading software, which greatly simplifies the coding process. You can also connect quotes from different sources to the program. In addition to backtesting, real transactions can also take place in the financial market.
  • R Studio. More advanced program for quanta (not suitable for beginners). The software combines several languages, one of which uses a dedicated R language for data and time series processing. Algorithms and interfaces are created here, tests are carried out, optimization, statistics and other data can be obtained. R Studio is free, but pretty serious. The program uses various built-in libraries, testers, models, etc.

Strategies for algorithmic trading

Algotrading has the following strategies:

  • TWAP. This algorithm regularly opens orders at the best bid or ask 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 for 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 the mining dates were for data collection. Search results only depend on professional and detailed methods. The search itself is configured manually using various algorithms.
  • Iceberg. Used to place orders, the total quantity of which does not exceed the quantity 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 the standard model for traders seeking the best possible price to trade with in order to generate subsequent profits.

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 to summarize, 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.).

You will have to master this direction 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 Exchange Access – Barry Johnsen;
  • “Methods and algorithms of financial mathematics” – Luu Yu-Dau;
  • “Inside the Black Box” – Rishi K. Narang;
  • Trading and Exchanges: Market Microstructure for Practitioners – Larry Harris.

It is most productive to start the learning process by learning the basics of stock trading and technical analysis, and then buying 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 stock literature.

Famous myths about algorithmic trading

Many people believe that using robot trading can only be profitable and traders do not need 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 that robots cannot make money. These are people who, most likely, have previously encountered low-quality robots sold by fraudsters for currency 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 investment. Robots take on almost all day-to-day tasks that used to take a long time.

Поделиться ссылкой:

Rate this post
Rate author
Programming, investment and algorithmic trading
Add a comment