
Exchange software: the history of creating a trading terminal

The stock market is an extremely high-tech industry, which involves a lot of interesting technologies and extremely complex infrastructure. Today we want to talk about how work is being done on IT projects in the financial sector. In particular, to highlight the aspect of software development using the example of creating the SmartX trading terminal .
Background
We at ITinvest, unlike most other brokers, have always paid attention to developing our own software. In particular, in the 2000s, the SmartTrade terminal we created was very popular in the market , which, in principle, to this day meets the basic requirements of traders.
However, software, like everything in this world, is becoming obsolete, and sometimes you just need to move on. Therefore, it was decided to create a new flagship terminal, which would incorporate all the best qualities of our previous products, but would be more modern, both in terms of interface and functionality, and, at the same time, more flexible than its predecessors.
This is largely why we decided to develop the trading terminal not entirely from scratch, but to license the technologies of the American company Modulus FE , in particular, the M4 trading platform , which was supplied with all the source code and could be modified to meet the needs of our customers.

Development stages
Immediately after the acquisition of the technology and its initial adaptation to our systems, the terminal, called SmartX, was able to connect to the server, load graphs, glasses, and that was where its capabilities ended. So there was a lot of work to do.
In addition, it became immediately apparent that Modulus FE technologies did not meet the performance requirements for trading applications on the Russian stock market. Simply put, even with a not very heavy load, the terminal began to slow down extremely strongly, which in situations where a split second can lead to either significant profits or large losses is simply unacceptable.
Graphs
One of the main reasons for the low performance was the graphics built into the M4 platform on the COM + platform. When opening 5-minute or 15-minute schedules, the speed was still acceptable, but the tick chart tightly “suspended” the terminal.
In addition, the "default" charts had serious flaws in terms of usability - for example, to draw a line on the chart (a function completely standard for any terminal), the user needed to stop updating the chart by drawing a special button, draw a line, and then turn on loading again.
After the release of the first release of SmartX 1.0, it was finally decided to abandon the M4 charts and find some other solution. As a result, a new graphics core was chosen - the open-source project Gordago, - which was then greatly “finished” in accordance with our needs in terms of productivity.

Today, we are proud that our terminal has some of the smartest schedules fully implemented on .Net.
Controls
Modulus FE solutions are built on the .NET platform, so initially all controls were standard "pre-Net", but, for the same performance reasons, it was decided to abandon them as well. A good replacement, after some refinement, was another open source project SourceGrid . The speed of updating tables on large amounts of data was ultimately increased by almost 2 orders of magnitude.

Data manager
As it often happens, starting to change something, it’s hard to stop, and already after the start of developing a new terminal, work began on creating a completely new brokerage trading system. Most of these works were completed in the fall of 2013, the resulting system was called MatriX ™ (a separate topic will be in more detail about it). One of its main “features” was a single monetary position.
Using the previous version of our trading system, which was called it-trade / SmartTrade, the client was provided with a separate personal account for each trading platform. For example, the Moscow Exchange Stock Market is an MS account; Derivatives Market of the Moscow Exchange - RF account; Currency market of the Moscow Exchange - account FX (non-deliverable) or CD account (deliverable) and others. With this separation, securities and cash located on one trading floor cannot serve as collateral for transactions on another.
When using a single cash position, the customer is provided with a single account with the identifier MO, which includes several trading platforms at once:
- Stock market of the Moscow Exchange (all instruments traded in T + 2 mode).
- Derivatives Market of the Moscow Exchange (futures, options).
- Currency market of the Moscow Exchange (non-delivery mode).
- London Stock Exchange section IOB (ADRs of Russian issuers).
This account becomes single for all trading floors, and assets (money, securities) located on one trading floor of the market can be used as collateral in other markets that are part of a single monetary position.
Accordingly, the new trading terminal had to comply with these innovations and be able to work with a single monetary position. This, in turn, entailed the need to rework the previously existing Data Manager module, which SmartX inherited from its predecessor, the SmartTrade terminal.
The Data Manager module is responsible for the interaction of the terminal with the brokerage trading system. The old module was single-threaded and it was not doing well with performance, which was unacceptable in a situation where gigabytes of exchange data could be "pumped" through the terminal per day. The new Data Manager has become multi-threaded and asynchronous, thanks to which, now the terminal can display 2 million client orders without any problems - when trading a robot, sometimes traders control the situation on the account using the trading terminal, so this is a pretty valuable opportunity.
Functionality Extension: Plugins
After SmartX received the necessary basic set of functions (charts, transaction feeds, quotation tables, exchange glasses, account status, information on orders and positions), we thought about expanding its capabilities. At the same time, I did not want to complicate the terminal itself and make it inflexible, so the extension / plug-in mechanism was invented and implemented that allows those SmartX users who lack the basic functionality of the terminal to expand its capabilities. Currently available plugins include:
- Package of optional plugins.
- TradeScript ™ Robot Designer (more in this topic ).
- Bonds trading.
- Easy trade.
- Application lifetime.
- Additional quotes windows.
- Auto Follow EasyMANi is the first third-party plugin.
- The famous game "Snake".
Initially, plugins were connected to the terminal manually - the user needed to copy the corresponding .dll library to the desired folder, and now the terminal can independently download extensions from the site.

Interface and Usability
The color scheme of the terminal remained in it from the M4 platform, which had a good design and an interesting opportunity to include different design schemes, and not just just one standard one. In fact, all that SmartX and M4 have in common at the moment is just the visual design.

As for typography, it was decided to use standard Windows fonts in the terminal, so if the user changes his default font, then he will change in the terminal.
In general, usability work has never stopped and is ongoing to this day. The general scheme of work on adding new functions to the terminal can be divided into two stages:
- Transferring the predecessor functionality (SmartTrade) to the new terminal.
- Upon completion of this stage, adding new features at the request of customers and on the initiative within the company.
After the introduction of any innovations, the collection of feedback from users begins, taking into account which the next version of the terminal undergoes further changes (including from the point of view of the interface) - this is a continuous process that allows you to constantly move forward.
In addition, one of the main differences between SmartX and previous products is the fact that it is optimized for working with multiple monitors. This is expressed in the fact that all the elements of his workspace are a table, quotation windows, etc. - can be moved outside the terminal itself. Then this workspace can be saved and downloaded, for example, on another computer.
Another important innovation from the point of view of usability is in the new terminal, the client can see all his accounts and applications for them at the same time, while when working with previous terminals, when switching from one account to another, the opportunity in real time mode was lost see the situation on the rest and carry out operations on them.
Also, for the first time for ITinvest products, SmartX has an automatic update feature. Now users in two clicks can get a new version of the terminal.
Risk management
In order to help customers protect themselves and their money when trading on the exchange, a risk management module was implemented in the terminal . It works on the client side and allows the user to set restrictions upon violation of which it is forbidden to send new orders and open new positions, as well as configure automatic placing of orders protecting the position (stop loss, take profit, etc.).

Plans
Despite the fact that the SmartX project has been going on for several years, the constant development and improvement of the terminal never stops. In particular, among the immediate plans, the introduction of functionality that is available to users through the web interface of the trading system, including the signing of reporting documents, transfers between accounts, subscription to services.
In full accordance with the rules set forth in this topic, we pay a lot of attention to security, but we try to make sure that this does not complicate users working with the program. Therefore, it will be possible to perform all actions with accounts using the new digital signature system similar to many online banks. By pressing the button, the user will receive an SMS code, after entering which, for example, the document will be considered signed.
That's all for today. We will be happy to answer questions in the comments. Thanks for attention!
PS You can independently familiarize yourself with what we got as a result of the development, without the need to open a real account and get money for it. Especially for these purposes, we have test access - risk-free virtual exchange, with money, stocks, futures and everything necessary for full trading.