Pairs Trading, Cryptocurrencies and Cointegration1324527/FULLTEXT01.pdfKeywords: Cointegration, Statistical arbitrage, Cryptocurrency, Pairs trading, Algorithmic trading Individual
Post on 31-Dec-2020
11 Views
Preview:
Transcript
Pairs Trading, Cryptocurrencies and
Cointegration A Performance Comparison of Pairs Trading Portfolios of Cryptocurrencies
Formed Through the Augmented Dickey Fuller Test, Johansen’s Test and
Phillips Perron’s Test.
By Andreas Hild & Mikael J. Olsson
Department of Statistics Uppsala University
Supervisor: Lars Forsberg
2019
Abstract This thesis analyzes the performance and process of constructing portfolios of cryptocurrency
pairs based on cointegrated relationships indicated by the Augmented Dickey-Fuller test,
Johansen’s test and Phillips Peron’s test. Pairs are tested for cointegration over a 3-month and
a 6-month window and then traded over a trading window of the same length. The
cryptocurrencies included in the study are 14 cryptocurrencies with the highest market
capitalization on April 24th 2019. One trading strategy has been applied on every portfolio
following the 3-month and the 6-month methodology with thresholds at 1.75 and stop-losses at
4 standard deviations. The performance of each portfolio is compared with their corresponding
buy and hold benchmark. All portfolios outperformed their buy and hold benchmark, with and
without transaction costs set to 2%. Following the 3-month methodology was superior to the 6-
month method and the portfolios formed through Phillips Peron’s test had the highest return for
both window methods.
Keywords: Cointegration, Statistical arbitrage, Cryptocurrency, Pairs trading, Algorithmic
trading
Individual graphs, R code and test statistics are provided upon request:
Mikael.jurvelinolsson@outlook.com & Andreas.erik.hild@gmail.com
Contents
1 Introduction ......................................................................................................................................... 1 1.1 Cryptocurrency ............................................................................................................................. 4
2 Data ...................................................................................................................................................... 6 3 Theory and fundamental concepts .................................................................................................... 7
3.1 Stochastic processes and a random walk ..................................................................................... 7 3.2 Stationarity .................................................................................................................................... 8 3.3 White noise .................................................................................................................................... 9 3.5 Unit root ...................................................................................................................................... 11 3.6 Augmented Dickey-Fuller (ADF) test ........................................................................................ 13 3.7 Cointegration .............................................................................................................................. 13 3.8 The log-normal process .............................................................................................................. 14
4 Statistical tests and approaches ....................................................................................................... 15 4.1 Engle-Granger´s approach ......................................................................................................... 15 4.2 Phillips-Perron (PP) test ............................................................................................................ 16 4.3 Johansen´s (JOE) approach and test ......................................................................................... 16 4.5 Drawdowns of the Engle-Granger´s approach, the ADF & the PP Test ................................. 18 4.6 Drawdowns of Johansen´s approach and test ........................................................................... 19
5 Financial theory ................................................................................................................................ 20 5.1 Pairs trading ............................................................................................................................... 20 5.2 Sharpe Ratio ............................................................................................................................... 22 5.3 Long position, short position and stop-loss ............................................................................... 23
6 Methodology ...................................................................................................................................... 24 6.1 Identifying pairs – Engle-Granger´s approach ......................................................................... 24 6.2 Identifying pairs – Johansen´s approach .................................................................................. 24 6.3 Choice of cryptocurrencies ......................................................................................................... 25 6.4 Pair Candidates ........................................................................................................................... 25 6.5 Composition of the buy and hold index ..................................................................................... 26 6.6 Trading windows and testing methodology ............................................................................... 26
7 Results ................................................................................................................................................ 28 7.1 Cointegrated pairs ....................................................................................................................... 29 7.2 Evaluation of performance ........................................................................................................ 30
8 Conclusion ......................................................................................................................................... 32 9 Limitations ......................................................................................................................................... 33 10 Further research ............................................................................................................................. 34 References ............................................................................................................................................. 35 Appendix A ........................................................................................................................................... 38 Appendix B ........................................................................................................................................... 45
1
1 Introduction In 2003, the researchers Clive Granger and Robert Engle were awarded the Nobel Prize in
Economics for an article published in 1987 in one of the most cited academic journals in the
field of econometrics – Econometrica. The paper concerned cointegration, which was already
introduced by Granger in 1981 but the Econometrica paper in 1987 meant a rapid take-off for
the idea. Today, the Engle and Granger (1987) paper is one of the most cited papers in
econometric time series research. Granger came up with the concept of cointegration by
attempting to prove to his colleague David Hendry that pairs of integrated series could not form
a stationary process and in an attempt to prove Henry wrong, Granger discovered that Henry
was right and generalized the property to cointegration. The first 1981 article by Granger was
rejected for many reasons, such as need of rewriting the proof of theorems and lack of empirical
applications. Granger then started to work with his colleague Engle to perfect the article which
lead to the revolutionary 1987 article “Cointegration and Error Correction: Representation
Estimation and Testing” and to their Nobel Prize award in Economics (Syczewska, 2011).
During the same time, a quantitative analyst named Nunzio Tartalia at the American bank
Morgan Stanley led a team of mathematicians, physicists and computer scientists to research
strategies which would detect arbitrage opportunities in financial markets based on quantitative
methods in the late 80s. The team’s work resulted in a speculative trading strategy, pairs trading,
which took advantage of cointegrated relationships of assets in financial markets in order to
detect arbitrage opportunities. Pairs trading was strategically simple: find two assets which have
historically moved in similar ways, when the assets deviate far from each other, take a short
position on the performing asset, take a long position on the loser and hold the position until
the assets’ time series converge (Gatev, Goetzmann & Rouwenhorst, 1999).
This strategy was aimed to hedge the trader against the risk of the market under the assumption
that a cointegrated relationship existed between the traded assets in a pair. Thereby, the strategy
was expected to perform well both when the market was in a bear and a bull phase because the
performance depended on the cointegrated relationship between the assets in a pair and not of
the movements of the market.
2
Although pairs trading strategies have been showed to work as a trading strategy for
cointegrated assets, it exposes the trader to risks. For example, pairs trading and statistical
arbitrage strategies was partly the reason for the 4.6 billion USD default of the American hedge
fund Long Term Capital Asset Management, which was managed by the Nobel Price awardees
Robert C. Merton at MIT and Myron S. Scholes at Stanford university. Speculative pairs trading
methods partly made the fund default and resulted in a bailout from the Federal Reserve Bank
of New York, where FED New York communicated that a liquidation of the fund would
potentially ravage the world’s financial markets (Jorion, 2000).
Even though pairs trading is not risk free, it can deliver high returns with low volatility if applied
on cointegrated assets. The success of a pairs trading strategy is heavily dependent on the
method for selecting pairs, the rules to execute positions and the modelling and forecasting of
the spread between the assets in the pairs (Huck, 2015).
The procedure of this thesis is threefold. First, 14 cryptocurrencies will be unit root tested by
the Augmented Dickey Fuller test and then tested for cointegration using the Augmented
Dickey Fuller, Johansen’s and Phillips Perron’s test and cointegrated cryptocurrencies will
form portfolios. Second, the performance of each portfolio will be analyzed following the same
pre-specified pairs trading strategy and time spans. Third, the performance following a 3-month
or 6-month trading and testing procedure will be analyzed for every portfolio. The portfolio of
the test that delivers the highest return based on the same pre-specified pairs trading strategy is
assumed to best detect and predict cointegrated relationships between cryptocurrencies from
November 1st 2017 to May 1st 2019 with a mean oscillation of 1.75 standard deviations. The
thesis will consider the performance of pair candidates from a 3- or 6-month testing and trading
window in order to evaluate if a portfolio formed through a certain test outperform the other
portfolios in both windows. Also, the high volatility and high correlation as shown in Figure 1
among cryptocurrencies along with the characteristics of cryptocurrencies being similar - to
work as a decentralized digital mode of exchange, motivates us to investigate if mean-reverting
trading strategies can successfully be applied on cryptocurrencies. In addition, the absence of
institutional investors on the cryptocurrency market could potentially open up for larger
arbitrage opportunities compared to traditional markets. The results of this thesis may be used
to assess which test - the Augmented Dickey Fuller test, Johansen’s test or Phillips Perron’s
test - that best detect cointegrated relationships for cryptocurrencies with a spread of the
currencies that oscillate around 1.75 standard deviations.
3
Figure 1 - Correlation matrix of cryptocurrency included in the study to the United States dollar
from 2017-11-01 to 2019-05-01
4
1.1 Cryptocurrency A cryptocurrency is an asset in digital form whose primary purpose is to work as a medium of
exchange. Cryptocurrencies use cryptography and blockchain technology to ensure that all
transactions are secured and everything new that appears in the blockchain is controlled by its
own digital infrastructure. Bitcoin, the historically dominating cryptocurrency, works on a
principle called p2p-technology which in essence means that every peer has a record of every
transaction in the blockchain. When a new transaction is initiated, the file gets signed by a
private key and is broadcasted to the network and later becomes a part of the blockchain. Once
the transaction is completed, it is set in stone and becomes a part of the historical transactions
in the blockchain. Bitcoin miners are the only ones who can confirm transaction and mine new
Bitcoins which require extensive computational power. A description of how miners create and
confirm transactions can be found in Appendix B (Monia, 2018).
According to Jain (2017), Bitcoin and other cryptocurrencies change the landscape of banking,
finance and economics in five fundamental ways.
1. Dark web - cryptocurrencies give power to the dark web and allow individuals to
trade, sell and purchase illegal and legal goods and services without being identified
or controlled.
2. Speculation - the cryptocurrency market has created massive opportunities for
speculation. A Bitcoin had a market value of 170 USD on January 14th 2014 and
2772 USD on July 24th 2017 (Monia, 2018). From an investment perspective,
studies have shown that cryptocurrencies have a high correlation between different
cryptocurrencies but low correlation with traditional assets and could therefore be a
diversifier in a traditional trading portfolio (Lee, Guo and Wang, 2018).
3. Politicization of the economy – throughout the history of the modern economy,
banks and financial institutions have kept track of every transaction that has ever
happened. This economic power can however be challenged by the masses through
the anonymity of cryptocurrency transactions.
4. Apprehension of central banks – cryptocurrencies make loopholes and gaps in
collecting and monitoring data about transactions in an economy and thus gives
possibilities to launder and transfer money out of governments’ and central banks’
control.
5
5. The emergence of new markets – cryptocurrency transactions can be made for
free, are fast and without government interventions which can be a better alternative
to costly and slow cross-border transactions provided by banks, specifically in times
of trade wars and to avoid tariffs.
Many alternative cryptocurrencies commonly referred to as altcoins have been invented after
the launch of Bitcoin in 2009. Examples of altcoins are the cryptocurrencies Ethereum, Ripple
and Litecoin which all take advantage of similar block-chain technology but have different
algorithmic designs. These alternative cryptocurrencies were mainly invented to address the
shortcomings of the Bitcoin currency such as the limited supply of 21 million Bitcoins and the
high-energy use of Bitcoin’s consensus algorithm (Lee, Guo, Wang, 2018).
However, many influential individuals in the financial industry have raised critical remarks on
cryptocurrencies. Critics argue that despite of cryptocurrencies’ mode of exchange utility,
cryptocurrencies have no intrinsic value and might be a perfect vehicle for forming a financial
bubble. For example, the American business magnate Warren Buffet has stated that the market
for cryptocurrencies will come to a bad ending (CNBC, 2018). Black Rock, the world’s largest
asset management firm’s CEO, Laurence D. Fink called Bitcoin an index of money laundering
by expressing “Bitcoin just shows you how much demand for money laundering there is in the
world.” (CNBC, 2017).
Different from trading traditional financial assets, traders can buy fractions of cryptocurrencies.
Bitcoin fractions can be purchased in up to 8 decimals places due to Bitcoin’s algorithmic
design which uses 10# as its base unit. It is therefore possible to trade fractions of up to
0.00000001 of a Bitcoin. Moreover, other alternative cryptocurrencies allow fractions up to 16
decimal places which makes cryptocurrencies plausible for weighting pairs trading strategies
albeit the large difference in price between cryptocurrencies (Lee, Guo, Wang, 2018).
6
2 Data The data used in this thesis has been imported from Yahoo Finance via the QuantMod package
in the software R and consists of data from 14 cryptocurrencies with the highest market
capitalization on April 24th 2019. The data is from November 1st 2017 and spans to May 1st
2019. A description of each cryptocurrency can be found in Appendix B. Since cryptocurrencies
are traded 24 hours every day there are no closing prices to consider. The prices in the study
will therefore be the 24-hour price change and all prices in the study are denoted in United
States dollars.
Table 1 – Market cap of cryptocurrencies included in the study
Cryptocurrencies with highest market capitalization on April 24th 2019 Cryptocurrency Market Cap in USD Launch date Bitcoin (BTC-USD) 91.151B 2009-01-03 Ripple (XRP-USD) 30.068B 2013-02-02 Ethereum (ETH-USD) 17.493B 2015-07-30 Bitcoin Cash (BCH-USD) 4.894B 2017-08-01 Litecoin (LTC-USD) 4.45B 2011-10-13 Binance Coin (BNB-USD) 4.199B 2017-06-27 EOS (EOS-USD) 3.2B 2017-06-26 Tether (USDT-USD) 2.703B 2014-06-10 Stellar (XLM-USD) 2B 2013-07-19 Cardano (ADA-USD) 1.871B 2017-10-05 Tronix (TRX-USD) 1.538B 2017-09-26 Monero (XMR-USD) 1.138B 2014-06-02 Digital Cash (DASH-USD) 1.029B 2014-01-18 IOTA USD (IOT-USD) 788 M 2016-07-17 Ethereum Classic (ETC-USD) 621 M 2016- 07-23
Source: Yahoo Finance The currency Binance Coin has been excluded from this study due to data constraints and the
fact that it can only be traded on the Binance cryptocurrency exchange.
7
3 Theory and fundamental concepts
3.1 Stochastic processes and a random walk
A sequence of random variables {𝑌&: 𝑡 = 0,±1,±2,… } is called a stochastic process and serves
as a model for an observed time series. An important stochastic process for modelling financial
assets is the random walk. The observed process for a random walk,
{𝑌&: 𝑡 = 0,±1,±2,… } is as follows
𝑌/ = 0 1
𝑌1 = 𝑒1 2
𝑌3 = 𝑒1 +𝑒3 3
𝑌& = 𝑌&61 +𝑒&. 4
And the first difference of a random walk becomes
∇𝑌& = 𝑒&, 5
where 𝑒&is a stationary process (Asterious & G. Hall, 2011). A simulation of a random walk
with 100 observations is found in Figure 2.
8
Figure 2 - Random Walk simulation
3.2 Stationarity The fundamental idea behind stationarity is that the probability laws which governs the
behavior of a stochastic process do not change over time. The statistical properties from
observations of a stationary process are the same regardless of time in the process. There are
two different kinds of stationarity - strict stationarity and weak stationarity also referred to as
covariance stationarity. A process {𝑌&} is said to be strictly stationary if the joint distribution of
𝑌&1, 𝑌&3, …, 𝑌&;is the same as 𝑌&16<, 𝑌&36<, …, 𝑌&;6< for all 𝑡 time periods and all 𝑘 lags (D.
Cryer & Kung-Sik, 2009).
Strong stationarity is difficult to assess and the weak stationary process will be considered for
the scope of this paper. A weak stationary process does not consider the joint distribution of the
random variables.
For a weak stationary process, it follows that 𝐸 𝑌& = 𝐸 𝑌&6< for every 𝑡 and 𝑘. Hence, the
mean function is constant over time (D. Cryer & Kung-Sik, 2009).
9
In addition,
𝑉𝑎𝑟 𝑌& = 𝑉𝑎𝑟 𝑌&6< , 6
for every 𝑡 and 𝑘 which makes the variance constant over time. The covariance is independent
of time and only a function of the lag-length (D. Cryer & Kung-Sik, 2009).
Therefore, the moments of a weak stationary process are as follows: Table 2 – Moments of a stationary process
Moment Criteria Formally 1st Mean Mean is constant over time and
independent of time 𝜇& = 𝜇&6<
2nd Variance Variance is constant over time and independent of time
𝛾&,& = 𝛾/,/
2nd Covariance Covariance is constant over time and independent of time
𝛾&,&6< = 𝛾/,<
That the first and second moments are constant over time means that the quantities in Table 2
remain the same whether for example observations were from 2017 to 2018 or 2007 to 2008.
Shocks to stationary time series are temporary over time and the effects of the shocks will
therefore dissipate and the time series will eventually revert to its long-time mean (Asterious &
G. Hall, 2011).
3.3 White noise The white noise process is a simple case of a probabilistic time series and the simplest case of
a stationary time series. A white noise process is constructed by drawing an observation with a
value from a normal distribution where the parameters are fixed and do not change over time
at each time instance (D. Cryer & Kung-Sik, 2009). A white noise process is denoted as
𝑌& = 𝑒&. 7
10
A simulation of a white noise process with 100 observations and a mean of 0 is found in Figure
3 below.
3.4 The difference of time series and order of integration The difference of a time series is the series of changes from one period to the next. For example,
if the value of a time series is 𝑌& then the first difference of 𝑌 at period 𝑡 is given by
∇𝑌& = 𝑌& −𝑌&61. 8
The order of integration is commonly denoted by
𝑌&~𝐼 𝑑 , 9
where 𝑑 represents the least amount of differences in order to achieve a covariance stationary
time series. An 𝐼 0 is a covariance stationary process and the most common difference in order
to achieve stationarity is the first difference that is that the time series is integrated of order 1;
𝐼 1 (Neusser, 2016).
Figure 3 – White Noise simulation
11
3.5 Unit root An autoregressive process is a process which regresses on itself. The assumption of an AR(1)
model is that the time series of 𝑌& is mostly determined by the value in the prior period.
Therefore, what occurs in time 𝑡is highly dependent on what happened in𝑡 − 1 and what will
occur in time 𝑡 +1 will in turn be largely dependent on the series in the present time 𝑡 (Asterious
& G. Hall, 2011).
Consider the following AR(1) model
𝑌& = 𝜙𝑌&61 + 𝑒&, 10
where the residuals are white noise, there are in general three cases:
Case 1: If 𝜙 < 1 then the series is stationary.
Case 2: If 𝜙 = 1 then the series is non-stationary, that is has a unit root.
Case 3: If 𝜙 > 1 then the series will explode.
12
Simulations of case 1, 2 and 3 for 1000 observations is found below in Figure 4.
To test the order of integration is to test the number of unit roots. The number of unit roots are
therefore the difference required to obtain a stationary process for example the first or second
difference (Asterious & G. Hall, 2011).
Figure 4 – Different Phis of an AR(1) process
13
3.6 Augmented Dickey-Fuller (ADF) test The ADF test is a unit root test where lagged terms are added to the 𝑌 variable to remove
possible autocorrelation. The number of lags is determined by the Akaike information criterion
(AIC) or the Schwartz Bayesian criterion (SBC). The test has the following form
∆𝑌& = 𝑎/ + 𝑎1𝑌&61 + 𝑎3𝑡 + 𝛽Q∆𝑌&61 + 𝑒Q,R
QS1
11
where 𝑎/ is the intercept, 𝛽Q∆𝑌&61RQS1 is the sum of the differentiated lagged 𝑌s together with
their coefficients. The null of the test is𝑎/ = 0 and the alternative hypothesis𝑎/ < 1. Rejecting
the null will indicate that 𝑌& does not exhibit a unit root and therefore is stationary. This is
obtained by comparing the ADF test statistic with a critical value at a given significance level
(Asteriou and Hall 2016). The test statistic of the ADF test is given by
𝐴𝐷𝐹WXY =𝛼1𝜎\]
. 12
3.7 Cointegration Even though a group of variables are individually non-stationary, a linear combination of the
series can form a stationary time series under the condition that they are individually integrated
of the same order (Vidyamurthy 2004). That means that a linear combination of 𝑋& and 𝑌& can
form an I(0) and a stationary process.
A linear combination of 𝑋& and 𝑌&is obtained by regressing one of the time series on the other
𝑌& = 𝛽1 +𝛽3𝑋& + 𝑒& 13
By taking the residuals we get
𝑒& = 𝑌& −𝛽1 − 𝛽3𝑋& 14
If 𝑒&~𝐼(0) and stationary, then 𝑋& and 𝑌& are cointegrated (Asterious & G. Hall, 2011). 𝑒& in
the context of pairs trading will be the spread between assets in a pair.
14
3.8 The log-normal process The most commonly used model for modelling financial assets is the log-normal process, where
the logarithm of the price of an asset is assumed to exhibit a random walk process. This implies
that the price of the asset in the next time period is approximately the price at the current time
period and is in probability theory referred to as a martingale. This means that the conditional
expectation of a value in the next time point, given all prior values, is equal to the present value.
As mentioned in section 3.1, taking the first difference of a random walk yields a stationary
process, which can also be interpreted as the return of the asset or the increment of a random
walk at a time point (Vidyamurthy 2004).
Likewise, the set of increments from a random walk obtained by taking the first difference is
by definition drawings from a normal distribution. However, because of the martingale property
of the random walk, the predicted increment of a random walk is zero, which is not handy when
predicting asset prices with a goal of making money. The predicted value two steps further in
time is still zero, but with an increased variance. Nevertheless, because of the mean reverting
property of stationary time series, the researcher is able to predict the increment to the next
value in a stationary process. Still, financial assets are modelled as random walks, which are
not stationary and the predicted value is equal to the value at the present time. However, due to
cointegration, the researcher can find linear combinations of assets whose time series are
combined stationary and therefore are predictable (Vidyamurthy 2004).
15
4 Statistical tests and approaches
4.1 Engle-Granger´s approach As mentioned in the introduction of this paper, in 1987 Engle and Granger introduced a way to
test for cointegrated relationships between different time series. To understand the approach,
consider two given time series 𝑋& and 𝑌&, where 𝑋& is 𝐼(0)and 𝑌& is 𝐼(1). Thereby, any linear
combination of the series
𝜃1𝑋& + 𝜃3𝑌& 15
will always be 𝐼(1), that is non-stationary. This is because the behavior of the non-stationary
𝐼(1) series will dominate the behavior of the stationary series.
However, if 𝑋& and 𝑌& are both 𝐼(1), then a linear combination of the series in equation 15 is
likely to be non-stationary 𝐼(1) too. Although this is usually the case, there are cases where a
linear combination of two non-stationary time series can result in a stationary process and the
time series are then said to be cointegrated.
Estimating the parameters of the long-term relationship and investigating if the time series are
cointegrated or not is difficult. Therefore, Engle and Granger introduced a method for
estimating parameters of the relationship and checking for cointegration. The method is as
follows:
First, test whether the time series are integrated of the same order. This is in this thesis tested
through the Augmented Dickey Fuller test (see section 3.6), in order to infer the number of unit
roots. The time series must be integrated of the same order and cannot be stationary.
Second, if the variables are integrated of the same order, the long-run relationship is estimated
by regressing one variable on the other
𝑌& = 𝑎/ + 𝛽1𝑋& + 𝑒&, 16
which can be written as
𝑒& = 𝑌& − 𝑎/ − 𝛽1𝑋&. 17
16
If 𝑒& is stationary (𝐼(0)), then the variables are cointegrated. This is tested through either the
Augmented Dickey Fuller or the Phillips Perron test, only this time on the residual time series.
If the test is rejected it can be concluded that the variables have a cointegrated relationship
(Asteriou and Hall 2016). The procedure for Johansen’s test will be outlined in section 4.3.
4.2 Phillips-Perron (PP) test As outlined in section 3.6 the ADF test is based on the assumption that the error terms have a
constant variance and are statistically independent. The Philips Perron’s test however, which
was developed as a generalization of the ADF test, has a milder assumption regarding the error
terms.
The regression test takes the following AR(1) form
𝑌& = 𝑎/ + 𝑎1𝑌&61 + 𝑒&, 18
where the null is that 𝑎1= 1 and the alternative that 𝑎1 < 1.Rejecting the null will indicate that
𝑌& does not have a unit root and is therefore stationary.
Whereas the ADF test adds lagged differentiated terms to handle higher-order correlations, the
PP test modifies the coefficient 𝑎1from the AR(1) regression for the serial correlation in 𝑒&.
The derivation of the PP-test is beyond the scope of this thesis.
4.3 Johansen´s (JOE) approach and test Vector autoregression (VAR) is essential in order to understand Johansen’s test. A vector
autoregression is a matrix which contains two or more regressions, where each variable is
regressed on 𝑛 number of lags of the other variables and 𝑛 number of lags of the variable itself.
Each variable is also regressed on a constant. A VAR-system can take the following form
𝑌& = 𝑎 +𝛽1𝑌&61 + 𝛽3𝑌&63 +∙∙∙ +𝛽R𝑌&6R + 𝑒&, 19
where 𝑌& is a vector, 𝛽< act as an j by j matrix of the coefficients, where 𝑘 = 1,2,3, … , 𝑛, 𝑎
represent a j by one matrix of the constants and 𝑒& represent the error terms in the same matrix
as 𝑎.
17
If a model contains three or more variables, there is a possibility that more than one cointegrated
relationship exits. As a rule of thumb, for 𝑛 number of variables there can at most be (𝑛 −
1)cointergrations. Johansen’s approach is able to detect multiple cointegrated relationships due
to the use of a VAR-system. Compared to Engle and Granger’s approach, which can just detect
one cointegrated relationship.
Using the framework by Asteriou and Hall (2016), the derivation of Johansen’s approach to
detect cointegration for a vector of two time series 𝑋& = [𝑌&, 𝑍&], is as follows
𝑌& = 𝜋11𝑌&61 + 𝜋13𝑍&61 + 𝑒1&𝑍& = 𝜋31𝑌&61 + 𝜋33𝑍&61 + 𝑒3&
. 20
Now 𝑌& and 𝑍& are cointegrated, if
Δ𝑌& = 𝛼1 𝛽1𝑌&61 + 𝛽3𝑍&61 + 𝑒1&Δ𝑍& = 𝛼3 𝛽1𝑌&61 + 𝛽3𝑍&61 + 𝑒3&
, 21
where 𝛽1𝑌&61 + 𝛽3𝑍&61 is a stationary process.
This can also be represented using matrices
Δ𝑌&Δ𝑍&
= 𝜋11 𝜋13𝜋31 𝜋33 ∙
𝑌&61𝑍&61
+𝑒1&𝑒3&
. 22
Then𝑌& and 𝑍& are cointegrated, if
𝜋11 𝜋13𝜋31 𝜋33 = 𝛼1𝛽1 𝛼1𝛽3
𝛼3𝛽1 𝛼3𝛽3=
𝛼1𝛼3
∙ 𝛽1𝛽3 , 23
where Π =𝜋11 𝜋13𝜋31 𝜋33
Thereby 𝑌& and 𝑍& are cointegrated if the rank of Πis one. The rank of the matrix Π represents
the maximum number of linearly independent rows of Π.
18
The rank of Π is estimated by two different likelihood ratio tests, both based on eigenvalues,
that is the number of characteristic roots. The first method tests the null that Rank(Π) = 𝑟
against the alternative that Rank(Π) = 𝑟 + 1. In other words, the null is that there are 𝑟
cointegrated vectors and at most 𝑟 cointegrated relationships. Meanwhile, the alternative
suggest that there are 𝑟 + 1 vectors. The method orders the eigenvalues in descending orders
and test if they are significantly different from zero. For example, consider n characteristic
roots, - λ1 > λ2 > λ3 > ··· > λn. If there is no cointegration, then all roots will be equal to zero.
Hence, −𝑇 ln 1 − 𝜆no1 will also be zero. Nonetheless, if the rank is equal to one implying
one cointegrated relationship, then 𝜆1 > 0 which leads to – 𝑇ln(1 − 𝜆1) < 0.
There are two methods to get the statistics used to test if the characteristic roots are different
from zero. The first is as follow
𝜆qrs 𝑟, 𝑟 + 1 = −𝑇 ln 1 − 𝜆no1 . 24
The second method is conducted by the likelihood ratio test for the trace of Π. The null in this
case is that the number of cointegrated vector is at most 𝑟 (Asteriou and Hall 2016). Where the
test statistic is
𝜆&nrtu = −𝑇 ln 1 − 𝜆no1 .R
QSno1 25
In this thesis, the first method will be used when following the Johansen´s approach.
4.5 Drawdowns of the Engle-Granger´s approach, the ADF & the PP Test Following the Engle-Granger´s approach, one must regress one time series on the other. As an
example, consider the time series 𝑋& and 𝑌&, the approach does not explain which time series to
regress on the other and why. One can either regress 𝑋& on 𝑌& or vice versa. This forces the
researcher to choose between two different regressions often with different residuals. In
asymptotic theory, when the sample sizes goes to infinity, the residuals of the regressions are
equivalent. However, the sample size for economic data is rarely large enough to result in equal
series when time series are regressed upon each other (Asteriou & Hall, 2016).
19
One drawdown of the ADF and the PP test is that when a process is stationary, yet close to
having a unit root, the power is low (Brooks, 2002). Other drawdowns of the ADF and PP test
is that they over-reject the null when the moving average root of the process is negative
(Schwert, 1989).
Likewise, as mentioned in section 4.4, neither the ADF nor the PP test can test for more than
one cointegrated relationship.
4.6 Drawdowns of Johansen´s approach and test One of the assumptions of Johansen´s test is that the cointegrated vector is constant during the
test period which is a strong assumption since long-run relationships of the underlying variables
can vary, particularly if the test period is long. In addition, using the VAR method is of
theoretical nature which can make the model hard to interpret (Brooks, 2002).
20
5 Financial theory
5.1 Pairs trading Pairs trading is a market neutral strategy which take advantage of the mean-reverting property
of two or more cointegrated time series. It is categorized as a convergence or statistical arbitrage
trading strategy. The strategy considers the spread which reflects the relationship between
assets in a pair at a time. One long position is taken in a security and simultaneously one short
position is taken as in another security. Pairs trading involves putting on positions when the
spread is substantially away from the mean and positions will be hold until the spread reverts
back to a certain value that is most often the mean. The fundamental idea behind a pairs trading
strategy is to short-sell overvalued assets and buy undervalued assets with similar
characteristics (Vidyamurthy 2004). Similar characteristics could for example be stock indexes
that follow countries with similar economies and commodity sectors or companies in the same
industry with similar market values.
Pairs trading strategies are based on capitalizing on the oscillations around the mean of the
spread. It usually requires the trader to trade an equal amount in asset 𝑌 of price 𝑌& and asset 𝑋
of the price 𝛽𝑋& by
𝑌& = 𝛽𝑋&, 26
where 𝛽is the coefficient that makes the price of 𝑋 and 𝑌 equal when a position is opened
(Ting, 2017).
Sophisticated pairs trading strategies can involve different weightings instead of equal
weightings but is considered out of scope for this paper.
Recall that 𝑒& represent the spread between two assets at a given time and can be obtained by
regressing one asset on the other. In order to easily generate trading signals the spread gets
normalized by
𝑧& =𝑒& −𝜇Ywnurx𝜎Ywnurx
, 27
21
where, 𝑧& is the standard deviation away from 0 at time 𝑡, 𝑒& is the value of the spread at a given
time 𝑡, 𝜇Ywnurx is the mean of the spread and 𝜎Ywnurx is the standard deviation of the spread
(Palomar, 2018). A mathematical representation of the spread and 𝑒& is found in equation 14.
Positions are taken when 𝑧&drift from 0 and reach a certain value. These rules are referred to
as thresholds in this paper and are pre-specified trading strategies on when to open and close
positions. The spread is expected to be shorted when 𝑧& reaches a specific positive threshold
and the trader is expected to long the spread if the spread reaches a certain negative threshold.
According to Ting (2017) thresholds should be set to maximize returns and minimize the
amount of transactions. Therefore, thresholds should be as far away from zero as possible while
still capitalizing on the mean-reverting property of the spread in order to reduce transaction
costs and increase the likelihood of high quality trades.
The trading strategy for all portfolios in this study is as follows: Table 3 – Trading strategy
Trading Strategy Short the spread if 𝑧& > 1.75
Buy 𝛽X shares and short-sell Y shares.
Long the spread if 𝑧& < −1.75: Short-sell 𝛽X and buy Y shares.
Stop-loss if 𝑧& > 4. Exit both positions
Stop-loss if 𝑧& < −4. Exit both positions
Close positions if the spread reverts back to its mean 𝑧& = 0
Exit both positions
Notes: 𝑧& is the value of the normalized spread at a time t For portfolios where transaction costs are included, a 2% transaction cost will be subtracted
from the cumulative return of every position when a position is opened and closed. In addition,
a position will be closed if it is open on the last day of a trading window and a transaction fee
2% will be subtracted from the cumulative return.
22
5.2 Sharpe Ratio William F. Sharpe introduced the Sharpe Ratio as a way to measure mutual funds returns
adjusted to risk exposure. The ratio aims to describe the difference in expected return in excess
of the risk-free rate for one more unit of volatility (Sharpe, 1994). In general, investors prefer a
portfolio with high Sharpe ratio (SR) over a portfolio with low Sharpe ratio, ceteris paribus.
The Sharpe ratio is given by
𝑆w =𝐸 𝑟w − 𝑟z
𝜎w, 28
where 𝐸 𝑟w is the expected return of the portfolio, 𝑟z is the risk-free rate and 𝜎w is the standard
deviation of the portfolio.
23
5.3 Long position, short position and stop-loss A long position, a short position and a stop-loss are all different kinds of financial transactions
with different complexity. The simplest case is a long position which implies that the trader
buys an asset with the expectation that it will increase in value.
In contrast to a long position, the trader expects an asset to decrease in value when it is
shortened. In most cases, an investor will buy an asset and later sell it and commonly referred
to as a long position. However, in short selling the investor sells an asset first and buys it later.
This in the hope of selling the asset at a high price while waiting for the price to go down and
then buying it at a cheaper price. However, to be able to sell an asset without owning it, the
investor usually borrows the asset from a broker and is expected to pay a fee for the service
(Bodie, Kane & Marcus, 2013). A stop-loss is a predetermined rule to exit a position if a
condition is met. A stop-loss could for example be to exit a long position in Bitcoin if the market
value of Bitcoin reaches 4 000 USD.
In 2019, few brokers offer products to shorten cryptocurrencies. The transaction costs of taking
a short position in this paper is based on the spread of most major contract for differences
(CFDs) offered by the online broker Etoro.com and is set to 1.9%. The transaction cost used in
this thesis of a long position is set to 0.1% which is the transaction cost of buying and selling
cryptocurrencies on the cryptocurrency exchange Binance in May 2019. Hence, the transaction
cost of every pairs trading position when a position is opened will therefore be 1.9% + 0.1% =
2% of the present value of a position when transaction costs are included in the performance
evaluation of each portfolio.
24
6 Methodology This part of the thesis aims to explain the methodology of the paper. The decision to use the
ADF test, Johansen’s test and Phillips Peron’s test was on the basis that the tests are commonly
used cointegration tests and are easily implemented in the R programming language and
software. The decision to use 3-month and 6-month windows was based on that the time point
of the data in this study starts on November 1st 2017 and would therefore not allow for longer
windows if at least two are to be analyzed.
6.1 Identifying pairs – Engle-Granger´s approach As mentioned in section 4.1, it is redundant to test already stationary time series for
cointegration. Therefore, all cryptocurrencies are first tested on whether their individual time
series have a unit root by the ADF test. All currencies which have a unit root will then be tested
for cointegration with other cryptocurrencies which have a unit root using the ADF, PP and
Johansen’s test and all decisions will be made at the 5% significance level.
When testing for a unit root, each cryptocurrency will be tested on whether each individual time
series is integrated of order 1. For the scope of this thesis, all cryptocurrencies will only be
tested if they are integrated of order 1 and this is only tested through the ADF test although
time series can potentially be integrated of other orders.
For the Augmented Dickey Fuller and Phillips Peron’s cointegration test, the second step is to
regress the time series on each other and determine if the residual time series is stationary. A
stationary residual time series between two cryptocurrencies would mean rejecting the null
hypothesis that the time series exhibits a unit root.
The test regression for the ADF test is found in equation 11 and the test regression for Phillips
Perron’s test is found in equation 18.
6.2 Identifying pairs – Johansen´s approach When Johansen’s approach is used to test for cointegration between cryptocurrencies a bivariate
vector of two cryptocurrencies is set up (see equation 20).
Therefore, 𝑌& and 𝑍& are the time series of two cryptocurrencies that are individually integrated
25
of order 1 in equation 20.
Johansen’s reduced rank regression is then used to estimate 𝛼 and 𝛽 and leads to the rank of Π
which is derived in section 4.4 and becomes the number of cointegrated relationships which in
this thesis must be one or zero. The method to test the null hypothesis will in this study be based
on maximum eigenvalue and the test statistic can be found in equation 24.
6.3 Choice of cryptocurrencies
The selection criterion of cryptocurrencies to include in this study has been made based on the
highest market capitalization according to the website finance.yahoo.com on April 24th 2019
and consists of 14 cryptocurrencies. All cryptocurrencies but IOTA and Ethereum Classic had
a market capitalization exceeding one billion USD. The cryptocurrency Binance Coin has been
excluded from the study due to data constraints. A brief description of every cryptocurrency
can be found in Appendix B and their corresponding market cap in Table 1.
6.4 Pair Candidates Pairs are formed through testing 14 cryptocurrencies whether cointegration exists and if each
individual time series exhibit a unit root. There can at most be 91 cointegrated pairs when
performing a cointegration test on 14 cryptocurrencies in a window. The maximum numbers
of pairs is given by
𝑛(𝑛 − 1)2 , 29
where 𝑛 is the number of cryptocurrencies.
26
6.5 Composition of the buy and hold index The buy and hold index consists of the cumulative return of buying and holding each
cryptocurrency in a trading window without a pairs trading strategy. The buy and hold return
of every portfolio - Augmented Dickey Fuller, Johansen’s or Phillips Perion portfolio is given
by
𝑅𝑒𝑡𝑢𝑟𝑛𝑇𝑒𝑠𝑡~��rRx�W�x =
𝑅𝑒𝑡𝑢𝑟𝑛𝑐𝑟𝑦𝑝𝑡𝑜𝑐𝑢𝑟𝑟𝑒𝑛𝑐𝑖𝑒𝑠𝑖𝑛𝑤𝑖𝑛𝑑𝑜𝑤1𝑁𝑢𝑚𝑏𝑒𝑟𝑜𝑓𝑐𝑟𝑦𝑝𝑡𝑜𝑐𝑢𝑟𝑟𝑒𝑛𝑐𝑖𝑒𝑠𝑤𝑖𝑛𝑑𝑜𝑤1
∗ … ∗ 𝑅𝑒𝑡𝑢𝑟𝑛𝑐𝑟𝑦𝑝𝑡𝑜𝑐𝑢𝑟𝑟𝑒𝑛𝑐𝑖𝑒𝑠𝑖𝑛𝑤𝑖𝑛𝑑𝑜𝑤𝑡𝑁𝑢𝑚𝑏𝑒𝑟𝑜𝑓𝑐𝑟𝑦𝑝𝑡𝑜𝑐𝑢𝑟𝑟𝑒𝑛𝑐𝑖𝑒𝑠𝑤𝑖𝑛𝑑𝑜𝑤𝑡
, 30
where 𝑤𝑖𝑛𝑑𝑜𝑤𝑡 is the amount of trading windows. The return of each test is then combined by
𝑅𝑒𝑡𝑢𝑟𝑛~��rRx�W�x =𝑅𝑒𝑡𝑢𝑟𝑛𝐴𝐷𝐹~��rRx�W�x + 𝑅𝑒𝑡𝑢𝑟𝑛𝐽𝑂𝐸~��rRx�W�x + 𝑅𝑒𝑡𝑢𝑟𝑛𝑃𝑃~��rRx�W�x
3. 31
The buy and hold index will be used to compare the return of a pairs trading strategy.
6.6 Trading windows and testing methodology The methodology for trading pairs will follow the following scheme:
1. Test if each individual cryptocurrency exhibit a unit root over a 3- or 6-month testing
window through the ADF test. There will in total be 5 testing windows for the 3-month
method and 2 for the 6-month method.
2. All cryptocurrencies which exhibit a unit root will be tested for cointegration through
the ADF test, PP test or JOE test over a 3- or 6-month testing window. The cointegrated
cryptocurrencies will form pairs trading pairs and a portfolio of pairs will be formed.
3. All cointegrated pairs will be traded over a trading window which spans over the last
day of the testing window to 3 or 6 months further in time. There will in total be 5
trading windows for the 3-month method and 2 for the 6-month method.
As an example, if Bitcoin and Ethereum individually have a unit root and are cointegrated in
the first 3-month testing window then apply the pairs trading strategy on a Bitcoin and Ethereum
pair in the first 3-month trading window which spans over three months further in time from
the start date of the testing window. When trading window 1 has passed, test if Bitcoin and
Ethereum are a cointegrated pair in testing window 2. If they are a pair in testing window 2
then proceed to trade Bitcoin and Ethereum in trading window 2. If they are not a pair in testing
27
window 2 then don’t trade the pair in testing window 2. Pairs are tested for cointegration in
multiple windows since cointegrated relationships could potentially break over different time
periods. This could for example be because of drastic changes in demand for different
cryptocurrencies due to technical innovations or laws regarding certain cryptocurrencies. The
testing and trading windows for the 3-month and 6-month procedure is as follows
Figure5-Testingandtradingwindowsfollowingthe3-monthmethodology
Figure6-Testingandtradingwindowsfollowingthe6-monthmethodology
28
7 Results This section aims to evaluate the performance of the methodology of this paper. This is done
by assessing the number of cointegrated cryptocurrencies whose individual time series exhibit
a unit root and have a cointegrated relationship for each testing method by using 3-month
windows or 6-month windows and the ADF, JOE or PP test. The pairs that are found from a
certain test form an individual portfolio which will be compared with other portfolios with the
same testing and trading window procedure. For example, all cointegrated cryptocurrencies
based on Philips Peron’s test with the 3-month method form a portfolio and will be compared
with the portfolios from Johansen’s and the ADF test for the 3-month procedure. The
cointegration test period for every pairs trading portfolio is from November 1st 2017 to February
1st 2019 for the 3-month window and November 1st 2017 to November 1st 2018 for the 6-month
window method. The trading period is from February 1st 2018 to the May 1st 2019 for the 3-
month window method and May 1st 2018 to May 1st 2019 for the 6-month window procedure.
The cryptocurrency market has mostly been a bear market from November 1st 2017 to May 1st
2018 albeit showing a rapid increase in January 2018, (see Appendix B).
To evaluate the performance of the pairs trading strategy of each portfolio, the standard
deviation, Sharpe ratio and cumulative return are used. The cumulative return is presented with
and without transaction costs set to 2%. The cumulative return is expected to be as high as
possible and the standard deviation is ideally as low as possible, the Sharpe ratio is up to the
reader to interpret since returns have been both positive and negative for different portfolios
and interpretations of negative Sharpe ratios can be misleading (MacLeod & Van Vureen,
2015). In essence, the portfolio formed through the test with the highest return will be
considered the best strategy. The risk-free rate is considered to be 0% in May 2019 in Sweden.
29
7.1 Cointegrated pairs Table 5 shows the number of cointegrated pairs for every testing method. Johansen´s approach
detected the most pairs for the 3-month method as well as for the 6-month method. In total, 32
pairs were identified through Johansen’s approach following the 3-month procedure and 11
were formed with the 6-month procedure. The ADF test detected the least number of pairs. 11
in the 3-month window and 6 for the 6-month window procedure. Moreover, more pairs were
detected with the 3-month procedure compared to the 6-month procedure. In total, 67 pairs were
identified with the 3-month window method and 26 pairs were identified through the 6-month
method.
The Augmented Dickey Fuller test was the only test which found no pairs in a window. That
was the first testing window with the 3-month method where Johansen’s approach identified
15 pairs in the same window. Worth mentioning is that the cryptocurrency market was very
volatile over the time period in window 1(See Appendix A and B).
All tests had the same pair in a portfolio only once. That was Bitcoin (BTC) and Cardano (ADA)
in testing window 4 with the 3-month procedure (see Appendix A).
Table 4- Number of traded cointegrated pairs for the 3-month and 6-month method
Number of traded cointegrated pairs; 3-month window ADF JOE PP Trading window 1 0 15 4 Trading window 2 7 1 1 Trading window 3 2 7 11 Trading window 4 1 1 1 Trading window 5 1 8 7 Total: 11 32 24
Number of traded cointegrated pairs; 6-month window ADF JOE PP Trading Window 1 3 8 3 Trading Window 2 3 3 6 Total: 6 11 9 Note: Number of pairs where each individual time series has a unit root and the residual series is stationary. (p < 0.05 )
30
7.2 Evaluation of performance Table 6 shows the cumulative return, standard deviation and Sharpe ratio of each portfolio
without transaction costs and with transaction costs set to 2% for every position and each
corresponding buy and hold benchmark.
The buy and hold benchmark had a return of -71.2% for the 3-month window procedure and -
53.3% for the 6-month window procedure by the end of the trading period. All portfolios have
in every window outperformed their buy and hold benchmark and all portfolios with the 3-
month window procedure have outperformed their 6-month counterpart with an exception of
the portfolio formed through the ADF test without transaction cost where the 6-month portfolio
marginally outperformed the 3-month portfolio by 0.2%.
The portfolio formed through Phillips Peron’s test without transaction costs following the 3-
month method was the only portfolio with a positive cumulative return at the end of the trading
period and was 4.5%. Hence, the Phillips Peron’s portfolio without transaction costs following
the 3-month methodology was the only portfolio with a higher return than the risk-free rate of
0% at the end of the trading period.
The negative returns in the 3-month trading window is mainly due to a big drop in window 4
(see Appendix A) for all portfolios. Only one pair was traded in window 4 for all portfolios
which was BTC and ADA. All capital was invested in one pair in window 4 and the cointegrated
relationship between BTC and ADA broke and triggered a stop-loss which led to a big loss and
can be seen in the graphs in Appendix A.
The highest cumulative return without transaction costs following the 3-month window method
at a time point was found for the Phillips Peron portfolio, that was 30.6% on July 23rd 2018.
The highest cumulative return in the 6-month window at a time point was the portfolio formed
through Phillips Peron’s test and was 11.5% on August 27th 2018.
31
The lowest cumulative return without transaction costs for the 3-month window procedure at a
time point was -8.2% and from the ADF portfolio on November 19th 2018. The lowest
cumulative return for the 6-month method at a time point was -20.2% on March 31st 2019 and
from the portfolio formed through Johansen’s test. Moreover, the portfolios formed through
Johansen’s test had the lowest cumulative return in all scenarios. For a more detailed illustration
of the cumulative return of different portfolios in different windows at different times (see
Appendix A). All portfolios had a positive cumulative return at the end of trading window 3
with and without transaction costs following the 3-month procedure.
Table 5 – Performance statistics at the end of the trading period of different portfolios with 3-month and 6-month
windows
Without transaction costs
ADF JOE PP B&H
Windows 3-Month 6-Month 3-Month 6-Month 3-Month 6-Month 3-Month 6-Month
Return -4.4% -4.2% -4.8 -11.2% 4.5% -1.6% -71.1% -53.3%
StDev 0.027 0.069 0.088 0.067 0.093 0.029 0.244 0.149
SR -1.630 -0.609 -0.545 -1.672 0.484 -0.552 -2.938 -3.577
With transaction cost
Windows 3-Month 6-Month 3-Month 6-Month 3-Month 6-Month 3-Month 6-Month
Return -16.7% -21.7% -23.5% -23.6% -17.3% -18.8% -71.1% -53.3%
StDev 0.094 0.066 0.113 0.097 0.125 0.067 0.244 0.149
SR -1.777 -3.287 -2.080 -2.433 -1.384 -2.806 -2.938 -3.577 Note: Performance statistics for pairs trading portfolios formed through the ADF test, Johansen’s test, Phillips Peron’s and a buy and hold strategy. The trading period range is from 01-11-2018 to 01-05-2019 for the 3-month portfolios and between 01-05-2018 to 01-05-2019 for the 6-month portfolios.
32
8 Conclusions The main conclusion of this thesis is that cointegrated relationships between cryptocurrencies
are more likely to hold over a shorter period of time. Therefore, during the research period and
following the methodology of this paper, our results show that following a 3-month trading and
testing procedure yields a higher return than following a 6-month procedure and also resulted
in more pairs.
Another important conclusion is that Phillips Peron’s test was best at predicting a cointegrated
relationship with a spread oscillating around 1.75 standard deviations between cryptocurrencies
during the research period outlined in this paper. This is because of the portfolios formed
through Phillips Peron’s test had the best performance with both window methods. In contrast,
Johansen’s test was the worst at predicting a cointegrated relationship with a spread oscillating
around 1.75 standard deviation and Johansen’s testing method detected the most pairs. This
implies that Johansen’s testing approach found the most pairs in testing windows which were
not cointegrated in trading windows.
In addition, our results show that our pairs trading strategy was most effective when the market
showed a bear trend and high volatility. Therefore, all portfolios had a positive return without
transaction costs in trading window 1 and 2 while the buy and hold index dropped by -40% (see
Appendix A).
Cryptocurrencies are not likely to be cointegrated over a long period of time. That is most likely
due to the high volatility of cryptocurrencies. Hence, only one pair was shown in two windows,
ETH and EOS following the 6-month procedure with the ADF test (see Appendix B).
Lastly, pairs trading can successfully be applied on cryptocurrencies. Our strategy has proven
to outperform every corresponding buy and hold benchmark for every portfolio in every
window scenario. However, transaction costs of 2% are considered to be too high in order to
generate a profitable pairs trading strategy based on cryptocurrencies with the trading strategy
outlined in this paper over a long period of time.
33
9 Limitations The conclusion based on the results of this thesis have limitations. First, the performance of a
pairs trading portfolio is highly dependent on the trading rules of the pairs trading algorithm.
For example, if the spread is mean reverting but the spread does not oscillate around 1.75
standard deviations then the strategy will not capitalize on the mean reverting property of the
spread. This means that a portfolio formed through another statistical test could potentially
perform better with other trading rules in the trading algorithm.
Another weakness is that many cryptocurrencies were launched in 2017 (see section 2) and the
cryptocurrency market has shown a bear trend after a boom in January 2018 (see Appendix B).
Conclusions based on results of this thesis can therefore only be made on a bear market.
Lastly, the interpretation of the results of this thesis can be misleading. Externalities can break
cointegrated relationships because of drastic changes in demand that a statistical test cannot
predict. That could for example be due to new technical innovations or laws regarding certain
cryptocurrencies. Therefore, a statistical test could correctly identify pairs in testing windows
where the cointegrated relationship breaks over a trading window and can lead to a negative
return. An illustrative example of when a cointegration relation did not hold over a trading
window is BTC and ADA in trading window 4 following the 3-month trading procedure where
a big drop in the cumulative return occurred for all portfolios even though all testing methods
detected BTC and ADA as a pair in testing window 4 (see Appendix A).
34
10 Further research The results and conclusions of this thesis gives room for further research. First, the
methodology and statistical cointegration tests outlined in this paper could be tested on other
asset classes. That could for example be ETFs of stock indexes or traditional commodities. The
conclusion that Phillips Peron’s and that shorter time windows were the best methods would be
strengthened if the portfolio formed through Phillips Peron’s test, with short time windows,
would have the best performance for other asset classes with the same trading rules.
Moreover, in order to strengthen the conclusions of this thesis, comparing the performance of
other trading rules on the same pairs is suggested for further research. This is to use higher
thresholds and stop-losses and to not exit a position when the spread reverts back to its mean.
Also, all capital has been invested in every window regardless of the amount of traded pairs in
one window. This means that all capital is invested in only one pair if one pair is detected in a
testing window. Hence, to weight invested capital differently is suggested for further studies.
That could for example be to just allocate 2% to 10% of invested capital in one pair regardless
of the number of pairs in a portfolio.
Likewise, other statistical tests could be used to analyse the persistence of cointegration among
cryptocurrencies. That can for example be to use Phillips-Ouliaris test or the simple Dickey-
Fuller test to find pairs. Another suggestion for further research is to hold positions until they
should be closed according to the pairs trading strategy. In this thesis every open position in
this study is closed by the end of a trading window which is not ideal or realistic. Hence,
evaluating the performance of portfolios where positions are closed when the spread reverts to
the mean or reaches a stop-loss regardless of window and time is suggested. Also, analysing
why the different cointegration tests detect pairs differently is suggested for further research.
Lastly, the main conclusion of this thesis is that shorter windows showed to have a higher return
than longer windows following the methodology of the thesis. Therefore, analyzing shorter
time windows is suggested. That can for example be to follow the methodology of this paper
with 1-month windows. However, shorter windows leads to higher transaction costs meaning
that there will always be a trade-off between the length of windows and transaction costs.
35
References
ASTERIOUS, D & Hall, G. (2016). Applied Econometrics. London: Palgrave MacMillan.
BITCOIN. (2019). What is Bitcoin. Available: https://bitcoin.org/en/faq#what-is-bitcoin
[2019-04-20]
ROSIC, AMER. (2016). What is cryptocurrency. Available:
https://blockgeeks.com/guides/what-is-cryptocurrency/ [2019-05-03].
BODIE, KANE & MARCUS. (2013). Essentials of Investments. New York: McGraw-Hill
Education.
BROOKS, C. (2002). Introductory Econometrics for Finance. Cambridge: Cambridge
University Press.
CNBC. (2018). Warren Buffet: Cryptocurrency will come to a bad ending. Available:
https://www.cnbc.com/video/2018/01/10/warren-buffett-cryptocurrency-will-come-to-a-bad-
ending.html [2019-04-20].
COIN MARKET. (2019). Top cryptocurrencies exchange list. Available:
https://coin.market/exchanges [2019-04-07].
COINMARKETCAP. (2019). Global Charts. Available: https://coinmarketcap.com/charts/
[2019-04-09].
COINSWITCH. (2019). What is Cardano (ADA)? Future of ADA cryptocurrency and know
how to buy ADA. Available: https://coinswitch.co/info/cardano/what-is-cardano [2019-04-21]
COINSWITCH. (2019). What is EOS? Future of EOS cryptocurrency and know how to buy
EOS. Available: https://coinswitch.co/info/eos/what-is-eos [2019-04-21]
COINTELEGRAPH. (2019). What is Ethereum, Guide for beginners. Available:
https://cointelegraph.com/ethereum-for-beginners/what-is-ethereum [2019-04-21]
COINSWITCH. (2019). What is Stellar Lumen. Available: https://coinswitch.co/info/stellar-
lumens/what-is-stellar-lumens [2019-04-21]
COINSWITCH. (2019). What is Tron (TRX)? Future of TRX cryptocurrency and know how
to buy TRX. Available: https://coinswitch.co/info/tron/what-is-tron [2019-04-21]
D. CRYER, J & KUNG-SIK, C. (2009). Time Series Analysis with applications in R. Berlin:
Springer Verlag Gmbh.
ENGLE, R & GRANGER, W. (1987). Co-integrationand Error Correction: Representation
Estimation, and Testing, Econometrica, vol 55, No 2, pp 251-276
36
GATEV, E, GOETZMANN, N & GEERT ROUWENHORST (1999). Pairs Trading
Performance of a relative value arbitrage rule. Review of Financial Studies. Vol 19, pp 797-
827.
GENESIS MINING. (2019). WHAT IS DASH CRYPTOCURRENCY, Available:
https://www.genesis-mining.com/what-is-dash [2019-04-21].
HUCK, N & AFAWUBO, K. (2015). Pairs trading and selection methods: is cointegration
superior?. Applied Economics, vol 47, p 599-613.
IMBERT, F. (2017). Black Rock CEO Larry Fink calls Bitcoin an index of money laundering.
CNBC,13th of October. Available: https://www.cnbc.com/2017/10/13/blackrock-ceo-larry-
fink-calls-bitcoin-an-index-of-money-laundering.html [2019-04-22].
JEFFERIE, A (2018). Inside the struggle of Bitcoin and Bitcoin Cash. The Verge. 12th of
April. Available: https://www.theverge.com/2018/4/12/17229796/bitcoin-cash-conflict-
transactions-fight [2019-04-20].
JORION, P. (2000). Risk Management Lessons from Long-Term Capital Management,
European Financial Management, vol 6.
KHATWANI, S. (2018). Monero Cryptocurrency: Everything You Need To Know.
Coinsutra, 8th of October. Available: https://coinsutra.com/monero-cryptocurrency/ [2019-
04-20]
LEE, D, GUO, L & WANG, Y. (2018). Cryptocurrency: A new investment opportunity?.
Singapore: Lee Kong Chian School Of Business. Available:
https://ink.library.smu.edu.sg/cgi/viewcontent.cgi?article=6783&context=lkcsb_research
[2019-04-21]
MACLEOD, W. VAN VUREEN, G. (2015). Interpreting the Sharpe ratio when excess
returns are negative. Investment Analysis Journal, vol 33
MILUTINOVIC, M. (2018). Cryptocurrency. Ekonomika (Vol 64)
NEUSSER, K. (2016). Time Series Econometrics, Berlin: Springer Verlag Gmbh.
NJUI, J. (2018). How Coinbase is En Route o Becoming the ‘NYSE’ of Crypto, EWN,
16th of September. Available: https://ethereumworldnews.com/how-coinbase-is-en-route-to-
becoming-the-nyse-of-crypto/ [2019-04-21].
PALOMAR, D. (2018). Portfolio optimization with R, Pairs Trading with R. Available:
http://www.ece.ust.hk/~palomar/MAFS6010R_lectures/week%2012/Rsession_pairs_trading_
with_R.html [2019-04-20]
SCHWERT, W (1989). Why does stock market volatility change over time?. The Journal of
finance, vol 44.
37
SHARPE, W.F. (1994). The Sharpe Ratio. Journal of Portfolio Management, vol. 21, no. 1,
pp. 49-58.
SYCZEWSKA, E. ( 2011). COINTEGRATION SINCE GRANGER: EVOLUTION A
DEVELOPMENT. QUANTITATIVE METHODS IN ECONOMICS, Vol. XII, No 1, 2011, pp.
147-164
TETHER. (2019). About Tether. Available: https://tether.to/faqs/ [2019-04-21]
TING, C. (2017). Quantitative Trading Strategies. Available:
http://www.mysmu.edu/faculty/christophert/QF206/Week_12.pdf?fbclid=IwAR11zhmAymJp
f2hDz85uNFxKe8PFpt-zUbKaszIObY2wPmGHfEUSSXg9544 [2019-04-20].
UKCRYPTOCURRENCY. (2019). Introduction: What is IOTA?. Available:
https://ukcryptocurrency.com/iota/introduction-what-is-iota/ [2019-04-21]
VIDYAMURTHY, G. (2004). Pairs Trading, Quantitative Methods and Analysis. New
Jersey: Wiley Finance.
YOGESH, J. (2017). 5 impacts of Bitcoin on Economy, Banking & Finance.
Newgenapp[blog].
25th of July. Available:https://www.newgenapps.com/blog/impact-of-bitcoins-on-the-
economy-banks-finance [2019-04-21]
XU & LUETKEPOHL. (2012). The Role of the Log Transformation in Forecasting Economic
Variables. Emperical Economics, vol 42, pp 619-638.
38
Appendix A Performance 3-month window
39
Performance 6-month window
40
List of pairs ADF test 3-month window
DATES ASSET 1 ASSET 2 ADF P-VALUE 2017-11-01 - 2018-02-01 None None None 2018-02-01 - 2018-05-01 XMR-USD DASH-USD 0.010 BCH-USD DASH-USD 0.017 BCH-USD XMR-USD 0.021 BCH-USD XLM-USD 0.035 BCH-USD IOT-USD 0.040 EOS-USD ADA-USD 0.044 XLM-USD DASH-USD 0.047 2018-05-01 - 2018-08-01 BTC-USD TRX-USD 0.013 BTC-USD EOS-USD 0.028 2018-08-01 - 2018-11-01 BTC-USD ADA-USD 0.013 2018-11-01 - 2019-02-01 XLM-USD USDT-USD 0.049
List of pairs ADF test 6-month window
DATES ASSET 1 ASSET 2 ADF P-VALUE 2017-11-01 - 2018-05-01 XLM-USD DASH-USD 0.024 USDT-USD DASH-USD 0.045 LTC-USD ADA-USD 0.049 2018-05-01 - 2018-11-01 LTC-USD TRX-USD 0.010 BCH-USD USDT-USD 0.047 ETH-USD EOS-USD 0.049
List of pairs PP test 3-month window
DATES ASSET 1 ASSET 2 PP P-VALUE 2017-11-01 - 2018-02-01
BTC-USD XRP-USD 0.003 XLM-USD IOT-USD 0.016 XLM-USD USDT-USD 0.025 XMR-USD IOT-USD 0.031
2018-02-01 - 2018-05-01 BCH-USD XLM-USD 0.035
2018-05-01 - 2018-08-01 EOS-USD TRX-USD 0.007 EOS-USD ETC-USD 0.008 ADA-USD DASH-USD 0.009 BCH-USD XLM-USD 0.009 BTC-USD EOS-USD 0.010 BTC-USD TRX-USD 0.013 BCH-USD ETC-USD 0.020 ETH-USD BCH-USD 0.020 ETH-USD TRX-USD 0.023 ETH-USD EOS-USD 0.025 BTC-USD ETC-USD 0.032
41
2018-08-01 - 2018-11-01 BTC-USD ADA-USD 0.005
2018-11-01 - 2019-02-01 XLM-USD USDT-USD 0.003 XLM-USD XMR-USD 0.019 USDT-USD TRX-USD 0.038 USDT-USD DASH-USD 0.041 BTC-USD USDT-USD 0.042 XLM-USD DASH-USD 0.043 BTC-USD XLM-USD 0.045
List of pairs PP test 6-month window
DATES ASSET 1 ASSET 2 PP P-VALUE 2017-11-01 - 2018-05-01
XLM-USD USDT-USD 0.008 ETH-USD XMR-USD 0.022 XLM-USD IOT-USD 0.040
2018-05-01 - 2018-11-01 EOS-USD TRX-USD 0.007 ETH-USD TRX-USD 0.009 ETH-USD EOS-USD 0.022 LTC-USD TRX-USD 0.029 XLM-USD XMR-USD 0.031 ADA-USD DASH-USD 0.041
List of pairs Johansen’s test 3-month window
DATES ASSET 1 ASSET 2 JOE P-VALUE 2017-11-01 - 2018-02-01
XRP-USD IOT-USD 0.007 XRP-USD USDT-USD 0.008 XRP-USD XMR-USD 0.009 BTC-USD XRP-USD 0.009 XRP-USD XLM-USD 0.009 XRP-USD TRX-USD 0.009 XRP-USD ADA-USD 0.010 XRP-USD LTC-USD 0.010 XRP-USD ETC-USD 0.010 XRP-USD EOS-USD 0.012 XRP-USD ETH-USD 0.013 XRP-USD BCH-USD 0.017 XRP-USD DASH-USD 0.017 ETH-USD EOS-USD 0.026 BCH-USD ADA-USD 0.047
2018-02-01 - 2018-05-01 ETH-USD IOT-USD 0.041
2018-05-01 - 2018-08-01 BCH-USD XLM-USD 0.002 BCH-USD ETC-USD 0.006 EOS-USD ETC-USD 0.011 ETH-USD ETC-USD 0.012 EOS-USD TRX-USD 0.022 BTC-USD EOS-USD 0.026 BTC-USD BCH-USD 0.035
2018-08-01 - 2018-11-01 BTC-USD ADA-USD 0.049
42
2018-11-01 - 2019-02-01 BCH-USD EOS-USD 0.005 USDT-USD TRX-USD 0.009 XRP-USD ADA-USD 0.009 XRP-USD IOT-USD 0.018 ADA-USD DASH-USD 0.029 XLM-USD USDT-USD 0.031 XRP-USD DASH-USD 0.047 BTC-USD USDT-USD 0.048
List of pairs Johansen’s test 6-month window
DATES ASSET 1 ASSET 2 JOE P-VALUE 2017-11-01 - 2018-05-01
ETH-USD EOS-USD 0.008 EOS-USD XMR-USD 0.014 BTC-USD ETH-USD 0.026 LTC-USD EOS-USD 0.030 BTC-USD EOS-USD 0.032 XMR-USD DASH-USD 0.036 USDT-USD DASH-USD 0.037 XLM-USD USDT-USD 0.049
2018-05-01 - 2018-11-01 EOS-USD TRX-USD 0.023 ETH-USD TRX-USD 0.039 BCH-USD XMR-USD 0.045
43
Example of positions in trading window – Bitcoin Cash and Monero Pair
Note: The graph shows position for a Bitcoin Cash/Monero pair. A value of 1 for the position series implies a long position of the spread and 0 implies a neutral position
44
Testing and trading windows Testing window; 3-months
Start date End date Testing window 1 2017-11-01 2018-02-01 Testing window 2 2018-02-01 2018-05-01 Testing window 3 2018-05-01 2018-08-01 Testing window 4 2018-08-01 2018-11-01 Testing window 5 2018-11-01 2019-02-01 Trading window; 3-months Start date End date Trading window 1 2018-02-01 2018-05-01 Trading window 2 2018-05-01 2018-08-01 Trading window 3 2018-08-01 2018-11-01 Trading window 4 2018-11-01 2019-02-01 Trading window 5 2019-02-01 2019-05-01 Testing window; 6-months Start date End date Testing window 1 2017-11-01 2018-05-01 Testing window 2 2018-05-01 2018-11-01 Trading window; 6-months Start date End date Trading window 1 2018-05-01 2018-11-01 Trading window 2 2018-11-01 2019-05-01
45
Appendix B Total market cap of cryptocurrencies from November 2017 1st to May 1st 2019
(Coinmarketcap.com, 2019) Market dominance of different cryptocurrencies from April 28th 2013 to May 6th 2019
(Coinmarketcap.com, 2019)
46
How miners create coins and confirm transactions
(Rosic, 2016).
47
Description of each cryptocurrency in the study Bitcoin – the most commonly used cryptocurrency in the world built on a peer-to-peer
electronic system. The first Bitcoin specification and proof of concept was published in 2009
in a mailing list created by Satoshi Nakamoto (Bitcoin.org, 2019).
Ripple – introduced by Authur Britto, Ryan Fugger and David Schwartz in 2012 the Ripple
transaction protocol builds on distributive open source internet protocols. Financial institutions
are rapidly adopting the Ripple cryptocurrency due to its primary purpose to enable quick and
secure global transactions without fees (Monia, 2018).
Ethereum – Ethereum was created by the young Russian-Canadian crypto genius Vitalik
Buterin born in 1994. Ethereum and Bitcoin are similar in a way that the both use blockchain
technology. However, Ethereum’s blockchain is designed to allow more functions which could
be useful in the business world. Ethereum runs on smart contracts which are computer
algorithms which automatically fulfills terms of a contract as soon as conditions are met.
Ethereum’s ambition is to become the new internet and has its own browser and programming
language (Coinintelegraph.com, 2019).
Bitcoin Cash – derived from the code of Bitcoin. Bitcoin cash has more blocks in the
blockchain than Bitcoin which allows for faster transactions (Jefferies, 2018).
Litecoin – developed by former Google employee Charles Lee. Like Bitcoin, Litecoin builds
on a peer-to-peer platform which allows for quick transactions. Litecoin is technically very
similar to Bitcoin but allows for quicker transactions (Monia, 2018).
EOS – EOS’s objective is to provide a decentralized platform to implement smart contracts,
host applications and use blockchain for business while solving the issues involving scalability
of Bitcoin and Ethereum (Coinswitch, 2019).
Tether – launched in 2014, Tether is a blockchain-enabled platform which allows individuals
to store, send and receive tokens pegged to the U.S dollar (Tether, 2019).
48
Stellar – developed by former Ripple CTO Jed McCaleb and lawyer Joyce Kim in 2014. Stellar
leverages blockchain technology and allows for fast transactions. What set Stellar apart from
other cryptocurrencies is its distributed exchange. The Stellar network allows users to place
currency exchange offers on the ledger. This means that the payer can send his payment in his
desired currency and while the payee can receive the same payment in his desired currency
(Coinswitch, 2019).
Cardano – Cardano is a decentralized cryptocurrency which aims to combine the transactional
properties of Bitcoin and the smart contracts of Ethereum (Coinswitch, 2019).
Tronix – cryptocurrency aimed towards the entertainment industry. It aims to cut out
middlemen which connect users to creators. Moreover, it reduces the traffic dependency on
sites like Youtube and Facebook, this since traffic will be streamlined back to the creators and
removing the middle man (Coinswitch, 2019).
Monero – monero emphasizes privacy more than other cryptocurrencies. Monero coins cannot
be traced backed to the blockchain and it is impossible to see how many Monero coins a
counterpart holds (Khatwani, 2018).
Digital Cash – Dash is built on the same technology as Bitcoin but with added features, faster
transaction speed and lower costs (Genesis-mining, 2019).
IOTA USD – cryptocurrency which does not use blockchain technology and instead uses a
system called Tangle. It was designed for the internet of things and has no associated transaction
fees (UKcryptocurrency, 2019).
top related