
In our blog on Habré, we have repeatedly raised issues related to the creation of trading robots and algorithmic trading systems. Today we bring to your attention a post written by our reader - the purpose of this publication is to bring clarity to the terminological confusion that surrounds algorithmic trading.
Zi Lu asked: “The Wei ruler intends to involve you in government. What will you do first? ”
The teacher replied: "It is necessary to begin with correcting the names."First, let's introduce the main participants in the process of exchange trading:
')
- The client is an investor, makes investment decisions and gives orders (orders) to an intermediary broker
- The broker is an intermediary, is a member of the exchange and accepts orders from the client and sends them to the exchange, receives results from the exchange and transfers them to the client ( an example of such a broker is ITinvest - ed. )
- Exchange - receives orders from member brokers, conducts trading, sends trading reports to brokers
We consider the case when the broker is a pure agent, i.e. means of transferring client orders to the exchange and reports back. Broker agents (agency brokers) earn exclusively on commission, which the client pays the broker for the execution of orders.
Electronic commerce
Before the advent of computers and networks, the movement of orders between customers, brokers and exchanges was carried out using the telephone, and before the appearance of the telephone, via telegraph, and before the telegraph in gray bearded times, by couriers and messengers and even postal pigeons.
Currently, the order flow (client flow) from a client through a broker to the stock exchange is completely computerized for all brokers, although there are cases when some lazy clients with thick wallets prefer to transfer their orders by phone without touching the computer, but their orders all the same, they are entered by the broker in the brokerage computer, and then they are transmitted to the stock exchange via the network as it should be in the 21st century.
Investor, his goal and strategy
The investor is committed to making an investment decision on the purchase and sale of an asset or a portfolio of assets. His goal is to make money.
An investor can make decisions independently, guided by intuition, knowledge, insider information, the whisper of mermaids, the location of the planets and the flight of birds, the configuration of "Japanese candles" ("technical analysis") or quarterly reports of companies ("fundamental analysis"). In making such investment decisions for data analysis and calculations, many investors have long been using computers. Trading on the basis of such calculations is called “quantitative trading”.
Having received the “sell” / “buy” signals from the calculations, the investor generates a purchase order (sale), which is sent to the broker for execution. If an investor works with a whole portfolio of assets, there can be several hundred simultaneous bids for buying and selling.
Automated trading
If an investor can express his investment intuition, vision, strategy in the form of a computer code, he can fully automate investment decisions, having entrusted everything to the computer: from analyzing incoming market data and calculating potential profit losses to generating buy and sell orders. The investor himself leaves only checking, monitoring and relaxing golf.
In those hot moments when the investor is shaking hands and gnawing doubts, the computer will impartially render the buy-sell verdict and buy and sell in exact accordance with the set of rules laid down in it. And make a profit. Unless, of course, the rule set is correct.
This style of trading is called “automated trading”. Other names for such trade: “rule-based trading” (trading by the rules), “systematic trading” (trading by the system). A computer program in this case is called an “automated trading system” (automated trading system) or “trading robot” (trading robot).
If the set of rules by which an investment decision is made is kept in a special secret by the developer from those who use it, such a system is called a “black box” (black box), and trading with it is called “black-box trading”.
The goal of “automated trading”, like any other proprietary trading, is to make money. Of course, the set of rules of an automated trading system can also be called an algorithm, but this does not mean that “automated trading” becomes “algorithmic”.
When you write “robots” in trade terminals or in Visual Basic, and start them to trade on the stock exchange, you are not engaged in algorithmic trading, but in automated proprietary trading.
Algorithmic trading
The term “algorithmic trading” is used to denote another specific process in which investment decisions are not made. In algorithmic trading, algorithms are used to execute large orders with minimal losses.
The purpose of algorithmic trading is to effectively reduce the cost of order execution (execution costs), reducing the impact of the order on the market (reduce market impact).
The word "trade" (trading) in this term is not entirely successful. It has too wide a meaning and is associated with the majority of the sale and purchase activity, therefore, it is correct to call this process “algorithmic order execution” (algorithmic order execution).
From where exactly the order gets into the algorithmic engine is not important, the main thing is that it is not created by the algorithmic engine. Most often, the algo-broker engine is working on a large order received from the client.
Order execution
Before the advent of algorithmic trading, large client orders in brokerage offices were processed manually. The traders (working the order) called “working” on the order, gently “pushing” it into the market in parts (slicing), guided by instinct, experience and reaction.
Such orders were called “high touch”, since such orders required a lot of attention and care. The brokers call the stream of these client orders “high touch order flow”, and the broker has such orders organized by a special department of high touch trading desk traders. Clients pay the broker the highest commission for "manual work" with the order.
Why it is so important to work carefully with large client orders, read the section “Large order moves the market” at the end of the article.
With the increase in the flow of orders, traders no longer had time to pay due attention to each large order and the idea to use computers for this appeared. This is understandable, since the orders are sent to the broker electronically and are already listed on the computer, why not program the computer with the simplest rules for executing orders and assign them to routine work?
Thus, algorithmic engines (algorithmic engines) were created, which did everything the same as a regular trader with a large order did by hand, namely: a large parent order was divided using a special algorithm with specified parameters into small orders (child orders) and each small order went to the market at a predetermined point in time. Computers can very easily process thousands of client orders at the same time and divide them into hundreds of “little cubs”, leaving the trader time and the opportunity to work on other more complex orders manually.
As you can see, in the beginning, algorithmic engines were just an auxiliary tool for traders of a brokerage company to which they resorted, when the execution of a client order did not require special attention, but it was just necessary to have a disciplined execution of a certain strategy.
Direct market access
Direct Market Acess - “direct access to the market”, is when a broker passes an order through his trading system to the market in a fully automatic mode without additional manual intervention.
If an order is received electronically from a client and is already in the computer, why not program the computer to perform certain checks and then immediately send the order to the exchange? This simple idea was implemented in the early 2000s, when exchanges became electronic everywhere, and brokers began offering DMA service to their customers.
Unlike “high touch” orders, in the DMA service no one touches client orders, no one processes them and does not check them manually. Therefore, they are called "low touch". “Low” because some processing is still underway: the order passes through the broker’s trading system, where it is checked for validity and compliance with various limits and risks (risk checks). Only after that the broker’s trading system sends an order to the exchange. All checks of the order are held in a fraction of a second, but nevertheless they contribute to the difference between the time the order is received by the broker and the order is entered the market.
Not all clients liked this latency (latency), and brokers went for an even bolder service — providing naked DMA or sponsored DMA. In naked DMA, the client connects to the exchange directly, creating its own infrastructure, and sends its orders from its trading system directly to the exchange, bypassing the broker's infrastructure, but using its identifier.
The client’s broker ID is required because only members of the exchange, which is a broker, but not a client, can trade on the exchange. Those. All orders sent by the client through naked DMA are sent on behalf of the broker (he acts as a sponsor who rents out his identifier and his reputation) under the responsibility of the client. The broker receives information about client orders post factum in the form of a protocol (drop-copy) from the exchange. Such orders are called “zero-touch”, because the broker does not touch them at all. Recently, naked DMA began to press government regulatory agencies, especially in the United States.
Clients also pay a broker a commission for using the DMA service, albeit a tiny one.
Direct strategy access
Digression: For some brokers, the execution algorithms are called the word strategy. Just so beautiful sounds. This makes confusion because the word "strategy", for example, in the phrase "investment strategy" takes on a perfect meaning.
Somewhere around 2004, in addition to the DMA service, major brokers began to provide customers with access to their algorithmic engines. Now the client could send an order with parameters, where it was indicated which broker algorithm he chooses, how aggressively the order should be executed, when to start the order execution and when to finish. This special order inside the brokerage infrastructure is redirected to the algorithmic engine, which then "works" on the order, sending it to the exchange in small pieces.
I wrote above that algorithms are sometimes referred to as strategies for beauty and advertising, so direct access to them is called “direct strategy access”, i.e. literally "direct access to strategies." Orders are called “DSA orders”, and the flow of such orders is called “DSA flow”.
For using the broker's algorithms, the client pays the broker another extra commission.
Investor and algorithmic trading
Since the client-investor already has direct access to the market through a DMA service from a broker, nothing prevents him (if there is a budget) from creating his own algorithmic engine, customized for his own needs, which will be executed by his large orders generated its automated trading system.
An investor can buy a ready-made (of-the-shelf) algorithmic engine from a third-party office (vendor), or hire programmers to write his own (custom built) to him.
In any case, the investor algorithmic engine becomes part of its automated trading system, but is still a module for the execution of orders. The generation of orders is engaged in the investment part of the trading system.
Big order moves the market
The main task of the broker agent is to serve the client, i.e. to fulfill the client’s order in a high quality, so that the client does not overpay when he buys and does not lose while selling. But if overpaid, not too much. And here the main market law of supply and demand feedback comes against the broker-agent. If a client sends a very large order for processing, say, to sell 100,000 shares (this is a warrant worth at least one million cu), then you cannot simply take it and throw it on the market. This will immediately lead to an imbalance of the market, and this will lead to the fact that those who wish to buy will lower their price, seeing that someone needs to sell such a larger number of shares. It looks like this - the seller sees the current quotes for the XYZ stock purchase / sale of 100 - 110 in the market. And he sends a warrant: sell $ 100,000 for $ 100, planning to earn $ 10,000,000. An inept broker dumps the entire order onto the market, and what does he see? Those who recently wanted to buy $ 100, will instantly withdraw their applications and submit new applications: no, we don’t want to buy 100, we want to buy 90. The broker will scratch his head and redefine his order: ok I sell 100.000 for 90 cu If buyers do not repeat their trick, the broker will execute an order, bringing the client on a platter instead of $ 10,000,000. total 9,000,000. Those. on the execution of the order, the client lost 10% of the capital, due to a blunt, hasty broker. Yes, I paid a commission. The client will not like it very much.
This phenomenon is called “a large order moves the market” (“moves the market”), the influence of a large order on market prices (market impact) is characteristic not only of the financial market. If, say, you bring bananas to the KAMAZ market to sell them quickly, bazaar dealers will overwhelm your KAMAZ and immediately begin to lower the price for which they agree to outbid the whole truck.