📜 ⬆️ ⬇️

Algorithmic trading on the stock market in Russia: trends and technologies

image

Not so long ago, the publication on the stock market Market Lab published an interview with Yuri Maslov, who at ITinvest is developing the infrastructure for working on the stock exchange with the help of trading robots. In a blog on Habré, we publish excerpts from this conversation on answers to frequently asked questions about the technologies used in the stock market in Russia.

Advantages of algorithmic trading


The increase in the number of traders who use special robots for trading on the stock exchange is a global trend. Not everyone is happy with this fact, many consider algorithmic trading to be harmful speculation, but it allows them to 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 it in the topic devoted to the prospects of algorithmic trading in Russia:
')
image

In addition, the use of technology in the trade allows you to get rid of one of the main problems encountered when working in the financial market - the predominance of emotions over the mind, which can lead to errors and loss of money. In addition, often the situation in the stock market is changing so rapidly that a person may not have time to react to it - the robot is not so slow.

For example, long ago, in 2002-2003. people traded simple hard arbitration Gazprom against Gazprom futures with their hands. Received insane interest per annum. But in 2008, this niche was already completely occupied by algorithms. After September 2011, this niche was fully occupied by high-frequency algorithms.

How much money is needed to trade the robot


Algorithmizing trading strategies is possible even if there is not a very large amount of funds for trading on the exchange. At the same time, it is necessary to realize that there are various spheres of algorithmic trading. There are variations of it that do not impose an increased demand for speed — for example, intellectual strategies that benefit from an understanding of the market. If you need high-frequency trading (strategies that outperform everyone in the market) or use microstructural models, then an entrance ticket costs more because it requires a serious infrastructure, the cost of supporting it.

image

Yury Maslov

Before rushing into battle for the real market, it is necessary to test the strategy and calculate its profitability (in principle, this can be done even in MS Excel). This profitability should, ideally, cover the cost of developing and maintaining a trading robot - payment for a programmer’s services or, if developed independently, time costs.

There are people on the market who started with 100 thousand rubles. Maybe they just started at a better time. Today, an amount from 500 thousand rubles to 1 million rubles is an input threshold where it is already possible to begin working with algorithmic strategies. At the same time, there are convenient tools with which you can algorithmize a strategy even for 20 thousand rubles. There are more of them on the market. They allow you to make algorithms without significant development costs.

See also: " Interview: how C # and C ++ help make money on the stock market "

These solutions 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 the development over time. They are "sharpened" by the rapid implementation of algorithms. An example of such a scripting language is TradeScript, created by the Americans from Modulus Financial Engineering. This technology has been licensed (OEM) to create a SmartX terminal. This language is very simple and allows you to describe a trading strategy in a short time, just by reading the manual (or publications on Habré - one , two )

Round trip tickets


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 ways to connect: the “native” exchange protocol, it is also called the native , FIX-connection and work through a brokerage trading system. People who are trying to be the first in the "glasses" use the FIX-connection, less often - the native protocol.

When connecting through the brokerage system, the speed is usually lower. If we talk about FIX on the MICEX stock market, then the roundtrip, in the exchange part, is about 300-350 microseconds, the full path of the application, taking into account the delay of communication channels and on the client equipment, can be expressed in significantly larger values.

image

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 TEAP protocol , the typical delay is higher and ranges from 420 µs.

The time for issuing orders passing through the ITinvest trading system (from the moment when it is received from the client to the gateway (gateway), to the moment when the client responds to it - it is necessary to understand that when working via the Internet there can be unpredictable delays in the area from gateway broker to the client equipment) ranges from 1.5 to 2.5 ms. 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. The control of risks takes a few microseconds and is not visible in the total number of the exchange roundtrip.

Development technologies


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 - on the FPGA, you can build a fast strategy, but for complex calculations it is better to use a universal processor. Graphic processors have their drawbacks, for example, slow work with 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 a person wants performance, the more he is interested in using Linux. If there is any working business idea, then increasing the speed can afford to earn more. But the cost of developing and using a high-class programmer may not pay for these costs. In principle, fairly quick solutions can be created on Windows. Linux is good because it is customized for the emerging needs of the user-trader - new kernels come out with new features. Windows is more conservative in these matters.

Recently popular is C #. It is very simple to develop, and a person, even without a specialized education and possessing 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 make it possible to obtain an acceptable speed at optimum costs (in severe cases, it comes to the Assembler). Novice exchange software developers typically use C #.

Do I need to use boxed products to create robots


On the one hand, plus such solutions is that they save development time. On the other hand, this is a “black box” with its own logic, and it is indeed difficult to sort out some products without consulting with 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 fairly quickly. At the same time, high-frequency merchants almost always write trading systems for themselves - this method allows you to get a unique product and expect a greater gain in the market.

That's all for today, thank you all for your attention. We would also like to ask Habr's users about what topics related to the stock market they would be interested to read. Applications and questions are accepted in the comments!

PS If you notice a typo or mistake - write a personal message, and we will fix everything promptly.

Posts and related links:

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


All Articles