Thinking is more important than high-frequency algorithms.

Author: The Little Dream, Created: 2016-09-05 20:56:39, Updated: 2016-09-05 21:32:59

Thinking is more important than high-frequency algorithms.

What really brought programmatic trading into the public eye was the Ural index scandal that shocked the market two years ago, when the index rose by more than 5% in less than a minute due to errors in order generation and execution in the broker's high-frequency trading program.

From the Chinese Financial Futures Exchange's Xiang 7•31 New Deal, to the Shenzhen Exchange's continuous announcement of restrictive trading measures for three batches of accounts, and then until recently, the Fidelity Exchange's T+0 Fidelity Exchange was changed to T+1 Fidelity Exchange, the regulatory level has continuously opened a fence on the processed trading.

This article is based on the information provided by users who are aware of the famous algorithms used in August 2014 for high-frequency trading. The answer to the question "What algorithms are used for high-frequency trading?"

I have some knowledge about the iceberg algorithm mentioned in the article, and I can tell you about it. Many people understand the quantum trading algorithm too one-sidedly, basically equating it with a money-making tool, and I do not agree with this view. Trading is first of all the transaction itself, it has its own economic significance, ignoring this and simply seeing it as a digital game that adds value to money, it is easy to get lost.

I don't think there's anything weird about algorithms in themselves, and I don't think good algorithms are dead either, and the real core value must be the people who know and use them.

Hopefully this answer will give you a clearer understanding of quantitative and high-frequency trading.

First of all, I believe many people's concept of high-frequency trading looks something like this:

img

However, this information is very crude for high-frequency trading. So for students who are unfamiliar with the background, here is an introduction to what is called the Order Book. Today, mainstream exchanges generally use the Order Book to trade, and all the bids of buyers and sellers are recorded on the Order Book inside the exchange, like this:

img

The bid represents the buyer and the offer represents the seller. The bid list represents all bids ("Limit Order") issued by both buyers and sellers. This table is the most important piece of information for high-frequency trading. At any given moment, the buyer's bid is always lower than the seller's bid (e.g. 98 vs 101 here).

When does a transaction occur? There are two scenarios, the first is when either party issues a market order, for example a buyer issues a single market order of 10 and can buy 10 of the seller's 101, after the transaction is successful, the order book becomes like this:

img

The second is to issue a price limit list that is equal to the other party's best offer, which will also produce the same result as in the above situation.

It should be emphasized that although the real Order Book only exists inside the exchange, and all transactions are completed inside the exchange, the exchange will forward each quote and market listing to everyone, so that all buyers and sellers can maintain the same data structure, which is equivalent to the mirror of the exchange's Order Book.

After the basic introduction, I'll use a more visual way to represent the Order Book below to make it easier for you to understand:

img

This graph corresponds to the Order Book at the beginning of the article, and should be clearly visible, with the horizontal axis representing the price, the vertical axis representing the order quantity, the green representing the buyer, and the red four representing the seller.

From the above basic analysis, it can be seen that the trading data in the exchange is completely public, at any moment in the market, who wants to buy/sell how much, everyone is at a glance, there is no secret. This makes economic sense in itself, because only showing the buy/sell demand attracts potential traders to trade, so a certain degree of publicity of one's own needs in the market is necessary.

img

This is very unfavorable for him, because everyone will use this information to get right with him. Everyone will judge that there is a lot of buying pressure in the market now, so there will be a large group of people who rush in to buy to make money, and the price will rise quickly, so that what this person can buy at the price of 98 will soon be able to buy at a higher price. What do you mean? To solve this problem, the exchange provides a targeted tool called an iceberg order. Such an order can be large, but only a small part of it is public, and most of it is hidden, unseen by anyone except the exchange and the issuer itself, really like an iceberg.

The gray part is the hidden part of the iceberg order. This way, the exchange only notifies others when a corresponding hidden amount of transactions occurs, thus preventing others from using the information displayed in the order to do front running.

Everything has its advantages and disadvantages. Iceberg orders, while protecting the interests of the issuer, have become an unfair rule for other market participants. Participants with genuine trading needs will lose heavily due to misjudgments of the situation.

First, there is the simplest method. Sometimes, the iceberg order is hung between the best buy and sell price (spread), like this:

img

In this case, a very simple detection method is to issue a minimum limit order in the spread, followed by cancellation of the order. For example, in this example, a 99 sell order is issued and then cancelled. Because the price itself is not an obvious buy price, without the presence of the iceberg order, the transaction must be done. But in the case of the iceberg order, once the exchange does not receive the sell order, the corresponding amount in the iceberg order is immediately traded, and the cancellation order is invalidated.

In response to this disruptive detection, people generally don't list directly in the spread; instead, they are tied to the normal limit order as before, so after the transaction, it is difficult to guess whether the normal limit order or the iceberg order is consumed.

First of all, there is a direct thought. The existence of an iceberg order to some extent reflects the bookkeeper's interpretation of the market situation and the judgment that it is necessary to use an iceberg order. It should be emphasized that using an iceberg order is not without cost, because you hide the real needs, while shielding potential attackers, but also shielding the real traders! and will significantly increase the transaction time - because no one knows you want to buy/sell so much, you can only wait for the display of the handset.

What is the right time? There are some data that should be relevant, such as the bid/ask spread, the ratio of the quantity bought to the quantity sold etc. For these data, you can do regression analysis on the historical data and build a linear/non-linear model between them and the iceberg orders. This model, trained from the historical data, can be used as an iceberg order detector that you use when trading in real time.

The basic model can be defined as: F ((spread, bidSize/offerSize,...) = Probability ((Iceberg)

If you want to play high-level, you can also build high-level models like HMM, SVM, neural networks on this basis, but the basic idea is the same: calculate the probability of an iceberg order by using plate analysis.

I think you can see that this modeling is not very accurate. It is good as a means of post-analysis to explain what conditions may occur when an iceberg order may appear, but it is not very reassuring as a detector for real-time trading. Because the information used is too vague, and the object of the modeling is only a correlation, there is no guarantee that the sender of the iceberg order will have to play according to this logic.

So what follows is a really high-frequency player-squatting method, from the paper Prediction of Hidden Liquidity in the Limit Order Book of GLOBEX Futures.

  高频世界里,有一条永恒的建模准则值得铭记:先看数据再建模。如果你看了上面的介绍就开始天马行空的思考数学模型,那基本上是死路一条。我见过很多年轻人,
  特别有热情,一上来就开始做数学定义,然后推导偏微分方程,数学公式写满一摞纸,最后一接触数据才发现模型根本行不通,这是非常遗憾的。

What happens to the person who looks at the data? He will most likely find that the rules of the exchange are very interesting for the processing of the iceberg order. Some exchanges do this: an iceberg order contains two parameters, V is the total order, p is the quantity displayed publicly. For example, an iceberg list of V = 100, p = 10, the actual hidden amount is 90.

Payment 10

Order book Top bid size -10

New Bid +10

The three messages must appear in succession, and the time difference between the third and first is very small. This is because, although there is a hidden quantity in the iceberg order, each transaction occurs only on the displayed quantity (p), and a new p is renewed from the remaining hidden quantity only after p is consumed. This way, everyone receiving information from the exchange can still logically correctly update the Order Book, as if the iceberg order did not exist. What do you mean? So, once we observe this law in the data, we can very confidently determine the existence of an iceberg order in the market, and the value of the connection p can be determined! The next key question is, how to determine the value of V, that is, how much stock is left in this iceberg order? What do you mean? The problem cannot be solved precisely, since V and p are both arbitrary values, which can be determined by the sub-individual. However, it can be considered from two points of view: first, both values are integers; and second, humans are not perfect random number generators, and the decision will follow certain laws.

From these two points, one can construct a probability model for V and p, i.e. calculate the probability of a given combination of V, p values. Without going into the mathematical analysis, interested friends can look it up for themselves. Simply put, one can estimate the shape of their probability density function on historical data using the kernel estimation technique.

img

This way, when you observe a value of p in real-time data, you can derive a conditional probability density function of the corresponding V value, i.e. a cross-section of the above graph, such as ((p = 8):

img

Next, it is obviously easy to calculate what V is most likely to be. The functional curve also has an important role to play in helping you dynamically evaluate the residual stock, for example when you observe that 5 p have already been consumed, you can infer that V > = 40, and from the above diagram you can infer new V values and residual stock ((V-5p)).

img

In summary, the core of the algorithm is to judge the existence of iceberg orders by observing three related records that appear consecutively over a short period of time in real-time data, while quantifying iceberg orders is done by using a probability model trained on historical data.

I'm sure you'll see that this algorithm is not a cheating tool. It's just a speculation based on open market data. It's also based on probability, and more should be a reference. It makes sense to marketers like liquidity providers, so they can avoid losses due to misjudgments of the situation.

Finally, the algorithm is only targeted at a specific exchange. Other exchanges may not use the same iceberg order processing method. So what is really valuable is this modeling idea based on real data, and the specific algorithm is not worth it.

This little algorithm shows you the edge of the iceberg in the field of high-frequency trading. It may not seem complicated, but I like it because it clearly shows what is called thinking first and then quantifying. Because there is an iceberg of orders for a real demand that starts from the basic supply-demand relationship in economics, finds a clue by analyzing the actual data, and finally carves out a quantitative strategy using a mathematical model, this is a beautiful strategy research.

If this principle is violated, then moving to a different high-end model and expecting the model to automatically generate trading signals for you is just a crazy dream in my opinion. Unfortunately, the dream is too tempting, and the world is never short of cowards. And walk and cherish it.

Translated from Seven Hay NetLinks


More