In this article I will try to tell some of the ideas underlying trading systems. The presentation will be as simple as possible without technical and economic cleverness.
Since this field of activity is actively developing in the English-speaking world, many terms are easier to use without translation, so as not to lose meaning along the way.
The review will focus on the technical side of the issue from the point of view of computerized automation of the process of electronic trading in securities. To clarify related issues (mainly from the general economic theory of securities) one should turn to other sources.
So, to begin with, some simple definitions.
')
Trading is the trading of securities. Accordingly, the trading system (platform) provides automation of this process for various bidders: for those who sell and buy, and for third parties that provide various services and live on a commission.
It should be noted that many of the principles of e-commerce repeat the way it happened before, when there were no computers. But even now, in the era of total computerization, there is a lot of manual work in trading, and not directly connected with the decision to buy or sell.
A security is an object of trade (in English it is called “security”). There are a lot of types of securities (stocks, bonds, currency, etc.). I will not go into explaining their essence (to do this, refer to the literature on economics), since from the point of view of the computer system, each security is just an identifier. For example, GOOG US Equity is Google’s stock on the New York Stock Exchange, VOD LN Equity is Vodafone on the London Stock Exchange, CT2 Govt is a two-year US government bond, etc. There are thousands of such identifiers, and in general, most electronic trading systems try to respect the uniqueness of these identifiers in order to avoid confusion during operations between different platforms.
Each system can have (and usually has) an internal system for identifying securities for ease of accounting.
A transaction (or trade) is a fact of buying / selling securities. A transaction usually has several basic characteristics: date / time, security ID, amount per unit, and number of units purchased / sold. This quantum of information is usually called tick (or feed). It is the flow of such ticks, obtained in real time from various trading platforms, and is the main source of various summaries, charts, graphs, creeping lines, etc., describing the “state of the stock market”, according to which traders decide that buy or sell when and how much.
The rate of arrival of ticks can be very high (hundreds or even thousands per second). This explains why speed is one of the most important indicators for a trading system. The faster the input data is processed, the faster the trader will know about changes in the market, and the sooner he can make a decision. And for algorithmic trading (we'll talk about it a little lower) - this is generally one of the main indicators. This speed can consist of many factors: software speed, speed of information channels (often dedicated lines are used, rather than public networks like the Internet), hardware performance, etc.
It may happen that due to some problems in the system, because of which it works very slowly, the release of ticks may begin (the system does not have time to process them). In this case, periodic reconciliation of generalized indicators is required in order not to display incorrect data.
The main participants of the securities market
Sell ​​side (I will leave this term without translation) - those that are focused on resale. Traders are typical representatives of the sell side. Usually they do not have their assets. They just have some money. At the beginning of the trading day, they buy something, and then during the day they can resell, buy something else, etc. At the end of the day, they usually all tend to sell off, even if they have to sell at a loss. Sell ​​side usually earns on fast daily changes in rates caused, for example, by unexpected news.
The economic reason for the existence of a sell side is, as in the case of
processing systems , the issue of volume. That is, you can not just take it, and anyone to connect to the stock exchange, as it costs money (deposits, equipment, certification, if required, etc.). The high price qualification is made to cut off small customers (the exchange is not interested in messing with customers who buy one share per year). The latter will have to use the services of larger trading firms, and they will already have to pay a commission.
Buy side - this is the "rich" members. These are usually funds, banks, insurance companies, etc. By and large - these are the real holders of securities. They buy them in large quantities, with a long-term perspective, and usually earn money when prices rise (or lose when they fall, this also happens) over a long (several years, for example) time interval.
That is, during the trading day, the sell side resells back and forth securities from the buy side, and by the end of the day everything again actually returns to the buy side, and the sell side has its daily difference.
Of course, such a division can be very conditional, and many financial institutions are both sell side and buy side. But understanding this distinction is very important.
Consider some important parts of the trading system.
Monitoring
This subsystem is engaged in receiving various input data about transactions (own and from other systems, news, etc.) and providing all this information in a form convenient for analysis (tables, graphs, statistics). I must say that the news is a very important part, since the market, especially as mobile as the stock market, and especially so mobile because of its total computerization, reacts instantly. From the moment a press release appeared on the website of a company, for example, about a change in management, before the active movement of securities of this company in the market because of this press release, seconds go by. And the one who received the news faster, he was able to react and as a result earn.
About the news system is worth special mention. They consist of several levels. After receiving a fact, on the first level, the news is squeezed into one sentence of several words and immediately published. This allows the news provider to release the news very quickly (just a few minutes), and for the news consumer (for example, a trader), seeing a new line in the news feed (and not read a whole paragraph) catch the essence and, if necessary, begin to act. For example, “GAZPROM removed the CEO” or “Sberbank declared bankruptcy”. Further, the news is transmitted to the next level, where a paragraph or two is already written with a more detailed description. It may take an hour or two. If the original news was a bomb, then many will wait for this description, and if not, then maybe no one will read it. Well, and then, at the third level, much later they can write detailed analytics, and, for example, include the opinions of experts on the impact of news on certain markets, securities, etc.
Position accounting and transaction history systems
This mechanism allows the trader to keep track of their daily activities. In fact, this is the journal of his actions: he bought it for so much, sold it to this. The seemingly utilitarian utility and simplicity of this system is in fact erroneous. The position accounting system and transaction history allows the trader to instantly see how much and how much he sold and bought, and what his prices are compared to other market participants. By the way, a lot of deals are still made just by phone, and such deals need to be fixed somewhere. And importantly, at this level there is a control of the restrictions of the trader himself. For example, a given trader cannot trade more than a certain amount on a day, or that one cannot go into debt on such a security by more than that amount, or if a trader enters a transaction of more than a certain amount, his manager’s permission and etc. The control system can be very, very sophisticated.
Algorithmic trading can also work at this level. A special program, not a person (or maybe a person, but who does not manage each individual transaction, but launches special scripts that do this work for him), based on information from the market, makes decisions to buy or sell. The program can do it very quickly, much faster than a person, and, using obvious logic, when they sell something, it becomes cheaper at once, and when they buy it, it rises in price, you can control prices on the market, and thus have high-probability predictions. about the price movement, and, as a result, on time (= profitable) to sell or buy.
Transaction systems
Usually, the job of a trader is to negotiate a deal. Electronic or by phone - it does not matter. The transaction usually occurs after the markets are closed. And this is the middle office. At this stage, additional checks of the trader’s activity can also be carried out.
Various stories about traders who illegally traded something there are usually related to the fact that the trader was able to conduct the transaction without any checks, or found a way to get around these checks.
Automating the process here usually consists in electronically sending counterparties information about the transactions, receiving answers from them and preparing data for the financial department, which will physically carry out calculations with counterparties.
Anonymous trading
The first way to trade can be when a trader directly buys (or sells) from a specific counterparty (for example, from his regular partner).
Alternatively, the information of the buyer and the seller can be anonymous trading. In this case, the buyer (or seller) does not care who his counterparty is, since he is only interested in price. There are special mechanisms for automating such anonymous trading.
Electronic Market Device for Anonymous Trading
The electronic market is usually arranged as follows. There is such a thing as “Market depth”. I don’t really like the translation “market depth”, so I’ll leave the term without translation. “Market depth” is a table of the best supply and demand in the market for the selected security. It looks like this:
Bid offer
--------- + ----------
C1 x K1 | Ts5 x K5
--------- + ----------
C2 x K2 | Ts6 x K6
--------- + ----------
Ts3 x K3 | C7 x K7
--------- + ----------
...
--------- + ----------
Ts4 x K4 | Ts8 x K8
--------- + ----------
The Bid column is the price and volume of what people want to buy (a list of current demand). This column is sorted by price descending:
C1> C2> C3> ...> C4
That is, the physical meaning of this column is to show the best (= highest) from the point of view of the potential seller of the price (and possible volumes) for this security.
Suppose there is no “C1 x K1” cell yet, and at the top of the Bid column there is a “C2 x K2”. I, as a market participant, say “I want to buy N security at the price of“ C1 ”in the amount of“ K1 ””. Since my price is higher than the price of "C2", then my application will be at the top of the column.
The “Offer” column (or sometimes referred to as “Ask”) is the price and volume of what people want to sell (a list of current offers). This column is sorted by price:
5 <6 <7 <... <8
The physical meaning of this column is to show the best (= lowest) in terms of potential buyers prices (and volumes) for this security.
Next comes the fun part. As you know, demand satisfies supply and vice versa. So this table is a mechanism for comparing supply and demand.
If I come to the market and say “I want to buy N security for the price“ C1 ”and the quantity“ K1 ”, the system takes the table“ Market depth ”for the security N and looks through the column“ Offer ”.
If some price coincides with mine (for example, “6”), then the system automatically satisfies my application and sells me the necessary amount of N securities at the price of “Ts1” (= “Ts6”) and in the amount of “K1”. And the cell “C1 x K1” does not appear in the “Bid” demand column, since my demand is satisfied. If my requested quantity “K1” is equal to “K6”, then the line “6 x K6” is deleted from the column of the offer “Offer”. If my number “K1” is less than “K6”, then the line “TS6 x K6” remains in the column, but “K1” is simply subtracted from “K6”. Well, if my quantity “K1” is more than “K6”, the line “6 x K6” is deleted from the column “Offer” (this offer is completely satisfied), and in the column “Bid” my line appears “C1 x K1”, where “K1” is displayed minus “K6”, that is, “C1 x K1-K6”.
Similarly, for sale. If I come to the market and say “I want to sell the N security at the price of“ 6 ”and the quantity of“ K6 ”, the system takes the“ Market depth ”table for the N security and looks through the“ Bid ”column.
If some price coincides with mine (for example, “C2”), then the system automatically satisfies my application and buys the necessary amount of N securities from me at the price of “C6” (= “C2”) and in the amount of “K6”. And the “6 x 6” cell does not appear in the “Offer” demand column, since my offer is satisfied. If my requested quantity “K6” is equal to “K2”, then the line “2 x K2” is deleted from the column of the sentences “Bid”. If my number “K6” is less than “K2”, then the line “C2 x K2” remains in the column, but “K6” is simply subtracted from “K2”. Well, if my quantity “K6” is more than “K2”, then the line “2 x K2” is removed from the column “Bid” (this demand is completely satisfied), and in the column “Offer” the line “6 x 6” appears, where “ K6 ”is displayed minus“ K2 ”, i.e.“ C6 x K6-K2 ”.
In fact, the “Market Depth” table displays a list of as yet unsatisfied demand and supply. As soon as there is a pair offer for demand or vice versa, a trade is made between them, and this pair is removed from the table (one of the parties may remain in the Market Depth table after the transaction, if, as described above, there was no complete match in count).
Usually “Market depth” displays on average from 10 to 100 price levels for supply and demand. No longer makes much sense.
In addition, each cell of this table can be opened with a list of bids by price. What does it mean? For example, a cell “C1 x K1” may be an aggregate by price indicator, that is, the quantity “K1” is an offer not for a single buyer, but for many (several buyers may want to buy at a price “C1”), but since it does not matter for the seller just sell (the price is still the same, and the system as a whole is anonymous), by default this detail may not be displayed.
The mechanism of supply and demand comparison in the Market Depth table is the basis of anonymous trading, and the so-called algorithmic trading can be built on the programming of automated trading logic based on data analysis of the Market Depth table.
For algorithmic trading, the system provides a programming interface (API), which can be, alternatively, a scripting language, for example, Lua, with a set of functions for viewing Market Depth tables and for placing buy or sell orders in the system. The logic is programmed by the author of the script.
Interestingly, sometimes traders keep their scripts in great secrecy, and even in the case of technical problems (for example, the script does not work as it should), refuse to show them technical services, although they require solving the technical problem.
We looked at some of the basic concepts, terms and mechanisms of trading systems at the initial level. Many of the described mechanisms in reality are more complex and more flexible, but the basic principles do not change.
Posts on the topic: