The modern economy is unthinkable without exchanges and the stock market. Trading on these sites is called
trading . Traders actively use the possibilities of computer technology to facilitate the conduct of their business. Trading using mathematical models and computer technology is called algorithmic trading. This article talks about this type of trading in the financial markets, its varieties, the methods used, the advantages and disadvantages, the software used.
- What is Algorithmic trading (algorithmic trading)
- What is the essence of algorithmic trading?
- What types of algorithmic trading exist?
- When and how did algorithmic trading appear, as a phenomenon
- How is algorithmic trading different from algorithmic trading?
- What software is suitable for algorithmic trading?
- What should be remembered before doing algorithmic trading?
- TSLab is one of the most popular programs for running algorithmbots.
- Installation
- Training in algorithmic trading at TSLab
- Supplier setup
- Creating a script
- stocksharp
- WealthLab
- What strategies are used for algorithmic trading?
- How to prevent losses when doing algorithmic trading, risk management
- Algo trading: advantages and disadvantages
What is Algorithmic trading (algorithmic trading)
The term “algorithmic trading” or “algorithmic trading” has two meanings. In the first case, this word means a method of executing a large order on the market, according to which it is opened gradually according to certain rules and is automatically divided into several sub-orders, which have their own price and volume. Each order is sent to the market for execution. The purpose of the technology is to make it easier for traders to make large trades that need to be done in the least noticeable way possible. For example, you need to purchase 200,000 shares, and each position includes 4 shares at a time.
The second meaning of this word is a system that opens orders according to a given algorithm without the participation of a trader. Algorithms are set in order to directly profit from automatic market analysis. These systems are also called ”
trading robot “. Algorithmic trading and algorithmic trading are used on exchanges, including cryptocurrency exchanges, and Forex.
What is the essence of algorithmic trading?
Algo trading involves collecting data on a specific asset based on the history of its development, selecting algorithms for transactions and suitable trading robots. To determine the price, the theory of probability is applied, market shortcomings and the likelihood of their recurrence in the future are determined. There are three types of selection. With a manual approach, the specialist applies mathematical formulas and physical models. The genetic approach involves the development of rules by computer systems and artificial intelligence. Automatic is produced by a special computer program that processes arrays of rules and tests them.
What types of algorithmic trading exist?
Algorithmic trading is implemented in several main areas:
- Technical Analysis . Using market inefficiency and identifying current trends through classical mathematical and physical analysis.
- Market making . This method maintains market liquidity. Market makers are rewarded by the exchange by satisfying demand, including against profit. The strategy is based on accounting and the rapid flow of information from the markets.
- Front running . Analysis of the volume of orders by instrument and selection of the largest of them. This strategy is based on the fact that a large order will have a large price and will attract many counter orders. Algorithms analyze tape and order book data and try to fix movements during large transactions faster than other participants.
- Pairs and Basket Trading . Two or more instruments are correlated with a high, but not one-to-one, correlation. The deviation of one of the instruments from the given course means that it is more likely to return to its group. Determining the correlation helps to make a profitable trade.
- Arbitration . The method is based on comparing assets with similar price dynamics. This similarity is sometimes violated due to various factors. The essence of arbitrage is the sale of a more expensive asset and the purchase of a cheaper one. As a result, the assets will equalize in price, and the cheaper asset will increase in price. Algorithmic trading systems detect price changes in the market and make profitable arbitrage deals.
- Volatility trading . A complex type of trading, which consists in buying various options. The trader expects the volatility of the stock to increase when selling and decrease when buying. This type of trade requires significant equipment capacity and qualified specialists.
Working strategies in algorithmic trading, the whole truth about robot trading: https://youtu.be/eg3s0c_X_ao
When and how did algorithmic trading appear, as a phenomenon
Algorithmic trading was developed in the early 1970s with the creation of the NASDAQ, the first exchange to use computer trading. In those days, algorithmic trading was available only to large investors, ordinary people did not have access to such technology. Computers were not perfect then, and in 1987 there was a hardware error that led to the collapse of the American market. In 1998, the SEC – the US Securities Commission officially allowed the use of electronic trading platforms. This year should be considered the date of the appearance of algorithmic trading in its modern form.In the early 2000s, transactions using computers were carried out in a few seconds. But the share of robots in the market was less than 90%. By 2009, orders on exchanges were completed in milliseconds, and
trading robots carried out 60% of transactions. After 2012, the situation has changed. The unpredictability of the market led to failures in the then existing software. The percentage of trades executed automatically has been reduced to 50% of the total. In order to avoid mistakes, the development and implementation of artificial intelligence has begun.
How is algorithmic trading different from algorithmic trading?
Despite the apparent similarity of the concepts, one should distinguish between the concepts of “algorithmic trading” and “algorithmic trading”. In the first case, the method of executing a large order by dividing it into parts and then submitting it according to certain rules is implied, and in the second case, they talk about an automated system that creates orders without a trader according to a certain algorithm. Algorithms in algorithmic trading are used to simplify the execution of large transactions by a trader. In algorithmic trading, they are used to analyze the market and open positions to increase income.
What software is suitable for algorithmic trading?
Since algorithmic trading involves the use of computer technology, you need to choose the right software. A trading robot is the main tool for practicing automated trading. You can either develop it yourself using
programming languages , or use the platform to create it.
What should be remembered before doing algorithmic trading?
First, it is worth mentioning that an algo trader needs to be able to program, because most platforms can be mastered by mastering this skill. The programming language used for algorithmic trading must be compatible with all platforms and algorithms being developed. The most suitable programming language is C# (C-sharp). It is used in platforms such as TSLab, StockSharp, WealthLab. Without knowing the programming language, the last 2 programs will have to be mastered for several months.
TSLab is one of the most popular programs for running algorithmbots.
A platform for creating, testing and launching
trading robots and systems. Includes a convenient visual editor in the form of cubes, which will allow you to develop a robot without knowing a programming language. You can assemble the desired trading algorithm from the cubes. The history of trading instruments collected by the program will allow you to find and correct errors in scripts, while technical analysis tools will help you create a unique solution.
Installation
To install the platform, you need to download the installer from the official website. The download page states that the program only works on 64-bit versions of Windows. After downloading, open the installation file. Before installing, it will prompt you to install the latest version of the .NET Framework and Visual C++ Redistributable Studio.
If the necessary versions of these programs are not available, you should install them. The platform will not work without them. If the latest versions of these programs are available, the installer’s start window will open. Let’s click “Next”.
We agree with the terms of the license agreement and choose the path where the program will be installed.
Then you should give permission for the installation and wait for it to complete.
When the installation is completed, a corresponding window will open. You can run the program after installation.
Training in algorithmic trading at TSLab
Supplier setup
To set up and test a trading robot, you need to have a history of quotes. To get the history of quotes, you need to set up a data provider. In the “Data” menu, select the “Suppliers” item.
An empty vendors tab will open. We need to click the “Add” button. In the dialog box that opens, select “Historical Data”. At this stage, you need to select the data type for quotes. In this case, a text file with quotes with a price step of 0.01 is selected. Download the required file from the repository.
Download the file 1.rand.quote.step=0.01_1m.txt.zip. Once downloaded, find the file in the download folder and extract it from the archive. We return to TSLab and select the “Suppliers” item in the “Data” menu.
The corresponding window will open. You need to click on the “Add” button.
The Add Supplier window will open. In it, select the item “Historical data”, and then click “Next”.
In the next window, specify the name and data type of the provider. Set the name to TextData and the data type to Text Files. We press “Next”.
Choose the path to the supplier. The default path is C:ProgramDataTSLabTSLab 2.1ProvidersText. You can specify a different path by clicking … in the path bar. We set the path of our file, after which we set the parameters: 1. The number of decimal places is 2. 2. The price step is determined automatically if it is less than 1. A file with a step of 0.01 and specifying 1 sign in the settings will select a step of 0.1
Press to the “Next” button. In the Providers window, the TextData data provider will become visible.
Creating a script
The TSLab platform allows you to develop trading algorithms, test and create trading robots – agents. But before creating a trading algorithm, you need to write a script for it. To do this, select “Lab” in the menu. Select “Scripts” from the drop-down list.
A dialog box will open, in which we click “Create New”. In the second window, enter the name of the script and click “OK”.
Double-click the left mouse button on the created script for editing. We will see a visual script editor.
The blue rectangular block is the “traded instrument”. Gray rectangle “Volume 1” – the number of operations with options or futures contracts for a certain period of time. Block “Closing” reflects the closing price of the bar. The “Chart panel” block creates the corresponding panel.
Right click. Select “Properties” from the drop-down menu. Select the Script tab.
Disable “Use date from”. Select the “Sources” tab, and in it – the tool. Click on this field. The “Select securities” window will open, in which you will need to select the TextData data provider and specify the instrument – quotes of the text file 1.rand.quote.step=0.01_1m. Click “OK” to confirm.
After selecting the tool, a tab with a picture of the chart and the inscription “Loading” will appear at the top of the window. After processing the data, the name of the selected instrument will appear on this tab – 1.rand.quote.step=0.01_1m
Click “Save and execute” after loading the data.
This script is designed to display the instrument on the chart. Finally, a graph tab will open. Trading algorithms and trading agents are set up in a similar way. As you can see, algorithmic trading with the help of TSLab is available to almost everyone and does not require prior training. The main advantage of TSLab is that any user can start compiling trading robots after 2-3 days of studying the platform. This is facilitated by the visual editor. With the help of the editor, you will learn the necessary thinking necessary in algorithmic trading. TSLab supports the C# language, further programming on this platform can be continued using the TSLab API. However, further immersion in algorithmic trading is better to continue with more complex programs.
stocksharp
Stocksharp is a library of trading robots written in C#. Trading robots are compiled in the Visual Studio programming environment. Therefore, before writing a robot using this resource, you will need to spend at least six months learning a programming language. Not everyone is able to complete the study to the end. However, the use of this platform is fully justified in practice.
WealthLab
WealthLab is another platform for testing and developing trading robots and systems from Fidelity. There are two versions of the program: Pro for US citizens with a Fidelity account, and Developer for everyone else. WealthLab allows you to use technical analysis tools in the development of robots, receive signals to enter and close a deal and transfer them to the terminal. If a trader does not know how to program, he can use an assistant (wizard). The platform is based on C# and Pascal programming languages. The platform draws charts in the form of segments, Japanese candlesticks, line charts, etc.
The main function of the program is optimization and testing of strategies based on historical data. WealthLab can be learned not as fast as TSLab, but in just 2 months. The built-in programming language gives great opportunities in creating profitable trading strategies. A trader can link the platform with the Quik software package, which will allow placing orders offline.
What strategies are used for algorithmic trading?
For trading using algorithms to bring tangible results, you need to stick to a strategy designed for a specific situation.
- Speculative Strategy . It is aimed at achieving the most favorable price for entering a transaction for subsequent profit. Used mainly by private traders.
- data mining . Finding new patterns for new algorithms. Most of the data is collected on this strategy prior to testing. Information is searched for by manual settings.
- TWAP is the time-weighted average price. Opening orders in equal time intervals at the best bid and offer prices.
- VWAP – volume-weighted average price. Opening a position in equal parts with the same volume for a certain time and prices not higher than the average value.
- Execution strategy . A strategy used to acquire an asset at a weighted average price in large volume. Mainly used by brokers and hedge funds.
How to prevent losses when doing algorithmic trading, risk management
It is a big mistake to believe that an algorithmic trader only needs to create a trading robot. All risks must be prevented and eliminated. Interruptions in electricity, Internet connection and errors in calculations and programming can lead to significant losses and completely deprive you of income.An infrastructure server where algorithmic trading is carried out may suddenly fail or the operating system may reboot on it. To eliminate problems with the server, you can rent a server or raise your own. If this is not available, you need to pick up a server from a stable provider with a good connection. The system should have a minimum power margin of 40-50%. Connection problems always happen unexpectedly. You can configure the connection so that the exchange closes positions after the connection is lost. Data packet corruption is tracked through WatchDog tracking algorithms. Trading strategies used in trading are imperfect and their combination can lead to completely different consequences. In applications, API errors may be made.The price, volume, value of lots may be displayed incorrectly. Also, trades can be held on weekends or holidays, trading strategy or account limits are violated.
To eliminate these errors, it is necessary to monitor and analyze orders and limits of trading strategies in order to eliminate erroneous parameters.
In the event of an emergency situation, it is necessary to immediately inform all interested parties about this via SMS, e-mail, instant messengers and other communication channels. It is imperative to record each failure in the logs in order to prevent its repetition in the future. How to create passive income with algorithmic trading: https://youtu.be/UeUANvatDdo
Algo trading: advantages and disadvantages
Trading robots are not subject to “human” factors that could affect their work: fatigue, emotional breakdowns, and others. This is the main advantage of algorithmic trading. Algorithms follow a well-defined program and never deviate from it. Algo trading has a number of disadvantages. These include, in particular, the inaccessibility of information on this type of trade in the public domain. An algorithmic trader must be proficient in programming, which is quite difficult for most financial professionals. If the market changes, you will have to completely change the algorithm. In writing a trading robot, a mistake can be made that will lead the entire algorithm down the wrong path, and this will lead to a loss of funds.
Algorithmic trading is a rather complicated type of exchange trading that requires knowledge not only in trading, but also in mathematics and programming. It is necessary not only to be able to create the desired algorithm, but also to prevent connection problems, errors in algorithms and program code. You need to think carefully before deciding to trade in this way. Nevertheless, having mastered it and applied it correctly in practice, the trader will receive a significant increase in income and make his work easier.