Translator's note: Earlier in our blog on Habré, we looked at various stages of developing trading systems (there are online courses on the topic), and even described the development of an event-oriented backtest module in Python. Today we bring to your attention the continuation of the story about how HFT-traders in the process of development simulate the behavior of people who will resist their trading robots on the exchange.
Using the example of the
previous material, we have seen how one of the properties of HFT orders, their high failure rate, can be used to evaluate various types of orders when forming the basis of a trading strategy. In this post, we will look at one more feature and a simple strategy based on it. A characteristic feature of this and the previous material is that they describe the obvious features of high-frequency orders.
')
If we talk about stereotypes about HFT-trading, the first thing that comes to mind (after frequent failures) is a small average value of the transaction [1]. It is believed that traders of any type who use algorithms in their work place small “waiting” orders. HFT market makers do this because they want to selectively trade with small, aggressive players to avoid loss of liquidity at the entire price level. Algorithms that increase liquidity place small orders, since they need to hide their intention to trade in larger volumes in order to keep the price at the right level as long as possible.
Naturally, with aggressive trading, things can be somewhat different - algorithms that seek to “hide their intentions” are at risk from other robots: they can use the liquidity remaining in the chosen price range. For aggressive HFT algorithms, this desire not to impersonate does not matter, so it is assumed that they eliminate all liquidity that can bring profit. However, in the previous article, we noted that for aggressive traders from the EdgeX exchange, this behavior, oddly enough, is uncharacteristic.
In view of the above, we will find out whether, according to the market, this tendency of placing small orders by robots can be revealed. We could just follow the behavior of orders of different sizes after the transaction, but it would be better to take into account all orders at the current price level. And if this is possible, then we will take them into account on all exchanges. To do this, you can measure a variety of indicators, but I will compare situations when there are no orders on any of the exchanges at the time of the transaction, the size of which is much less than 2 whole lots (200 stocks).
Top chart: Dependence of trading results on the market value on the Nasdaq exchange, taking into account the “age” of the order and the presence of orders of no more than 201 shares at a given price. Under the size of the order refers to the initial size at the time of the appearance of the order in the summaries of data on the market, excluding any changes in its size due to execution, processing or updating the system. Orders placed for trust trading are included in the sample. Commission and compensation payments are not taken into account; in the sample there are no data for some exchanges. Bottom chart: the volume of shares on the Nasdaq, taking into account trust trading.
The same graphics for EdgeX. The bottom chart also shows the stock volume on the Nasdaq
The strong influence of the presence of small orders on the long-term results of the transaction is noticeable. If there are no small orders on the Nasdaq exchange and the processed order has been placed recently (less than 1 second ago), the passive side in the auction has a negative impact on their outcome. It is worth noting that self-sufficiency on the Nasdaq with passive trading, in principle, can bring considerable income because of the size of compensation payments of approximately 0.30 cents.
This fact contradicts the earlier hypothesis that the absence of small orders may indicate a smaller number of bidding algorithms and reduced risk. I didn’t check if this is really true, but this behavior may correspond to the placement of large orders by robots during sharp fluctuations in the glass in an attempt to get compensation.
If the entire market knows that the price is close to the approximate value of a tick, it can be assumed that anyone who places orders to buy / sell faster than others will be able to receive compensation. In such a situation, it would be logical to place large orders. Such actions are a common speculation, but they, by and large, would indicate an unfavorable market situation in our examples.
The situation will change completely if we take a look at the orders placed on the Nasdaq more than a second ago, which corresponds to the initial hypothesis. The absence of small orders on the Nasdaq corresponds to quite low liquidity, while after trading we lose almost a cent. The same happens with orders placed both a long time ago and recently on EdgeX: the “age” of orders and their size only reinforces the effect. The situation is repeated on all the exchanges I have reviewed. I can not say why Nasdaq stands out in the presence of recently placed orders in the auction, but I note that this is the fastest investment exchange with an intensive flow of messages, and exchanges can behave quite peculiarly without access to the best quotation system (NBBO).
If the market functioned truly efficiently, we would most likely be faced with a much less strong effect of this kind. One can imagine, for example, how aggressive traders would become less active if there were a certain proportion of small orders on the market. This would have prompted market makers and passive algorithms to place larger orders in order to trade with these players. In the end, we would notice how the effect decreases or disappears. I note that the mechanisms for implementing this approach do not quite correspond to the mechanisms for reducing the effect of the difference between long-standing and recently placed orders; As a rule, the algorithm can easily change the size of the order, but it will be difficult for it to change the duration of its exposure.
Now we can select low-risk “waiting” orders using this method; we can model the strategy just as we did in the previous post. Namely:
- We monitor all orders on all available exchanges, the size of which did not exceed 201 shares at the time of their placement.
- If the order placed more than 5 seconds ago has started to be executed, while there are no small orders on the market or recently (less than 100 ms back) placed orders, then
- We send orders to other exchanges at the same price. In the previous example, we traded in one tick more aggressively, but here we cannot simulate the same situation, because this strategy is not limited to expensive stocks.
Note that the strategy is not verified. If we use the Nasdaq data as signal data, we get the following result:
Top chart: The dependence of the results of simulated trades on the market price on different exchanges. The simulation was conducted during the week in August 2014. The size of each simulated order is 100 shares. Bottom chart: The volume of Nasdaq shares excluding simulated trades.
The volume is small, but, nevertheless, even with the deduction of the commission we get a decent net profit, especially on EdgeX. EdgeX, as we have already seen, can accept larger orders. If you send orders with a volume of 1000 shares on EdgeX, then this strategy will bring about 5 thousand dollars a day only in this direction. This is just an example, but I note that the Nasdaq-> EdgeX pair is not the only one that is suitable for this strategy, especially if we have a restriction on trading in cheap stocks. In addition, if we are going to trade in expensive shares of 1 cent more aggressively [of the market], the volume may be much larger.
Once again, we noted the importance of tracking the characteristics of counterparty orders. It's pretty funny that we can use such stupid HFT stereotypes in order to get fairly predictable results. As if the whole community of algorithmic traders are not aware of their influence on the market.
[1] In the introduction to
the literature review compiled by the Securities and Exchange Commission, it says:
The main characteristics of high-frequency trading are the high transfer rate of messages, a sharp increase in the number of refusals and changes in orders, a high indicator of the volume of transactions made, the small size of transactions and an increase in trading speed. These characteristics are usually associated with the more common phenomenon of algorithmic and automated trading in one form or another.