Pairs Trade with Examples

Alex Ishenko
3 min readJun 7, 2024

--

Hands-on quantitative trading strategies

Table of contents

  1. What is a pair trade
  2. Select data
  3. Find assets with the highest correlation
  4. Check how they behave
  5. Prepare trading strategy
  6. Final thoughts
  7. Links

1. What Is a Pairs Trade?

pairs trade is a market-neutral trading strategy that involves matching a long position with a short position in two stocks with a high correlation.

2. Select data

I assume that companies from the same industry may have a high correlation, let’s find out. Also the bigger the company the less volatile it usually is. Selecting.

Select assets

Checking data quality

The data is clean and ready
The data range is from 01 Jan 2020 and until 01 June 2020

What companies do we have?

Benchmark means index. Not that many actually, I expected more

3. Find assets with the highest correlation

Looks good, quite a few values higher than 0.9

Let’s select all that that are higher than 0.98

We have some, that’s good

4. Check how they behave

This chart means that during the 6-month range is from -13.68% to +12.10%.

AXP was 13.68% relatively cheaper than AllY in February 2020,

AXP was 12.10% relatively more expensive than AllY in April 2020

Let’s take a look at other pair

This chart means that during the 6-month range is from -5.76% to +4.39%.

MA was 5.76% relatively cheaper than V in late February 2020,

MA was 4.39% relatively more expensive than V in late March 2020

Let’s take a look at other pair

This chart means that during the 6-month range is from -4.71% to +3.45%.

DFS was -4.71% relatively cheaper than SYF in March 2020,

DFS was 3.45% relatively more expensive than SYF in February and almost 3% in June 2020

So as we can see, all the charts are bouncing around mean value, giving many opportunities for pair trading

5. Prepare trading strategy

We can open arbitrage pair deals when pairs are 10% close to their extremum points and wait while the difference goes down to the mean value. It requires some more research but from the charts, it’s clear that returning to mean might take from 2 weeks to 2 months.

6. Final thoughts

This opens a horizon to many similar strategies, for example, it can be not pair arbitrage but bucket arbitrage when one bucket contains N assets and another bucket N correlants, and when the mean difference reaches some point the whole buckets may be arbitraged against each other.

7. Links

  1. https://www.linkedin.com/in/aishenko/
  2. https://aishenko.com/
  3. https://github.com/qialex
  4. https://www.kaggle.com/alexishenko

--

--