PHD RESEARCH AT ALGOLABS

December 12, 2018

INVESTIGATING THE USE OF ONLINE MACHINE LEARNING METHODS AS EFFECTIVE HEDGING MODELS.

1. Preamble

In this document, we will introduce the background and research questions surrounding the proposed PhD research theme of machine learning methods and their application towards developing effective hedging models.

2. Background context

The financial marketplace is a huge, ever-growing, complex and extremely exciting venue for trading all sorts of assets, such as Bonds, Equities, and FX (Foreign Exchange). In this marketplace there are all kinds of players trading with each other, from individuals to hedge funds, investment and retail banks, and even automated trading models. Transactions can be tiny in value (e.g. 10p) or huge (e.g. £100 mio)! To participate in the financial marketplace, you have to either buy or sell something. The main rule of making money in finance is to sell high, buy low!

AlgoLabs supports various brokerages who have clients that trade in the following marketplaces:

  • Foreign exchange (FX, or Forex) and their derivatives
  • Contracts For Difference (CFDs) based on:
    • All major world stock market indices (such as FTSE, DAX)
    • Energy (crude oil, gas)
    • Base and Precious metals (copper, gold, silver, platinum)

Central to the operation of a financial market are entities known as Market Makers (also referred to as Liquidity Providers). Market makers are businesses (such as an investment bank or a brokerage) that make/publish prices in a set of financial instruments (e.g. FX, indexes, commodities, and so on). If a client wants to trade on the prices published by a market maker, the client must first place an order which is defined as a request to trade a given financial instrument. Market maker prices can either be ASK (sell) or BID (buy) prices. During the order process, clients can buy from market makers at the ask price and sell at the bid price. The difference between the bid and ask prices is called the spread. Market makers will compete for client liquidity by ensuring their spreads are as tight as possible, publishing ask prices that are competitively low and bid prices that are competitively high. If a market maker ‘wins’ a client trade, it then takes on the risk associated with that trade and assumes a position in the market (either ‘long’, ‘short’, or ‘flat’). The market maker can choose to hedge its position, placing trades to flatten its position in order to (hopefully) make money. The market maker can do this by executing trades with tighter price spreads than those published to the clients or by using a specialized hedging model which makes more intelligent decisions about when and how to hedge.


3. The Research Problem

This PhD project focuses on the operation of an automated Market Maker. In this project, we can think of an automated Market Maker as having three models fundamental to running the full lifecycle of the business:

  1. The Pricing Model – the goal of this model is to win as much client flow as possible by offering competitive prices. For example, if the pricing model is able to intelligently respond to a rising market, it will win more flow on the ask and vice versa.

  2. The Hedging Model – the goal of this model is to make as much profit from client flow. For example, a successful hedging model is able to decide an optimal time to place a hedging trade to maximize and lock in a profit.

  3. The Execution Model – the goal of this model is to execute market maker trades effectively and efficiently, with minimal transaction costs to external parties. For example, although Market G may have the better price, it may charge $10 per mio more than Market T.


Understanding the Hedging Model

A market maker’s first priority is to construct a robust “quote” (bid and ask price pair) to its clients, which it can requote many times a second. The use of online machine learning techniques to construct prices of the market maker’s quotes is to be investigated in a similarly-related PhD project that this project will work closely alongside with.

The main focus of this PhD is to look downstream at how we can effectively manage risk-making decisions in the Hedging model. The Pricing Model sends quotes to various markets, which then get passed onto end clients which can be either:

  • Retail clients: individual small clients manually clicking on a GUI
  • B2B (Broker to Broker) clients: aggregated business from one broker to another, which could be from retail or institutional.
  • Institutional clients: more professional clients with larger deposits, they typically have accounts with multiple brokers and will trade via their own platform or programmatically via a FIX API connection.

The market maker will ‘win’ flow from a variety of these clients, depending on how aggressive its pricing is. Clients send over orders to the market maker, which can then either:

  • Fill completely (client asks to buy 1 mio EUR/USD, market maker sells 1 mio EUR/USD to them)
  • Fill partially (client asks to buy 1 mio EUR/USD, market maker sells them 500k of it)
  • Reject (do not fill anything, market maker must give a reason why)

The Hedging Model only needs to be concerned about trades that are filled or partially filled as it is these trades that represent the risk taken on by the market maker. Then the main and ongoing consideration of the Hedging Model is in accumulating the market maker’s “position” from the resulting fills. The concept of position in the market is illustrated in the table below.

Time Price Side Amount Symbol Client Name
2017/11/06 13:44:03.211 1.1123 Sell 1,500,000 EUR/USD A
2017/11/06 13:44:03.211 1.1126 Sell 500,000 EUR/USD C
2017/11/06 13:44:03.211 1.1129 Buy 1,000,000 EUR/USD A
2017/11/06 13:44:03.211 1.1132 Buy 6,000,000 EUR/USD Y
2017/11/06 13:44:03.211 1.1135 Sell 2,000,000 EUR/USD Z
2017/11/06 13:44:03.211 1.1133 Buy 4,500,000 EUR/USD Z

Defining Risk

In our context, risk is defined as:

  1. The position you build up in the market (summation of client trades pushing the market maker longer or shorter).
  2. The PnL (profit and loss) of the positions you have built up (dependent on the prices at which the client trades).
  3. The PnL (profit and loss) of the positions you have built up (dependent on the prices that the client trades have been executed at – which is further decided ‘upstream’ by the Pricing Model).

Resources are finite, so keeping these two elements of risk in check is important. This can be done by placing “hedge” trades that mitigate the risk by bringing the net position closer to zero. One can imagine a disastrous scenario whereby the market maker has a very large position in the market but not enough PnL to reduce its position to mitigate further loss. Therefore, it is essential that position risk limits are put in place. Aside from avoiding position risk limit breaches, knowing when, what, and how much to hedge is the job of the market maker’s Hedging Model. It is worth reminding the reader that we can only hedge if we have a long or short position in the market; we cannot hedge if we are flat.


Unrealised and Realised PnL

PnL, or Profit and Loss, can be of two types – realised and unrealised:

  • Unrealised PnL is also called ‘floating PnL’ and it refers to the market value of a financial instrument (e.g. EUR/USD) at a given point in time relative to its original price. This value may go up or down.
  • Realised or ‘real’ PnL occurs when you take steps to flatten your position by buying or selling to lock in (and realise) a market price and associated PnL for that instrument.

You will profit if you buy at a price lower than what you originally sold at, or if you sell at a price higher than what you originally bought at. Conversely, you will take a loss if you buy at a price higher than what you originally sold at, or if you sell at a price lower than what you originally bought at.


A- and B- Booking

There are effectively 2 default hedging strategies currently employed by all brokerages – ‘A booking’ and ‘B booking’:

A booking – off the back of every client trade that the market maker executes, the market maker goes back to the Liquidity Provider (LP – who quoted the prices used in the trade) and places a trade of an equal amount and opposite side with this LP.

B booking – this is the opposite end of the spectrum to A booking, and this hedging strategy is typically used for “stupid” clients who consistently lose money, so in theory, no hedges need to be placed. With this model, you have unrealised PnL at the mercy of the clients, and you only realise PnL when they reduce or flip your net open position.


4. Proposed Aim and Problems of PhD Project

The aim of this PhD project is to investigate the use of online machine learning methods as effective hedging models. Data from historical client trades and their corresponding prices will be used to conduct these investigations. The performance of any online hedging strategy can be compared against a default Hedging Model currently in place which is essentially a rules-based model with global parameters that specify maximum net open position as well as take profit and stop loss boundaries to keep these realistic. The key challenges to the research project that we foresee are as follows:

  • The Hedging Model must be relatively fast, capable of managing the flow of over 200,000 trades each day and 300 mio price updates from LP’s.
  • Although we know there are 3 main types of client flow: retail, B2B, and institutional, they all have different patterns of trading, different biases on symbols, different times of day when they trade the most etc. Can we cluster these differences and if so is it better to mix the flow and hedge in aggregate or create smaller models hedging the flows in isolation, which is more effective/profitable?
  • To maximize profitability, short term market direction forecasts need to be made to decide whether our position is favorable or not, but what time horizon should be used to make the forecasts over – seconds? minutes? hours?
  • We know that price forecasting is a hard problem (some even argue impossible), there are indeed huge levels of noise in the underlying data, can we factor this uncertainty in the forecasts into how we look at our position and decide whether to ride the risk or hedge?

Economic News Releases

How can we factor in Economic News Releases as a main driver of price volatility in the FX market? The release date and time (and even a predicted figure and market impact factor too) of these macro-economic indicators are known in advance; how should we hedge around these releases?