Trading Execution Algorithms

The wonderful world of optimal trade execution and processing a billion dollars worth of stock.

Ali Kokaz
6 min readJul 3, 2020

In my earlier post, I described at a high level the different types of trading algorithms along with their uses, I’d suggest starting there if you are new to this subject.

In this post we will focus on trading execution algorithms, which are the earliest and most prevalent examples of industry automated trading algorithms.

To explain the concept briefly, imagine holding $5 billion worth of Amazon (AMZN) stock that you wanted to sell. Based off current price ($2,700), that’s roughly 1.85m shares. The average daily volume of AMZN stock traded is 3m. So if you were to immediately sell your position, you would FLOOD the market with over 60% of the daily supply in one go, bearing in mind this is for one of the most liquid stocks around. Not only are you unlikely to fill the position quickly, but the shock of such a large sell position on the market will likely dramatically decrease the price of the stock, causing you to sell at a massive discount. There are other similar effects that would impact your sale, all of which are grouped under the term “slippage” (if there is enough interest on this I will cover this in a separate article).

A Trade Execution Algorithm (TEA) allows you to alleviate slippage by slowly and programatically releasing your position to market, usually based off time-intervals or volume behaviour.

TEAs started as early back as the 1970s, when the New York Stock Exchange introduced the “Designated Order Turnaround” system (DOT). This system allowed market participants to book orders though a computer system, bypassing brokers.

TEA trading (known as program trading back then) grew rapidly in the following years, with some even attributing the 1987 stock market crash to it, although the links are unclear (later events, such as the 2010 flash crash were more clearly caused by algorithmic trading).

The flash crash of 2010, where various execution algorithms reacted to each other selling assets, exacerbating the effects.

TEA popularity received a massive boost in 2001 when the Securities Exchange Commision (SEC) imposed decimalisation of all stock quotes, changing the minimum tick size from 1/16 of a dollar ($0.0625) to $0.01 per share. This favoured smaller more frequent order sizes, enhancing TEA’s capability and flexibility.

Nowadays, the majority (if not all) of the major banks and financial institutions offer an algorithmic trading solution, including Credit Suisse’s AES, Chameleon, Viper and Iguana by BNP Paribas (through its Cortex-iX service) and Morgan Stanley’s Fix.

The concept of TEAs are relatively simple to grasp, in that you are simply trying to execute a position at the best price/optimal efficiency, however the complexity of present-day markets means the implementation of such algorithms is notoriously hard to master, with institutions constantly vying to improve their techniques.

I will start with the easiest implementation to understand:

Time Weighted Average Price (TWAP)

Time Weighted Average Price is the average price of a financial instrument over a certain time period (note that this period is not fixed, it could be an hour, day, month etc.).

A TWAP algorithm tries to fill a large block order (let’s think of our $5bn position here) by executing smaller orders over time (selling $500k worth of stock every 5 minutes until we have sold the full $5bn).

A representation of a simple TWAP algorithm, trading consistent amounts throughout the day, Natixis

In reality, algorithms quickly escalate in complexity (changing the time interval/order size to make it harder for other market participants to track and predict your algorithm, executing on different markets depending on time of day and so on) but the concept stays the same: break up a large order into smaller over a time period to reduce slippage.

TWAP execution price for AMZN, notice how the achieved price is essentially a moving average of the stock price over time

I will release a simple Python TWAP algorithm in a future article to fully explain this, so stay tuned!

Volume Weighted Average Price (VWAP)

The strength of TWAP algorithms is their simplicity, but also their weakness; breaking up an order into smaller parts to be equally traded throughout the day is simple, but does not take into account the changing volume of the market throughout, you may find yourself still in a position where you are flooding the market, or not taking advantage of busy trading sessions.

A VWAP algorithm breaks down an order based on volumes traded for such security, trading larger amounts when volume is bigger and vice versa. This is shown in the example below:

A VWAP algorithm’s trading volume, showing spikes in heightened activity and lulls during downtimes, Natixis.

Let’s explain this using our AMZN example below. This is the same price series as above, however I have made the volume profile (bottom of the chart) more prominent. Notice how the volume profile represents a U in most days; larger during the start and end of the market, and dropping off towards the middle (US lunch-time).

A TWAP algorithm trading equally throughout the day will miss-out on the extra volume being traded at the start of the day (can trade a larger amount with less slippage) but also runs the risk of slippage during the lunch-time lulls.

AMZN stock price (top) and volume profile (bottom) showing spikes in trading at the start/end of each trading day.

To execute a VWAP algorithm effectively, you need to know the volume profile for the trading day (or whatever time period you are working towards). This can range from something as as simple as using a year-on-year comparison, or Facebook’s Prophet algorithm, which can automatically detect daily, weekly or monthly seasonality, to a fully-fledged neural-network system employing numerous data sources, including economic indicators and news sentiment (at this point, many people will scream why I didn’t mention ARIMA, SARIMA or other Auto-regressive models, the point here isn’t to be exhaustive, there are a million ways to approach this, I am just mentioning some methods I am familiar with in this regard).

An example of a Prophet algorithm forecast, showing its robust anomaly handling and seasonality detection capabilities.

Percent of Volume (POV)

Also known as a participate algorithm, this algorithm attempts to be a set percentage of the market during a trading session until the full order is fulfilled.

A POV algorithm’s trading profile. Note that a POV algorithm can start at the market open and continue to the close, as long as the volume is sufficient, Natixis.

The simplest way to describe this algorithm is it being set to “be 10% of the market until your position is complete”. Now just like VWAP, you have to be able to understand what the actual market volume profile is, which you can do in the same forecasting ways described previously.

The downside to this algorithm is that if you hold a position, or set the participation rate too low, you could complete the whole trading time frame without fully unloading the position you held, so careful backtesting is required.

Conclusion

Hopefully what i’ve described above has helped described how some of the most popular Trade Execution Algorithms work.

What you will start to find the more you get into this subject is that algorithms types are highly overlapping, and all of the examples described can also be used as strategy implementation algorithms and vice versa. It depends mostly on the use case you are aiming for (money-making or cost minimisation).

Make sure you follow me and stay tuned for future article explaining other areas of automated trading in the future.

Gain Access to Expert View — Subscribe to DDI Intel

--

--

Ali Kokaz

Data Scientist, Algo-trading enthusiast & full-time Arsenal sufferer.

No responses yet