
One of the most popular topics on our blog was the story of Jesse Spalding - a guy who earned $ 500k in the stock market by applying his knowledge of programming and understanding the basics of the stock market (
part 1 ,
part 2 ). In the comments to these texts, some habra users expressed their doubts about the realism of such a scenario in our country. Also heard phrases like "well, he used to work in this area."
In this regard, the editors of the ITinvest blog talked with Andrey Gorkovenko, a developer who repeated the path of Jesse Spalding and managed to turn his life around with the help of the stock market and technological knowledge. With this text we open the cycle of interviews with direct participants in the processes on the Russian stock market - software developers, traders and company executives.
Note: Andrey Gorkovenko used to work as a programmer at ITinvest. In particular, he worked on the project of the SmartX trading terminal (the history of its creation is described in a separate habratopic). Later, he created a universal mechanical trading system, with which you can implement various strategies for trading in the stock market. This development brings him the main income that exceeds the average salary of a developer in Moscow.')
Andrew, hello! Tell me, how are you even connected with the stock market?In 2007, I left the fourth year of the Voronezh Military Institute of Radio Electronics and began to look for work. Since I have always been keen on programming, and, as it seemed to me, I had certain skills in this area, I considered relevant vacancies. It so happened that I was offered a place in the local Voronezh branch of one of the largest Russian brokers.
And what were your duties there?My main task was to develop trading applications for the company's traders. For example, I made various systems and drives for
scalpers . Using one of these programs, it was possible to enter orders into the trading terminal not with a mouse, but directly from the keyboard. Now this does not surprise anyone, but in those years there were not very many convenient means for trading. Another development of that period is the arbitration robot, which was able to perform arbitrage operations in different markets (futures and spot).
It all started as a simple satisfaction of the organization’s own needs, but “went out of control” because it turned out that such products are in demand by the broad masses of potential customers. A separate company was organized, which was engaged in the development of trading robots and exchange software. From this company, I already went to work at ITinvest, where I started developing a new SmartX trading terminal (the
history of this project is posted here - Ed. ).
And how did everything come to an independent entry to the market?Some time after the change of job and moving to Moscow, I optionally, in my spare time, wrote a new robot that could trade anything. It was even more likely not a robot, but a trading platform that could connect to the interfaces of various domestic brokers, to different terminals, to the exchange. It was possible to quickly load a trading strategy into it, and it worked. Something like Wealth Lab or Russian StockSharp and TSlab.
The platform was completely written in C # and all the strategies that could be “put in” were also written in this language. There were ready-made methods for processing applications, transactions, data acquisition, etc. It is only necessary to describe the mathematics of the trading strategy, without the accompanying binding of the necessary processes, and the robot will begin trading.
This platform is still alive, it is the main source of my income. Of course, little has been preserved in it since 2011, but the basic constructions and philosophy have remained unchanged.
Such a moment is interesting, you are not a trader yourself, but a programmer. Did you write trading strategies yourself, or did someone help you? How to make money on such a system, if you do not understand trading?It was so and so. Firstly, it helped me a lot that initially I worked for a company that was engaged in direct trading on the exchange. I was attached just to the department of professional traders, whose requests and it was necessary to implement software. This gave an understanding of basic market mechanisms, as well as knowledge of basic strategies for operating in the market. Secondly, I have a partner who has much more experience in trading. A kind of
Jeff Dean from trading (laughs). No kidding, his experience and insight largely influenced me as a professional trader. Most of the strategies that have survived to this day are the fruit of our brainstorming, arguing, and reasoning. I also often communicate with my colleagues, we discuss news from the market and near-market sphere. Of these meetings, you can often learn a lot of new and interesting. I invented some strategies on my own, watching the market. I also constantly study various solutions on forums, websites selling trading robots, etc. hoping to find at least an adequate idea. In general, to make a robot you need either an idea - your own or someone else's - that can be adapted to your platform and tested.
In addition, that time was a scalping boom, when the active trading in RTS futures just started and developed, etc., I wrote drives for this business - I even attached a joystick to the terminal so that you can send orders from the buttons. Therefore, the basic trading ideas were familiar to me, and it was not difficult to shift them into the trading strategy.
In general, this is quite an exciting process - the separation of the wheat from the chaff. After testing, 90% of ideas turn out to be slag, and in the best case history shows zero. The remaining ideas are checked for the presence of hidden and random errors, then run in the virtual execution of orders, and only 1-2% reach the real trading.
Clear. What is the end result of this project? How successful is he, do you think? How can you as a successful trader boast?I don’t bother with some external manifestations of success, such as expensive cars and cool gadgets (I even use an old iPhone 4 with my phone, it’s quite enough, although I can buy anything). In principle, I try to follow the considerations of expediency in all things and live asceticly - it hardens and helps to experience any difficulties without problems. But do not skimp on travel. Only in 2013 I visited 6 countries (in the winter in the Czech Republic, Germany and Austria, in the summer in Finland, in the fall in Spain and France). As for life, of course, thanks to trading, I was able to get rid of all the dullness of the type of commuting and meetings that devour the hell of a lot of time (especially in Moscow).
Now I work from home, I have good equipment, monitors, a comfortable atmosphere, a comfortable chair. Did I work less? Perhaps not, but I am free to build my schedule based on my needs and mood. The only time, from 10:00 to 19:00, when the main trading session is on the stock exchange, you need to keep an eye on the robot so that it does not fall. Or rather, so that the stock exchange does not fall (over the past year, the stock exchange has more failures than the robot (laughs)). Although this can be done from anywhere - the system has already “wisely grown” enough and is able to monitor itself and send SMS messages and emails about its condition. You can raise it even from a cafe, even from Bali.
Are you continuing to develop alone or are you already attracting someone?Yes, I continue to develop one. Now rewrite the system completely in C ++. There is no need to attract wage labor.
Let's talk about technology. What caused the initial choice of C # and the current transition to "pluses"?Initially, I wrote a project in C # because it was easier and faster for me to make a finished product. The functionality available in the .NET platform is quite rich (working with containers, streams, files, with XML, having a GUI), which makes it a good choice. The reason for switching to C ++ is trivial - not enough performance. Now the requirements for software in this regard are very high — the time for recalculating strategies is measured in units of microseconds. Every microsecond counts.
The process of switching to “pluses” began several years ago, when the server was bought, and the robot first got into a colocation, first to the broker, and then to the data center of the exchange. I had to rewrite part of the modules already then, and then I started working on the kernel. If we take the current trading robot, then in C ++ it is written all the “math, and adapters to stock exchange systems and brokers. Everything else remains on C #. That is, modules that require minimal delays are written in a low-level language, and the logic of making trading decisions, GUIs and auxiliary modules is implemented in a high-level language.
This bundle of languages ​​- C # and C ++ - is extremely viable. It takes an hour or two to write a new trading strategy or modify an old one. In the case of complex mathematics - a day and a half. In this case, the system has a built-in back-test function, a new strategy can be immediately tested on historical data. In addition, there are genetic algorithms that can be used to optimize strategies.
In general, what better to study for those who would like to find work in the stock market?I would advise those who start their way into trading or are somehow interested in this area to turn their attention to high-level platforms and languages ​​such as .NET and Java. The latter is very popular in Western stock markets, we still have less, but there are good prospects for wider dissemination of this language. This means that Java programmers will be in demand in financial companies, funds and brokers. Still, .NET is a fairly closed platform, which also has a number of limitations. For low-latency and HFT trading, it does not work very well.
But in .NET and in Java, you can quickly create complete software products. The main disadvantage is that they are not the fastest (if the count goes on microseconds).
You talked about buying servers for the system. Was it done on the income that this robot generated? Generally, how quickly the project began to bring a tangible income?Everything was bought and made on the income from trading. Money for all the "iron" were withdrawn from the brokerage account. As for the income, up to the moment when the income from the work of the system was equal to the salary of the developer, about six months have passed.

It is important to understand that 2011, when the project started, was marked by large fluctuations in the market. Money literally handed out right and left. Of course, this contributed to the success of my robot, which quickly began to bring a good income. While the robot was not debugged, I traded in one or two RTS
futures contracts - the risk of losing real money at that time was very great. When it became clear that the system was working, well-established and making money, the amount was increased to tens, and then hundreds of thousands.
That year was very good for the robot, it was then that the risk capital, as I call it, was earned, which went on to further develop the system. However, if the market conditions were not so favorable, there would be a high probability that I would try, lose all the money and forget about the stock market in general (I exaggerate, of course, I would not leave the market, but the loss of starting capital would be extremely negative event for the project).
As with any business involving uncertainty and risk, there are ups and downs in trading. Variability (dispersion) of results in stock trading, on the one hand, allows to get significant profits (and not only money; this can include time, knowledge and views on the world around us), but on the other hand, it constantly destroys my mind . Summing up almost three years of trading “on my own”, I asked myself whether I would refuse to benefit from trading (at that time very, very decent for a 25-year-old programmer) salary, if I knew that I would survive this 3 years ? Definitely yes.
Links and posts on the topic: