Articles related to algo trading and software tools aiding automated investment operations.

How Artificial Intelligence will revolutionize wealth management

by Michal Rozanski, CEO at Empirica

Most wealth managers are in deep denial about robo advice. They say they need human interaction in order to understand the nuances of financial lives of their customers. And their clients value the human touch. They’re wrong. Soon robo advice will be much more efficient than human advice ever was.

In this post, we will share the results of our analysis on the most important areas where the application of machine learning will have the greatest impact in taking wealth management to the next level.

What Artificial Intelligence is and why you should care

 “Computers can only do what they are programmed to do.” Let us explain this is huge misconception, which was only valid because of limited processing power and memory capacity of computers. Most advanced programs which mimic specialized intelligences, known as expert systems, were indeed programmed around a set of rules based on the knowledge of specialists within the problem’s domain. There was no real intelligence there, only programmed rules. But there is another way to program computers, which makes them work more similarly to the functions of the human brain. It is based on showing the program examples of how certain problems can be solved and what results are expected. This way computers equipped with enough processing power, memory and storage are able to recognize objects in photographs, drive autonomous cars, recognize speech, or analyse any form of information which exhibits patterns.

 

We are entering the age where humans are outperformed by machines in activities related with reasoning based on the analysis of large amounts of information. Because of that finance and wealth management will be profoundly changed during the years to come.

 

Real advice – combining plans with execution

 A great area for improvement in finance management is the combination of long term wealth building with the current financial situation of the customer as reflected by his bank account. For robo-advisors, an integration with bank API opens the door to an ocean of data which, after analysis, can dramatically improve the accuracy of advice provided to the customer.

By applying a machine learning capabilities to a customer’s monthly income and expenses data, wealth managers will gain a unique opportunity to combine two perspectives – the long term financial goals of their customers and their current spending patterns. Additionally, there is the potential of tax, mortgage, loans or credit card costs optimization, as well as using information on spending history to predict future expenditures.

By integrating data from social media, wealth management systems could detect major changes in one’s life situation, job, location, marital status or remuneration. This would allow for automated real time adjustments in investment strategies of on the finest level, which human advisors are simply unable to deliver.

New powerful tools in the wealth manager’s arsenal

Hedge funds that are basing their strategies on AI have provided better results over the last five years than the average (source Eurekahedge). What is interesting is that the gap between AI and other strategies has been growing wider over the last two years, as advancements in machine learning accelerated.

The main applications of machine learning techniques in wealth management, can be categorized following cases:

  •       Making predictions on real-time information from sources such as market data, financial reports, news in different languages, and social media
  •       Analysis of historical financial data of companies to predict the company’s cash flow and important financial indicators based on the past performance of similar companies
  •       Analysis of management’s public statements and activity on social networks in order   to track the integrity of their past words, actions and results
  •       Help in accurate portfolio diversification by looking for uncorrelated instruments which match requirements of the risk profile
  •       Generation of investment strategies parametrized by goals such as expected risk profiles, asset categories, and timespan, resulting in sets of predictive models which may be applied in order to fulfill the assumptions

 To give an example of machine learning accuracy, the algorithms for sentiment analysis and document classification are already on acceptable levels, well above 90%.

Automated execution

When it comes to the execution of the actual orders behind portfolio allocation and rebalancing strategies, many robo-advisors are automating these processes passing generated orders to brokerage systems. The next step would be autonomous execution algorithms, that take under consideration the changing market situation and learn from incoming data, allowing for increased investment efficiency and reduced costs.

Machine learning can be applied to quantitative strategies like trend following, pattern recognition, mean reversion, and momentum, as well as the prediction and optimization of statistical arbitrage, and pairs trading. Additionally, there is a possibility to apply machine learning techniques in, already quite sophisticated, execution algorithms that help execute large orders by dividing them to thousands of smaller transactions without influencing the market while adjusting their aggressiveness to the market situation.

What’s interesting is that algorithms could also be trained to make use of rare events, like market crashes and properly react in milliseconds, already knowing the patterns of panic behaviour and shortages of liquidity.

Explaining the markets

In wealth management systems, if portfolio valuations are provided to the customers in real time, then so should explanations of the market situation. Every time the customer logs in to the robo-advisor, she should see all required portfolio information with a summary of market information relevant to the content of her portfolio. This process includes the selection of proper articles or reports concerning companies from the investor portfolio, classification and summarization of negative or positive news, and delivering a brief overview.

Additionally, machine learning algorithms can be used to discover which articles are read by customers and present only those type of articles that were previously opened and read by the customer.

The result will be not only the increase in customer understanding but also, by providing engaging content to investors, the increase in their engagement and commitment to portfolio strategy and wealth management services.

 

Talking with robots

The ability to deliver precise explanations of the market situation in combination with conversational interfaces aided by voice recognition technology will enable robo-advisors to provide financial advice in a natural, conversational way.

Voice recognition is still under development, but it could be the final obstacle on they way to redesigning human-computer interaction. On the other hand, thanks to deep learning, chatbot technology and question answering systems are getting more reliable than ever. KAI, the chatbot platform of Kasisto, who has been trained in millions of investment and trade interactions, already handles 95 % of all customer queries for India’s digibank.

Decreasing customer churn with behavioral analysis

The ability to track all customer actions, analyzing them, finding common patterns in huge amounts of data, making predictions, and offering unique insights for fund managers delivers a powerful business tool not previously available to wealth managers. What if nervousness caused by portfolio results or market situation could be observed in user behaviour within the system?  This information, combined with the results of investments and patterns of behaviour of other investors, can give a wealth manager the possibility to predict customer churn and react in advance.

When speaking with wealth management executives that are using our robo-advisory solutions, they indicate behavioural analysis as one of the most important advancements to their current processes. Customers leave not only when investment results are bad, but also when they are good if there is a fear that the results may not be repeated in the future. Therefore, the timely delivery of advice and explanations of market changes and the current portfolio situation are crucial.

The same model we used to solve the behavioral analysis problem has been proven to predict credit frauds in 93.07% of cases.

Summary

Other areas of applying machine learning in the processes supporting wealth management services could be:  

  •       Security based on fraud detection which actively learns to recognize new threats
  •       Improving sales processes with recommendations of financial products chosen by similar customers
  •       Psychological profiling of customers to better understand their reactions in different investment situations      
  •       Analysis and navigation of tax nuances   
  •       Real estate valuation and advice

 Implementing these AI functions in wealth management systems will be an important step towards the differentiation of the wealth managers on the market. Today’s wealth managers’ tool set will look completely different in five years. Choosing an open and innovative robo-advisory system that tackles these future challenges is crucial. Equally important will be wealth managers’ incorporation of data analytic processes and the use of this data to help their customers.

Artificial intelligence is poised to transform the wealth management industry. This intelligence will be built on modern software platforms that combine data from different sources, process it, and transform it into relevant financial advice. The shift from data gathering systems to predictive ones that help wealth managers to understand the data, has already started. And wealth management is all about understanding the markets and the customers.

 

 

Algorithmic crypto trading: market specifics and strategy development

By Marek Koza, Product Owner of Empirica’s Algo Platform

Among trading professionals, interest in crypto-currency trading is steadily growing. At Empirica we see it by an increasing number of requests from trading companies, commonly associated with traditional markets, seeking algorithmic solutions for cryptocurrency trading. However, new crypto markets suffer from old and well-known problems. In this article, I try to indicate the main differences between traditional and crypto markets and take a closer look at a few algorithmic strategies that are currently effective in the crypto space. Differences between crypto and traditional markets constitute an interesting and deep subject in itself which is evolving quickly as
the pace of change in crypto is also quite fast. But here I only want to focus on algorithmic trading perspectives.

 

Read more about our tool for market making strategies for crypto exchanges  – Liquidity Engine

 

LEGISLATION

First, there is a lack of regulations in terms of algorithmic usage. Creating DMA algorithms on traditional markets requires a great deal of additional work to meet reporting, measure standards as well as limitations rules provided by regulators (e.g., EU MiFIDII or US RegAT). In most countries crypto exchanges have yet to be covered by legal restrictions. Nevertheless, exchanges provide their own internal rules and technical limitations which, in a significant way, restricts the possibility of algorithmic use, especially in HFT field. This is crucial for market-making activities which now requires separated deals with trading venues.

 

DERIVATIVES

As for market-making, we should notice an almost non-existent derivatives market in the cryptoworld. Even if a few exchanges offer futures and options, they only apply to a few of the most popular cryptocurrencies. Combining it with highly limited margin trading possibilities and none of index derivatives (contracts which reflect wide market pricing), we see that many hedging strategies are almost impossible to execute and may only exist as a form of spot arbitrage.

 

 

 

 

 

 

 

 

 

 

 

 

As for market-making, we should notice an almost non-existent derivatives market in the cryptoworld. Even if a few exchanges offer futures and options, they only apply to a few of the most popular cryptocurrencies. Combining it with highly limited margin trading possibilities and none of index derivatives (contracts which reflect wide market pricing), we see that many hedging strategies are almost impossible to execute and may only exist as a form of spot arbitrage.

 

DECENTRALIZATION

The above-mentioned facts are slightly compensated for by the biggest advantage of blockchain currencies – fast and direct transfers around the world without banks intermediation. With cryptoexchange APIs mostly allowing automation of withdrawal requests, it opens up new possibilities for algorithmic asset allocation by much smaller firms than the biggest investment banks. This is important due to two things. Firstly, there is still no one-stop market brokerage solution we know from traditional markets. Secondly, cryptocurrencies trading is distributed among many exchanges around the world. It could therefore be tricky for liquidity seekers and heavy volume execution. It implies there is still much to do for execution algorithms such as smart order routing.

 

CONNECTIVITY

A smart order routing strategy GUI

Another difference is direct market access for algorithmic trading. While on traditional markets DMA is costly, cryptocurrency exchanges provide open APIs for all their customers that may be used without upfront prerequisites. Although adopted protocols are usually easy to implement, they are often too simplistic. They do not usually offer advanced order types. Besides, order life-cycle status following is cumbersome and trading protocols differ among exchanges since each one requires its own implementation logic. That makes a costly technical difference compared to traditional markets with common standards, including FIX protocol.

 

MARKET DATA

Fast, precise and up-to-date data are crucial from an algorithmic trading perspective. When a trader develops algorithms for crypto-trading, she should be aware of a few differences. APIs provided by crypto-exchanges give easy access to time & sales or level II market data for everyone for free. Unfortunately, data protocols used in the crypto space are unreliable and trading venue systems often introduce glitches and disconnections. Moreover, not every exchange supports automatic updates and an algorithm has to issue a request every time it needs to check on the state of a market, which is difficult to reconcile with algorithmic strategies.

The APIs of most exchanges allow downloading of historical time & sale data, which is important in the algorithmic developing process. However, historical level II data are not offered by exchanges. We should also notice that despite being immature, the systems of crypto trading venues are evolving and becoming more and more professional. This forces trading systems to follow and adapt to these changes, which adds big costs to systems’ maintenance. In the following sections I overview a few trading algorithms that are currently popular among crypto algo traders because of the differences between traditional and crypto markets listed above.

 

SMART ORDER ROUTING

Liquidity is and most probably will remain, one of the biggest challenges for cryptocurrency trading. Trading on bitcoin and etherium and all other altcoins with smaller market capitalisation, is split among over 200 different exchanges. Executing a larger volume on any type of assets often requires seeking liquidity on more than one trading venue. To achieve that, cryptocurrency traders may apply smart order routing strategies. These follow limit order books for the same instrument from different exchanges and aggregates them internally. When an investment decision is made, the strategy splits the order among exchanges that offer best prices for the instrument. A well-designed strategy will also manage partially filled orders left in the order book in case some volume disappears before the order has arrived at the market. This strategy could be combined with other execution strategies such as TWAP or VWAP.

Empirica algorithmic trading platform front-end app (TradePad) for crypto-markets.

 

ARBITRAGE

The days when simple crossexchange arbitrage was profitable with manual execution are over. Nowadays price differences among exchanges for the most actively trading crypto-assets, are much smaller than a year ago and transactional and transfer costs (especially for fiat) still remain at a high level. Trading professionals are now focused towards using more sophisticated arbitrage algorithms such as maker-taker or triangular arbitrage. The former works by quoting a buy order on one exchange, based on VWAP for a particular amount of volume from another exchange (the same instrument) decreased by expected fees and return. A strategy is actively moving quoted order and if the passive gets executed, it sends a closing order to the other exchange. As the arbitrage is looking for bid-bid and ask-ask difference and maker fees are often lower, this type of arbitrage strategy is more cost-effective.

Triangular arbitrage may be executed on a single exchange because it is looking for differences among three currency pairs which are connected to each other. To illustrate, let us use this strategy with BTCUSD, ETHUSD and ETHBTC pairs. This strategy keeps following order books of these three instruments. The goal is to find the inefficient quoting and execute trades on three instruments simultaneously. To understand this process, we should notice that ratio between BTCUSD and ETHBTC should reflect the ETHUSD market rate. Contrary to some FX crosses, all cryptocurrency pairs are priced independently. This creates numerous possibilities of using triangular arbitrage in crypto space.

 

MARKET MAKING

Market making should be considered more as a type of business than as just a strategy. The main task of a market maker is to provide liquidity to markets by maintaining bid and ask orders to allow other market participants to trade any time they need. Since narrow spreads and adequate prices are among the biggest
factors of exchange’ attractiveness, market making services are in high demand. On the one hand, crypto exchanges have special offers for liquidity providers, but on the other hand, they require from new coins issuers a market maker before they start listing an altcoin.

These agreements are usually one source of market maker income. Another one is a spread – a difference between a buy and a sell prices provided to the other traders. The activity of a market maker is related to some risks. One of them is inventory imbalance – if a market maker buys much more than sells or sells much more than buys, she stays with an open long or short position and takes portfolio risk, especially on volatile crypto markets. This situation may happen in markets with a strong bias, or when market maker is quoting wrong or delayed prices, which will immediately be exploited by arbitrageurs. To avoid such situations, market makers apply algorithmic solutions such as different types of fair price calculations, trade-outs, hedging, trend and order-flow predictions, etc. Technology and math used in market making algorithms are an interesting subject for future articles.

 

Read more about our tool for market making strategies for crypto exchanges  – Liquidity Engine

 

SUMMARY

Fast developing crypto markets are attracting a growing number of participants, including more and more trading professionals from traditional markets. However, the crypto space has its own specificity such as high decentralization, maturing technology and market structure. Compared to other markets, these differences make some strategies more useful and profitable than others. Arbitrage – even simple cross-exchange is still very popular. Market making services are in high demand. Midsized and large orders involve execution algorithms like smart order routing. At the end of the day to embrace the fast changing crypto environment, one needs algorithmic trading systems with an open architecture that evolves alongside the market.

 

To see the original article click the button on the right.

 

Bitcoin and Arbitrage: hand in hand

VWAP Algorithm

Volume-Weighted Average Price known as VWAP is one the most basic and commonly used market indicators by traders around the world. In a book “Algorithmic & Trading DMA” we can read about VWAP that  “As a benchmark, it rapidly became ubiquitous since it gives a fair reflection of market conditions throughout the day and is simple to calculate. This led to algorithms that tracked the VWAP benchmark becoming extremely popular.”

 

Read more on how we develop trading algorithms for capital and cryptocurrency markets

 

Calculations

 

Calculation of VWAP it’s relatively simple and it can be done even on piece of paper for small amount of data. In mathematical approach VWAP is represented by equation below:

 

wzor 1.jpg

 

where P is the price of i-th trade and V is the size related to i-th trade. In fact it takes five steps to calculate your first VWAP. First, only if we use intraday data for examination, we need to calculate typical price for our intervals. Then multiply the price by period’s volume and create running total of these values for future trades. Fourthly we create cumulative volume and in the end we divide cumulative multiplication of price and volume by running total of volume to obtain VWAP. Even simpler, VWAP is a turnover divided by total volume.

 

Let’s take a look at example results calculated using these five steps on 1-minute interval intraday Morgan Stanley’s data.

Time Close High Low Open Volume Typical Price Price*Volume Total PV Total Volume VWAP
09:30:00 38.90 38.96 38.90 38.96 69550 38.93 2707581.50 2707581.50 69550.00 38.930
09:31:00 38.94 38.97 38.86 38.92 27617 38.92 1074922.68 3782504.18 97167.00 38.928
09:32:00 38.91 38.96 38.91 38.94 11441 38.93 445398.13 4227902.31 108608.00 38.928
09:33:00 38.89 38.94 38.88 38.92 23587 38.91 917710.61 5145612.93 132195.00 38.924
09:34:00 38.90 38.94 38.90 38.90 10771 38.91 419099.61 5564712.54 142966.00 38.923
09:35:00 38.97 38.97 38.90 38.90 12721 38.93 495276.23 6059988.77 155687.00 38.924
09:36:00 38.92 38.96 38.92 38.96 16471 38.94 641384.86 6701373.63 172158.00 38.926
09:37:00 38.90 38.93 38.86 38.93 23788 38.91 925472.14 7626845.77 195946.00 38.923
09:38:00 38.90 38.92 38.89 38.89 9170 38.90 356701.54 7983547.30 205116.00 38.922
09:39:00 38.92 38.92 38.88 38.91 4644 38.91 180682.02 8164229.32 209760.00 38.922
09:40:00 38.90 38.92 38.88 38.91 4917 38.90 191283.59 8355512.92 214677.00 38.921

All calculations are pretty straightforward, but let us take a look at one interesting element. When you look at typical prices more than half of them (7/11) is below the last VWAP At the same time mean equals 38.917. So where does the difference come from? Volume is the culprit. In our case, period with higher typical price also has bigger Volume, thus bigger market impact and VWAP calculations indicate that.

 

Intraday or tick

 

The most classical VWAP approach is based on tick-by-tick data. But as the market grows and frequency of trades increases more resources are required to keep all calculations up-to-date. Nowadays it is nothing extraordinary for stock to have over hundred trades per minute (true or false?). When multiplied by minutes in a trading day and number of stocks it develops into numbers that might cause some performance troubles.

 

With help arrives intraday data, i.e. tick-by-tick data aggregated in time periods e.g. 1-minute, 5-minute or 15-minute that contains close, high, low and open price. As in VWAP calculations only one price is required we have to somehow average available prices. For this task exist typical price:  

 

typical

 

Also there is a second version of typical price that includes Open Price and it’s divided by 4.

 

Strategy

 

Most likely we can point out two different strategies of reading VWAP. First one used especially by short-term traders relies on waiting for VWAP to cross above the market price and then enter long position as they interpret price to be bullish. On the other hand are Institutions looking to sell at this moment because they consider it as good opportunity for that day’s price.

 

When the price goes below VWAP value, the trend seems to be down. Institutions recognize it as good moment to buy, but short-term trader will look to short that stock.   

 

Surely it’s basic approach to VWAP interpretation. For your strategy you would like to scrutinize e.g. influence of price deviation from VWAP value. You should consider that VWAP behaves differently based on period of trading day. It’s because of VWAP cumulative nature. VWAP value is very sensitive for price changes at the beginning of day, but insensitive at the end of trading day.

 

Big Fish

 

VWAP is surely commonly used between traders with strategies described above, but on the market there is a bunch of various indicators like VWAP that can suggest when to buy or sell shares. But there is other side of the fence.

 

Let’s say you want to buy 5 million shares of Morgan Stanley that is 37% of average daily volume in 2014. You cannot buy them at once, because that will impact significantly the market and the market will start to go against you. What you want to do is split the order in small pieces and execute them without impacting the market. Doing it by hand would be backbreaking, that’s what trading application has been made for.

 

Using trading application and VWAP Strategy, utilizing historical minute intraday files, you can easily generate average volume period profiles that will steadily buy proper number of shares without impacting the market.

 

Improve your VWAP

 

As we mentioned in previous paragraph there is a way to improve VWAP performance by creating volume profiles based on historical data. According to Kissel, Malamut and Glantz optimal trading strategy to meet VWAP benchmark can obtained by using equation:

 

wzor 3.jpg

 

where X is the total volume traded, uj is percentage of daily volume traded and xj is target quantity for each j-th period. Hence, VWAP can be calculated as below:

 

wzor 4

 

wherePj is the average price level in each period.

 

Read more on how we develop trading algorithms for capital and cryptocurrency markets

 

Summary

 

VWAP is really simple indicator although it can be interpreted in various ways depending on goal and approach of the trader. It is mainly used by mutual and pension funds, but also by short-term traders. Aside from buying/selling small amount of shares, VWAP might be used as strategy for trading  huge number of shares without impacting the market. “Simplicity leads to popularity.”

 

References

  1. Berkowitz, S., D. Logue, and E. Noser. “The Total Cost of Transactions on the NYSE.”Journal of Finance,41 (1988), pp.97-112.
  2. H. Kent Baker, Greg Filbeck. “Portfolio Theory of Management” (2013) , pp.421
  3. Barry Johnson “Algorithmic & Trading DMA – An introduction to direct access trading strategies” (2010), pp. 123-126

 

Free version of Algorithmic Trading Platform for retail investors

We have just released beta of Empirica – Algorithmic Trading Paltform for retail investors! It’s lifetime free for development, testing and optimizing of trading algorithms.

Our development team (exactly this team who implemented the entire system) also provides full support in algorithms development as well as connectivity to brokers. If you need help just contact us.

Among many features what is unique is our exchange simulation where you can influence market conditions under which you test your algorithms. No others software offers such a realistic level of simulation.

In paid versions we offer the execution of algorithms in robust server side architecture.

We strive for your feedback!

Best regards,

Michal Rozanski
Founder and CEO at Empirica
twitter: @MichalRoza
https://empirica.io


Empirica Trading Platform – https://empirica.io

Our platform implemented by large brokerage house!

Empirica has successfuly finished the implementation of its Algorithmic Trading Platform in one of the largest brokerage houses in Poland.

Brokerage house will use our software to:

  • aid its internal trading operations, like market making of derivatives on Warsaw Stock Exchange
  • offer functionalities of our platform to its institutional clients, which will be able to build, test and execute their own algorithmic trading strategies

Implementation included connecting of our software system directly to the system of Warsaw Stock Exchange (Universal Trading Platform delivered by NYSE Technologies), as well as the integration with transaction systems of brokerage house. Additionally we have fulfilled and successfuly passed tests regarding the highest security, stability and performance requirements.

This implementation is an important milestone for our system. The usage by team of market makers is a proof that our system is capable of performing high-throughput and low latency operations on level required by most sophisticated traders on the capital marketets.

 

Next release of our algorithmic platform. Version 1.3.4 – has code name “The Firebolt”.

Next implementations of our Algorithmic Trading Platform by customers don’t stop us from developing the platform itself. Working agile requires us to keep the pace in short and frequent iterations, which in case of product means frequent releases, keeping the whole product line stable.

A few iterations that we planned in our 1.3.4 release, code named by our developers ‘The Firebolt’, will include among others:

– even faster real-time replication of all server-side components in master-slave mode (for deployment in larger institutions)

– extended client side backtesting capabilities

– sophisticated charting of backtesting results and statistics

– multiscreen mode of client side application

– additional web-based server-side module for administration & management

 

For those curious about the release name and unfamiliar with Harry Potter, Firebolt is:

“The state-of-the-art racing broom. The Firebolt has unsurpassable balance and pinpoint precision. Aerodynamic perfection.”
—Harry Potter: Quidditch World Cup

“The Firebolt has an acceleration of 150 miles an hour in ten seconds and incorporates an unbreakable Braking Charm. Price upon request.”
—Harry reads about the features of the Firebolt.

Speed, precision, balance, perfection. These are the words that describe our software, therefore choosing the code name was kind of obvious :).

 

The Firebolt broom

HFT – the good, the bad and the ugly

High Frequency Trading, known also as HFT, is a technology of market strategies execution. HFT is defined by technically simple and time costless algorithms that run on appropriate software optimized for data structures, level of memory usage and processor use, as well as suitable hardware, co-location and ultra low-latency data feeds.

 

Although HFT exists on the market for over 20 years, it has became one of the hottest topic during past few years. It is caused by several factors, such as May 6, 2010, “Flash crash”, latest poor situation on the market and Michael Lewis book – “Flash Boys”. Let’s look where all that fuss comes from.

 

The Bad

 

Among other things, the advantage over other market participants and ability to detect market inefficiencies is the reason why so many people critics HFT so much. Most common charges put on the table are:

 

  • Front Running – HFT companies use early access to incoming quotes to buy shares before other investors and then turn around and sell him just bought shares with slightly bigger price.
  • Quote Stuffing – Way of market manipulation by quick sending and withdrawing large number of orders. Because of speed of operations, it creates a false impression of the situation on the market that leads other participants to executing against phantom orders. Then there is nothing else to do, but to exploit favorable prices by HFT investors.
  • Spoofing – Another method for market manipulation by placing orders and then cancelling them for price increase/decrease. It is based on placing big order on the market to bait other investors, and when the market starts to react, quickly cancel it. Then new price allows to gain some profit by HFT investor.

 

But that’s just a tip of the iceberg. It can be often heard that there is lack of proper HFT regulations, exist false belief that there are Dark Pools without any regulations where HFT companies can hide their activity, and there is still active argument if HFT brings liquidity to the market or just useless volume.

 

The Ugly?

 

Bill Laswell once said “People are afraid of things they don’t understand. They don’t know how to relate. It threatens their security, their existence, their career, image.” That phrase perfectly fits to what is happening now on High Frequency Trading topic. When people would like to take a closer look on how exchanges work, probably, they would be less sceptic to High Frequency Trading.

 

Thus, on most, maybe even on all, exchanges exist two mechanism which can efficiently handle problem of quote stuffing and spoofing. First of them is limitation of number of messages per second that can be send from one client. For example on New York Stock Exchange there is a limit of 1000 messages/sec, so it means that if HFT company burst whole 1000 of messages in first half of the period, in second half it cannot send any message, so it’s cut out of the market. Other limitation used by exchanges is a limit of messages per trade. It hits even harder in quote stuffing and spoofing. In most of the cases limit is around 500 messages per trade and if someone exceed it then he should be prepared for fines. On top of it company that frequently break limits could be banned from exchange for some time.

 

If we talk about front running, first thing we have to know is a fact that front running, in the dictionary meaning, is illegal action, and there are big fines for caught market participants who use it. Front running is using informations about new orders before they will go to the order book. Let’s say Broker gets new order with price limit to process, but before putting it to exchange, he will buy all available shares at better price than limit and then he execute client’s new order at limit getting extra profit. That’s highly not allowed and that’s not what HFT companies do.

 

All they do is tracking data feed, analyzing quotes, trades, statistics and basing on that information they try to predict what is going to happen in next seconds. Of course, they have advantage due to latency on data feed and so on, because of co-location, better connection and algorithms, but it’s still fair.

Hft-scalping-for-large-orders.svg

(source: Wikipedia)

 

HFT companies have to play on the same rules as other market participants, so they don’t have any special permits letting them do things not allowed for others. Same with Dark Pools, specially that they are regularly controlled by Finance Regulators.

 

The Good

 

First, we have to know that suppliers of liquidity, i.e. Market Makers and some investors use HFT. They place orders on both sides of the book, and all the time are exposed to sudden market movement against them. The sooner such investors will be able to respond to changes in the market, the more he will be willing to place orders and will accept the narrower spreads. For market makers the greatest threat is the inability to quickly respond to the changing market situation and the fact that someone else could realize their late orders.

 

System performance in this case is a risk management tool. Investments in the infrastructure, both a software and hardware (including co-location), are able to improve their situation in terms of risk profile. The increase in speed is then long-term positive qualitative impact on the entire market, because it leads to narrowing of the spread between bids and offers – that is, reduce the transaction costs for other market participants, and increase of the liquidity of the instruments.

 

HFT AND MARKET QUALITY

 

In April of 2012. IIROC (Investment Industry Regulatory Organization of Canada), the Canadian regulatory body, has changed fee structure based so far only on the volume of transactions, adding the tariffs and fees that also take into account the number of sent messages (new orders, modifications and cancellations). In result, introducing new fees made trading in the high frequencies more difficult. It was very clearly illustrated by data from the Canadian market.

 

Directly in the following months these fees caused a decrease in the number of messages sent by market participants by 30% and hit, as you might guess, precisely the institutions that use high-frequency trading, including market makers. The consequence for the whole market was increase in the average bid-ask spread by 9%.

NO PLACE FOR MISTAKES

 

When people talk about HFT, both enthusiast and critics, it is not rare to hear that HFT is risk free. Well, on the face of it, after analyzing how HFT works you would possibly agree with it, but there is a dangerous side of HFT that can be not so obvious and people often forgot about it. HFT algorithms works great if the code is well written, but what would happen if someone would run wrong, badly tested or incompatible code on a real market?

 

We don’t have to guess it, because it happened once and it failed spectacularly, it was a “Knightmare”. Week before unfortunate 1st of August Knight Capital started to upload new version of its proprietary software to eight of their servers. However Knight’s technicians didn’t copy the new code to one of eight servers. When the market started at 9:30 AM and all 8 server was run, the horror has begun. Old incompatible code messed up with the new one and Knight Capital initiated to lose over $170,000 every second.

(source: nanex.net)

It was going for 45 minutes before someone managed to turn off the system. For this period Knight Capital lost around $460 million and became bankrupt. That was valuable lesson for all market participants that there is no place for mistakes in HFT ecosystem, because even you can gain a lot of money fast, you can lose more even faster.

 

SUMMARY

 

HFT is a natural result of the evolution of financial markets and the development of technology. Companies that invest their own money in technology in order to take advantage of market inefficiencies deserve to profit like any other market participant.

 

HFT is not as black as is painted.

 

Aldridge, Irene (2013), High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems, 2nd edition, Wiley,

 

Warsaw Stock Exchange certifies our Trading Platform

 

Empirica’s Algorithmic Trading Platform has successfully passed the XDP protocol communication certification, issued by the Warsaw Stock Exchange.

From now on Empirica is officially listed as the ISV (Independent Software Vendor) for the Warsaw Stock Exchange.

WSE uses Universal Trading Platform delivered by NYSE Technologies. The same system is used by many other European and world stock exchanges. Fulfilment of technical criteria of Warsaw Stock Exchange makes certification for those markets only a formality for our platform.

TWAP Algorithm

Time-Weighted Average Price (TWAP) is another trading algorithm based on weighted average price and in compare to Volume-Weighted Average Price its calculations are even simplier. Also it’s one of the first execution algorithms and unlike most algorithms nowadays it’s passive execution algorithm that waits for proper market price to come, doesn’t chase it.

 

Calculations

 

As TWAP doesn’t bother about volume it’s extremely simple to obtain it. All it takes is to get Typical Price for every period bar using equation below and then calculate average of Typical Prices.

 

Read more on how we develop trading algorithms for capital and cryptocurrency markets

 

 

Typical Price = (Close+High+Low+Open)/4

 

Let’s just take a look at example results calculated on 1-minute interval intraday Morgan Stanley’s stock.

 

Time Close High Low Open Typical Price TWAP
09:30:00 38.90 38.96 38.90 38.96 38.93 38.930
09:31:00 38.94 38.97 38.86 38.92 38.92 38.926
09:32:00 38.91 38.96 38.91 38.94 38.93 38.928
09:33:00 38.89 38.94 38.88 38.92 38.91 38.922
09:34:00 38.90 38.94 38.90 38.90 38.91 38.920
09:35:00 38.97 38.97 38.90 38.90 38.93 38.922
09:36:00 38.92 38.96 38.92 38.96 38.94 38.925
09:37:00 38.90 38.93 38.86 38.93 38.91 38.922
09:38:00 38.90 38.92 38.89 38.89 38.90 38.920
09:39:00 38.92 38.92 38.88 38.91 38.91 38.918
09:40:00 38.90 38.92 38.88 38.91 38.90 38.917
09:41:00 38.84 38.89 38.82 38.89 38.86 38.912
09:42:00 38.87 38.87 38.84 38.84 38.86 38.908
09:43:00 38.85 38.89 38.84 38.89 38.87 38.905
09:44:00 38.81 38.85 38.80 38.85 38.83 38.900
09:45:00 38.69 38.80 38.67 38.80 38.74 38.890

 

Strategy

 

The most common use of TWAP is for distributing big orders throughout the trading day. For example let’s say you want to buy 100,000 shares of Morgan Stanley. Putting one such a big order would vastly impact the market and the price most likely would start to raise. To prevent that, investor can define time period in TWAP Strategy over which they want to buy shares. It will slice evenly big order into smaller ones and execute them over defined period.

 

TWAP could be used as alternative to VWAP, but because of itssimplicity we have to remember about some pitfalls. Even if we slice big orders, we do it evenly, thus there is a possibility to hit on low liquidity period when our splitted order will impact the market hard. That’s why it’s recommended to use TWAP over short periods or on stocks that are believed to not have any volume profile to follow.

 

Be random

 

There is also another threat coming directly from dividing big order evenly, namely, other traders or predatory algorithms. Obviously trading in such a predictable way can lead to situation where other traders or algorithms would look through our strategy and start to “game” us.

 

Barry Johnson in his book suggests adding some randomness to the strategy as a solution to the issue. He says that “We can use the linear nature of the target completion profile to adopt a more flexible trading approach. At any given time, we can determine the target quantity the order should have achieve just by looking up the corresponding value on the completion rate chart.”

 

In practice it means that when we have run 4-hour TWAP we don’t slice the order into evenly parts, but otherwise we focus on percentage completion. So for instance we would want to have 25% of the strategy completed by first hour, 50% by second and 75% by third. That gives a more freedom into size of orders, so we can be more random with it and hence less predictable for other traders on the market.

 

TWAP vs VWAP

 

As both indicators use same mechanism, i.e. weighted average price, it’s common to compare them. Despite that VWAP’s nature is more complex and includes volume in its calculations, on  instruments with low turnover TWAP and VWAP values can be close. On the other hand when a session starts to be more volatile both indicators will diverge.

 

 

On a table below there are TWAP and VWAP calculated for whole trading day. As we can see at the beginning of the trading day the difference is less than a cent, but on close the difference raised up to 2 cents. It happened because during the day there were some small volume trades for lower price that didn’t affected VWAP, but did TWAP.

 

Time Close High Low Open TWAP VWAP
09:44:00 38.81 38.85 38.80 38.85 38.900 38.904
09:45:00 38.69 38.80 38.67 38.80 38.890 38.887
15:57:00 38.70 38.70 38.68 38.69 38.666 38.686
15:58:00 38.71 38.72 38.68 38.70 38.666 38.686

 

Summary

 

TWAP Strategy is another great tool for executing big orders without impacting the market too hard. Like everything it has its own pros and cons and it’s up to us to select if TWAP will be the best strategy to use for our case or maybe we should consider using VWAP or other strategy.

 

 

Read more on how we develop trading algorithms for capital and cryptocurrency markets

 

References

  1. H. Kent Baker, Greg Filbeck. “Portfolio Theory of Management” (2013) , pp.421
  2. Barry Johnson “Algorithmic & Trading DMA – An introduction to direct access trading strategies” (2010), pp. 123-126