The Math of Pairs Trading Execution – Part I

Introduction

As developers of pairs trading execution software for the past 17 years, we found that the term ‘pairs’ is a somewhat nebulous catchall phrase for many different trading strategies.  These include risk (or merger) arbitrage, statistical arbitrage, cross border arbitrage, dual share class arbitrage, leveraged ETF arbitrage, inverse ETF arbitrage, multi-legged spinoff arbitrage, various ‘long/short’ strategies and others.  Developing tools for all of these strategies has been interesting and fun, with plenty of challenges.  We thought it might be interesting to address some of the math behind the execution of the various strategies.

Because these trading strategies evolved as separate disciplines, it is not surprising that most of them have their own way of looking at the strategy along with separate terminology.  The distinction is so great, that some of our customers don’t even consider themselves ‘pairs’ traders. 

When developing software for similar but different strategies, one must try to understand the commonality of the strategies and design an underlying model that accommodates as much of it as possible.  Having a good underlying model as a base makes a huge difference in a whole lot of ways that are critically important to building dynamic software products.

Although there is much more to a pairs trading execution platform than the underlying math, it is an important component and the subject of this multi-part article.  None of the math is complex, but some of the scenarios make things a bit complicated.  In this first article, we’ll focus on basic pricing for a couple of simple strategies, then address specific strategies more thoroughly in subsequent articles.

A Risk Arbitrage Example

Let’s look at a couple of examples of basic pairs trading strategies and then try to see what they have in common.

Risk arb involves one company acquiring another company, often by exchanging its own shares for those of the target company at a specified ratio with some sort of cash component.  (Deals can be lots more complicated, but we will use a simple one for our purposes.)  The trader wants to execute the appropriate amount of the two securities at the correct relative prices, so the execution platform will need to know the correct relative prices of the two securities at any given point in time. 

Typically a trader would short the acquirer (Company A) and buy the target (Company B) at some discount to the ‘fair value’ represented by the terms of the deal.  So, let’s say company A will acquire company B.  Company B will receive .44 shares of Company A plus $4.50 in cash.  Let’s say the trade wants to make .50.  So, the general formula would be:

Target Company price = (Acquirer Company Price * Share Ratio) + (Cash Component – Trader’s Profit). 

So in this example, the formula becomes:

Company B Price = (Company A price *.44) + ($4.50 - .50). 

 

Let’s throw these into a spreadsheet and calculate the price we would be willing to pay for Company B for a range of prices for Company A.

Terms:

RatioCashProfit Target
.444.50.50

Target price of Company B for range of prices of Company A.

Company ACompany B
50.0026.00
50.5026.22
51.0026.44
51.5026.66
52.0026.88
52.5027.10
53.0027.32
53.5027.54
54.0027.76
54.5027.98
55.0028.20
55.5028.42
56.0028.64
56.5028.86
57.0029.08
57.5029.30

Here’s a chart showing the relationship.

CompanyAvsCompanyB-1.png

So, we see the relative prices we would like to execute are linear for this risk arbitrage example.  Hold that thought for a moment and let’s move on to another pairs strategy, statistical arbitrage.

A Statistical Arbitrage Example

There are lots of different variants of statistical arbitrage strategies, but let’s take a look at a simple one.  Let’s say that someone has done some research and found that prices of two companies in the same industry tend to track one another very closely but at times one or the other will drift higher or lower relative to the other one and then drift back to the norm.

Here’s an example of two such stocks.  We’ll call them Company A and Company B.  The top part of the chart shows their prices (one on each vertical access) and the bottom chart shows the premium or discount to their previous year’s average ratio.

StatArbPairsChart.png

A trading strategy might be to buy the pair when it gets to a .50 discount and sell it when it gets to a .50 premium.  Let’s set up the math on this one.  Let’s buy when

Company B Price = (Company A Price * Average Ratio) – Target Discount

and sell when

Company B Price = (Company A Price * Average Ratio) + Target Discount

So, if we fill in the numbers, we buy when

Company B = (Company A * .3610) - .50

and sell when

Company B = (Company A * .3610) + .50

Let’s put the data into a table across a range of values for Company A and see where we should execute Company B for any given price to both put on and take off the position.

BuySell
Company ACompany BCompany B
31.0010.6911.69
31.5010.8711.87
32.0011.0512.05
32.5011.2312.23
33.0011.4112.41
33.5011.5912.59
34.0011.7712.77
34.5011.9512.95
35.0012.1413.14
35.5012.3213.32
36.0012.5013.50
36.5012.6813.68
37.0012.8613.86
37.5013.0414.04
38.0013.2214.22
38.5013.4014.40

And the corresponding chart.

CompanyAvsCompanyB-2.png

So, our statistical arbitrage example also has a linear relationship.

Remember 7th Grade Algebra?

We’ve looked at two simple pairs trading strategies and observed a linear relationship in both of them.  Let's go back to our 7th grade algebra class.  Remember this?

y = mx + b

Now let’s look at our three formulas from earlier.  The risk arbitrage one:

Company B Price = (Company A price *.44) + ($4.50 - .50). 

And the two for our stat arb example:

Company B = (Company A * .3610) - .50

Company B = (Company A * .3610) + .50

These three equations seem to fit nicely with y = mx + b, and the linear look of the charts seem to confirm.  So, if we were to build an model for pairs execution strategies, it looks like a linear equation defining the underlying relationship would be a good place to start.  In our next posting, we’ll go into more depth on a couple of statistically arbitrage strategies and introduce the (simple) math on how to manage volume.  Subsequent posts will deal with more complex pairs strategies.