Categories

## Cointegration Demystified

The tale of a drunk and her dog

In 1987, two Nobel prize-winning economists introduced the concept of a co-integrating vector through their research paper (Engle & Granger)¹.  (Murray, 1994)² illustrated the concept of cointegration through the now famous tale of “A drunk and her dog”.

A time series is a series of data points ordered in time. For example, the price of a stock over the past 5 years. Two time series may behave like two drunk people wandering around. The two people are independent; there is no meaningful relationship between their paths. Knowing where one of them is, may not help us find the other drunkard. However, given a drunkard’s location, it could be possible to predict, at least to some extent, where her dog might be. Let’s call him Coco. The path followed by both is still unpredictable. However, given the location of one, we might be able to predict the location of the other. In other words, the distance between the two is fairly predictable.

The drunk owner and her dog Coco form a cointegrating pair. Note the probabilistic nature of the cointegration. Coco is not on a leash; the distance between the drunk and the dog is not fixed. However, it is likely that if they end up too far apart, Coco will run back towards his owner, reducing the distance between them to what it usually tends to be.

Cointegration

Simple definition:
Cointegration is a statistical property exhibited by time series data. The movement of two time series together is called cointegration. It refers to a long-run equilibrium relationship between the two time series.

Technical definition :
Mathematically, two time series, say X and Y, are cointegrated if both of them, individually, are integrated of order d [I(d)] but there exists some combination of them, such as, aX + bY, which is integrated of order zero [I(0)].³

Cointegration can be tested for using the Engle Granger and Johanson cointegration tests.

We can extend this concept to financial assets – cointegrated stocks, futures, currencies and more. If the stocks Amazon and Alphabet are cointegrated, there is some relationship between them that could allow us to predict how they are likely to move, in relation to each other. If their ratio tends to remain constant in the long run, long short trading strategies can be built around exploiting the short run deviations from the average ratio. This can be explained in greater detail later;  the concept of pairs trading and statistical arbitrage deserves a separate article.

Cointegration vs correlation

These are two separate concepts.
1. Cointegration is the co-movement and mutual association of two time series through some combination of them; correlation refers to the directional relationship between the two time series. Neither necessarily implies causation.

2. Correlation is a short-run concept while cointegration is a long-run concept. Correlations are more unstable and sensitive to the length of the period over which they are calculated.

3. It is possible for a cointegrated pair to be uncorrelated and for a correlated pair to not exhibit any cointegration. For example, two positively correlated stocks may grow further apart in the long run even if they move in the same direction in the short run and vice versa.

The absence of correlation does not indicate independence of two time series.

4. Because of the nature of most of the financial time series data (nonstationary⁴), the correlations between them may be spurious (false). Cointegration is a stronger, more reliable measure. For example, two time series could appear highly correlated simply because both are trending higher over time; they may have no actual relationship. Not only does this lead to absurd results, these results also appear to be falsely statistically significant; the usual T and F statistical tests are not applicable for non-stationary data; they assume stationarity (constant mean, autocovariance).

Example of a spurious corrrelation: The US Defense Expenditure and the population of South Africa has a correlation of 0.97 over the period 1971-1990.⁵

Two time series are cointegrated only if there is a genuine relationship between them. It is possible to create trading strategies based on correlation as well. However, one would be well advised to do a sense check; how meaningful is that relationship and the chosen time horizon?

References:

¹Engle, R. F., & Granger, C. J. (1987, March). Co-Integration and Error Correction: Representation, Estimation and Testing. Econometrica, 55(2), 251-276.

²Murray, M. P. (1994, February). A Drunk and Her Dog: An Illustration of Cointegration and Error Correction. The American Statistician, 48(1), 37-39.

³This is the order of integration concept. An I[1] series needs to be differenced once for making it stationary i.e. I[0].

⁴A non-stationary time series is a time series which does not have a constant mean and autocovariance over time, rendering it useless for prediction, unless transformed into a stationary series.

Categories

## FX Carry Trading Part 2

In Part 1 of this series we covered the lingo and mechanics of a carry trade. Thank you for your feedback for Part 1! Part 2 focuses on the importance, risk and return of this strategy. As suggested by our readers, we also explain the concept of hedging. Let us carry on!

We chose to write on this topic because it illustrates a modern application of financial engineering in practice.

Japan has faced zero, near zero or negative interest rates for close to three decades now.

In the current macroeconomic environment, interest rates in developed economies are either very low or negative. Carry trades could serve as an investment product offering superior returns, useful for medium and long term investors. Carry trades tend to attract hot money, invested by those that actively seek out returns in the short run. But they could also prove useful for large institutional investors such as insurance companies (mainly life insurance companies), pension funds and endowment funds which generally seek long term investment opportunities and hold bond positions till maturity.

When is a carry trade profitable?

This is when the extra coupon exceeds the loss (if any) on an adverse exchange rate movement. We would hope for either the currency pair to remain stable over the holding period or move in our favour (for extra return from the target currency appreciation).

What are the risks involved?

1. Exchange rate risk. Foreign (target currency) depreciation or devaluation by Central Banks inflicts losses. Emerging market currencies tend to be very volatile.
2. Interest rate risk: Monetary policy decisions by Central Banks (changes in interest rates and outlook).
3. Negative market sentiment and heightened volatility. Uncertainty and fear can lead to carry trade unwinds. This can cause large exchange rate movements, inflicting further losses.
4. Leverage (if any) will magnify losses.

What is an example of a real-life carry trade?

Julian Robertson, a billionaire hedge fund manager, is one of the most famous carry traders in history. He used to trade USD/JPY on leverage. In the period between 1995 and 1998, USDJPY appreciated by more than 66% (caused partially due to carry traders who bought the dollar and sold the yen). The carry was 15% at the time. So his total return was around 81% p.a. However, in 1998, due to the Russian debt crisis and the near collapse of LTCM, carry trades were unwound and this caused a sudden appreciation of the yen. Robertson is said to have made huge losses, of around \$2 billion¹.

Hedging means reducing the risk of a transaction. In part 1, we illustrated a USDTRY carry trade. The depreciation of TRY is the foreign exchange risk in this transaction. This would mean that the Turkish Lira has become less valuable. Hence, on conversion we would get less USD. One way to reduce this risk (hedge) is to buy a forward on USDTRY.

A forward is an instrument which allows you to fix the rate at which you would do the conversion in the future. If you go long (buy) a forward on USDTRY, on a fixed date in the future, you will sell your TRY holdings to buy USD at a fixed rate which is known to you now itself.

Carry trades are usually unhedged; no forward is purchased to reduce the risk. This is because sometimes carry trades are entered into mainly for exposure to the FX risk. An investor may have a view that the target currency TRY will appreciate or USDTRY will remain stable over the investment period. The potential return from undertaking the FX risk could largely outweigh the carry.

What makes a carry trade possible?

According to interest rate parity theory, it should not be possible to make a return because the higher yield currency should depreciate by the extent to which the yield is higher. However, it was been observed that this theory does not always hold. This anomaly is called the Forward Premium Puzzle. Empirical findings indicate that sometimes the currency with the higher interest rate appreciates instead of depreciating, which makes carry trades possible.

Can the concept of carry be applied elsewhere?

“Carry” simply means the return that you make by holding an asset or a position. This concept can be applied across asset classes.

1. Currency/bond carry trade (Using spot or derivatives or bonds to take positions)
3. Commodity carry trade (Roll yield)
4. Equity carry trade (Long short dividend yield)

References:

Categories

## FX Carry Trading Part 1

In part 1 of this series, we cover the meaning and mechanics of a carry trade. In part 2 (upcoming next week), we will cover carry trading significance, risks and return in more detail.

Technical definition (Ours): A carry trade is an unhedged investment in another currency due to the higher absolute yield at the time of the investment.

What is a carry trading strategy?

Simple meaning: Borrow money cheap and invest it where you get high returns.

Below is an illustration of a carry trade using bonds.

Example: As of writing, the 1 year US Government bond yield is around 0.2% and the 1 year Turkey Government bond yield is much higher at around 8.4%. Short (sell/borrow) the US Government bond and go long (buy/invest) the TRY Bond. This would result in a return of 8.2% if the USDTRY exchange rate remains unchanged. If TRY depreciates, this return will reduce (on conversion you will get less USD).

This is interest rate arbitrage. We define arbitrage here as “the simultaneous purchase and sale of the same or similar security in two different markets for advantageously different prices” (Sharpe and Alexander, 1990)¹. However, this does not satisfy the other usual definition of arbitrage, which refers to risk free profit. Because the foreign exchange risk is not hedged, the transaction is NOT risk free.

What are the components of a carry trade?

Funding currency (Home currency) – The currency in which the lower interest-paying bond is denominated. Popular funding currrencies: YEN, CHF, EUR.

Target currency – The currency in which the higher interest-paying bond is denominated.
Popular target currencies: TRY, RUB, INO, CNY, INR.

The funding currency is used to buy the bond denominated in target currency.

Carry – The difference in the interest rate of two government bonds in different currencies. This is the incentive for the trade.

FX Return – The target currency appreciation would provide an additional return over and above the carry.

Reference: ¹ Sharp, W. & Alexander, G. (1990). Investments, 4th edition, Prentice Hall, Eangle-Wood Cliffs, N. J.

Categories

Fixed trading strategies cannot adapt to the market. You could wear the same tee shirt everyday but at some point you will sweat and that shirt is going to smell. That’s stale, boring and risky. You should probably adapt your clothes washing routine to the weather.

Example – Assume that my love for Elon Musk, his future plans for Tesla Inc and my financial analysis has made me bullish on the Tesla stock for the coming few weeks. The stock has been swinging quite wildly and this volatility is expected to continue.

Strategy:
Buy Tesla at the start of the trading session every morning and sell it when it reaches a high.

But how do I set my profit target and stop loss? Let us say I check the range in which stock has remained for the past week. A 5 day average tells me that the stock moved by 150 points intraday (High – Low). I shall set my profit target 150 points above the share price at the start of the session and my stop loss 150 points below. So if the price at the start of the session is 900, my target will be 1050 and stop loss will be 750.

The extent of volatility is likely to change over the coming days. What change can I make to try and maximise my winnings? I can make the trading range dynamic. The 5 day average will be updated to include the latest trading session and exclude the oldest one. The average will therefore, move with the market and my profit target and stop loss levels too.

– Dynamic technical indicators (7 day moving average vs 20 day moving average)
– Rolling statistics such as correlations (say, 20 day moving average since relationships between two securities can change over time)
– Trade amount (1% of my account balance. If I’m making more money, I can afford to place bigger bets!)

A related term is Dynamic Hedging (more popular). It’s the same concept, used in risk management, where you actively adjust the hedge for a position.

Categories

## Big Data

What is big data?

Technical definition: Big Data refers to datasets whose size is beyond the ability of typical database software tools to capture, store, manage and analyze.*

Simple definition: Big Data is a buzzword for large amounts of data.

The Vs of Big Data:
1. Volume (High Quantity)
2. Velocity (High speed of capture)
3. Variety (High complexity)
4. Veracity (Trustworthiness)
5. Value (Meaningful)
6. Visualisation (Graphical representation)

Uses for Big Data in Finance:
-Financial modelling
-Real time analytics
-Machine learning

Example of big data being used in trading:
A Hedge Fund called Coniecto Technologies uses Big Data to estimate its investment risks. For this it gathers a lot of data to make more precise estimates.

1. Volume – Past data of market variables (stock indices, FX, Bonds, Commodities, Crypto price and volumes) since inception
2. Velocity – Hourly crypto price and volume data
3. Variety – Analyst reports, news feeds, sentiment analysis of Twitter
4. Veracity – Official data from trustworthy exchanges
5. Value – Helps to understand relationships between market variables, say, exchange rates and interest rates
6. Visualisation – Heat map indicating volatility of assets (Colours low to high volatility using a green to red gradient)

Challenges in using Big Data:
2. Inconsistent and incomplete data (For example – Missing values)
3. Heterogeneity of data (Diversity) (prices, reports, social media analytics etc)
4. Data privacy and protection (ethical considerations)

Some Big Data tools:
R

Categories

Quantitative trading means trading (buying and selling securities such as stocks) using certain specific strategies. We use math and Big Data (large amounts of data) to discover patterns in their movement. The trading is sometimes automated (run by a computer without humans).

A very simple example : Buy Tesla shares today if the stock has risen continuously for the past 3 days. We can calculate how likely it is that this strategy might work. For the past 2 years, how many times did the stock rise on the 4th day after a continuous rise for 3 days?

Quantitative trading involves the below steps:
1. Gather Data
2. Backtest strategy (Check if a strategy could have worked in the past)
3. Strategy Execution (Trade using real money)
4. Manage risk (Try to limit your losses)