Algorithmic trading in the stock market in Russia: trends and technologies
Not so long ago, the publication about the stock market Market Lab published an interview with Yuri Maslov, who at ITinvest is developing the infrastructure for working on the exchange using trading robots. In a blog on Habré we publish excerpts from this conversation, devoted to answers to frequently asked questions regarding technologies used in the stock market in Russia.
Advantages of Algorithmic Trading
The increase in the number of traders using special robots to trade on the exchange is a global trend. Not everyone is happy with this fact, many consider algorithmic trading to be harmful speculation, but it helps maintain liquidity in the markets. The number of high-frequency traders (HFT) and their influence on the market is determined by general market laws - we wrote about this in a topic devoted to the prospects of algorithmic trading in Russia:
In addition, the use of technology in trade allows you to get rid of one of the main problems that arise when working in the financial market - the predominance of emotions over the mind, which can lead to errors and loss of money. In addition, the situation on the stock market often changes so rapidly that a person may not have time to react to it - the robot is not so slow.
For example, a long time ago, in 2002-2003. people traded Gazprom’s simple tough arbitrage against Gazprom futures. Received insane interest in per annum. But in 2008, this niche was already entirely occupied by algorithms. After September 2011, this niche was completely occupied by high-frequency algorithms.
How much money is needed to trade a robot
Trading strategies can also be algorithmic if there is not a very large amount of funds for trading on the exchange. In this case, you must be aware that there are various areas of algorithmic trading. There are varieties of it that do not have a high speed requirement - for example, intelligent strategies that benefit from understanding the market. If you need high-frequency trading (strategies that overtake everyone on the market) or the use of microstructural models is supposed, then the entrance ticket is more expensive, since you need serious infrastructure, the cost of supporting it.
Before rushing into battle on the real market, you need to teststrategy and calculate its profitability (in principle, this can be done even in MS Excel). This profitability should, ideally, cover the costs of developing and maintaining a trading robot - payment for the services of a programmer or, in case of independent development, time costs.
There are people on the market who started with 100 thousand rubles. Maybe they just started at a better time. Today, the amount from 500 thousand rubles to 1 million rubles is an input threshold at which it is already possible to start working with algorithmic strategies. At the same time, there are convenient tools with which you can algorithmize the strategy for 20 thousand rubles. There are more and more of them on the market. They allow you to make algorithms without significant development costs.
Read also: “ Interview: how C # and C ++ help make money in the stock market ”
These include TS Lab systems or Cofite products . There are more and more such solutions - their essence lies in the use of scripting languages that simplify development over time. They are “sharpened” for the rapid implementation of algorithms. An example of such a scripting language is TradeScript, created by Americans from Modulus Financial Engineering. This technology has been licensed (OEM) to create the SmartX terminal . This language is very simple and allows you to describe a trading strategy in a short time, just by familiarizing yourself with the manual (or publications on the Habré - one , two )
Round trip applications
The speed of the trading robot depends on various factors. One of the most important is the data transfer protocol used.
Take the protocols that are used to work with the Moscow Exchange on the spot market. There are different connection methods: the “native” exchange protocol, it is also called native , FIX-connection and work through a broker trading system. People who try to be the first in the glasses use the FIX connection, less often the native protocol.
When connecting through a brokerage system, the speed is usually lower. If we talk about FIX on the MICEX stock market, then the round trip, in the exchange part, is about 300-350 microseconds, the full application path, given the delay in communication channels and on client equipment, can be expressed in significantly larger values.
These numbers are the same for all brokers, they depend more on the quality of the channel to the exchange, the installed equipment and the speed of processing the application in the core. In the case of using the “native” exchange protocol TEAP, the typical delay is higher and ranges from 420 μs.
The time for submitting applications passing through the ITinvest trading system (from the moment when it is received from the client to the gateway, to the moment when the client is given an answer to it - you must understand that when working through the Internet there can be unpredictable delays in the section from broker gateway to client equipment) is from 1.5 to 2.5ms. At the same time, there is a solution for high-frequency traders, which involves working on the FIX protocol and connecting to ITinvest risk management servers. Risk control takes a few microseconds and they are invisible in the total number of exchange round trips.
Experience shows that universal processors are the best technological solution for creating trading robots on the Russian market. The range of application of various solutions is limited - you can build a quick strategy on FPGA, but for complex calculations it is better to use a universal processor. GPUs have their drawbacks, for example, slow memory and high power consumption. Optimizing the robot for a universal processor in the local market is currently the leading solution.
As for operating systems, the more people want performance, the more they are interested in using Linux. If there is some kind of working business idea, then increasing speed can allow you to earn more. But the cost of developing and using a high-class programmer may not recoup these costs. In principle, fairly fast solutions can be created on Windows. Linux is good because it is customized to meet the needs of the user-trader - new kernels with new chips come out. Windows is more conservative in these matters.
Recently, C # has been popular. It is very simple to develop, and a person who does not even have a specialized education and has only basic development skills can master C # and write a robot algorithm. For more serious developments in the financial market, C and C ++ are used, which allow you to get an acceptable speed at optimal cost (in severe cases, it comes to Assembler). Beginning stock market developers usually use C #.
Do I need to use boxed products to create robots
On the one hand, the plus of such solutions is that they save development time. On the other hand, it’s a “black box” with its own logic, and it’s really difficult to sort out some products without consulting their creators. But the fact that they facilitate the development of trading robots is undeniable. Most brokers have a convenient interface that allows you to quickly and conveniently write an application. For example, ITinvest has a SmartCom API .
His manual contains examples, and a person who owns C # will be able to write his robot quickly enough. At the same time, high-frequency traders almost always write trading systems for themselves - this method allows you to get a unique product and expect more profit in the market.
That's all for today, thank you all for your attention. We would also like to ask Habr users what topics they would be interested in reading about the stock market. Applications and questions are accepted in the comments!
PS If you notice a typo or mistake - write in a personal message, and we will quickly fix it.
Related posts and links:
Only registered users can participate in the survey. Please come in.
What financial topics would you like to read on Habré?
- 70.8% Trading Robot Technology 107
- 52.9% Cases of creating mechanical trading systems with code and results 80
- 50.9% Theory of financial preservation and asset management (in particular, specifically for IT professionals) 77
- 20.5% The history of the creation of exchange platforms and the evolution of trading technologies 31
- 3.3% Something else (I will indicate in the comments) 5