Questions tagged [cointegration]

Cointegration is often used in statistical abitrage as a way to identify how to combine some tradable instrument to obtain a *mean reverting* one.

Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

Does cointegration test of exogenous variable with Y variable make sense when doing ARIMAX/SARIMAX?

The cointegration test between two time series variable is generally relevant from my understanding when you are performing a regression model. In terms of ARIMA model the approach is straightforward ...
Sayooj Balakrishnan's user avatar
0 votes
0 answers
51 views

Setting up kalman filter on basket of multiple securities which are cointegrated

I want to use mean reversion trading strategy. I am able to find 3 stocks which are cointegrated on closing prices at daily level. Im curious on what's the trading strategy using kalman filter. I can ...
nandonachi's user avatar
2 votes
1 answer
159 views

Critical values of trace statistic of Johansen cointegration test for arbitrary number of I(1) variables

I am trying to find the critical values of the trace statistic Johansen cointegration test for a large number of I(1) variables. However, I cannot find these values tabulated anywhere beyond n = 12 ...
md0101's user avatar
  • 63
1 vote
1 answer
50 views

Can the coef be negative in cointegrated stocks?

I'm searching for cointegrated stocks using the Python CointAnalysis library. While computing stock prices on a 5 mins time frame, I found that the stocks MNST (Monster Beverage Corp.) and KDP (Keurig ...
Begoodpy's user avatar
  • 111
2 votes
0 answers
136 views

Exit strategy on cointegrated pairs trading

I'm looking for guidance on an exit strategy when using pairs trading & cointegration. I'm able to find two cointegrated pairs, I then enter the trade however once in the trade I found the pairs ...
user68170's user avatar
2 votes
0 answers
119 views

Linear Regression Cointegration Strategy

When doing linear regression to figure out the hedge ratio for the cointegration relationship what does it mean if the residuals are stationary but end up looking like the price time series of y? How ...
Deepankar Joshi's user avatar
1 vote
0 answers
61 views

Johansen Cointegration Test returns non-stationary error even though trace statistics suggest their existence

I'm working with Python and use the statsmodels.tsa.vector_ar.vecm.coint_johansen function to analyze if several stocks have a stationary error term with respect to ...
Marx's user avatar
  • 11
5 votes
2 answers
423 views

Cointegration between crypto markets

I'm having an hard time understanding how cointegration works. Basically i'm trying to find cointegrated pairs in the crypto market, so i do the following: Get OHLC data for the two markets (i'm ...
JayK23's user avatar
  • 51
0 votes
0 answers
69 views

How rare is cointegration in the case of stocks?

I did some cointegration tests on a 50 stocks sample, whith which I created pairs. I used the Engle-Granger approach and the Johansen approach, both of them gave me a high percentage of cointegrated ...
Alec Ric's user avatar
1 vote
0 answers
86 views

Simultaneous Stochastic Differential Equations

I was thinking about cointegrated time series and came up with the following simultaneous equations model: $dY_t = \alpha (Y_t - \gamma X_t)dt + \sigma dB_t$ $dX_t = \beta (Y_t - \delta X_t)dt + \tau ...
André Bittencourt's user avatar
1 vote
1 answer
331 views

Price vs log returns - stationarity issues

I am trying to analyze the price of Bitcoin versus the number of Reddit posts about Bitcoin and the sentiment of those posts (daily). The price is I(1) while the sentiment and the number of posts are ...
TheConfax's user avatar
2 votes
1 answer
90 views

Cointegrated time-series with a persistent spread

Assume $X_t$ and $Y_t$ represent the prices of the same financial instrument traded in two different markets (in particular they are cointegrated). For some reason the long run equilibrium between $X$ ...
vkrouglov's user avatar
  • 247
0 votes
0 answers
59 views

Finding stock pairs whose spread is used for a risk neutral long-term investment

I am currently working on researching about ways to improve returns in pairs trading. I had previously posted a reference request here, where I had described a toy pair that seemed to be co-integrated....
TryingHardToBecomeAGoodPrSlvr's user avatar
2 votes
0 answers
229 views

Research papers and other resources to learn about useful statistical tools for pairs trading

Brief background: I recently started writing a Python code to find stocks which might be cointegrated. I iterated over a really long list of stocks trying to find a pair which might be cointegrated. ...
TryingHardToBecomeAGoodPrSlvr's user avatar
2 votes
0 answers
191 views

What do I need the Error correction model for in the two step Engle Granger approach (bivariate Cointegration)

could someone kindly explain what I need the ECM for in a bivariate Cointegration test? I am currently trying to reproduce the results of Rad et al. (2015): "The profitability of pairs trading ...
GC2023's user avatar
  • 23
4 votes
2 answers
2k views

What is the reason for using log prices in Pairs Trading (Cointegration)?

I was wondering, why some of the research papers on pairs trading (using the cointegration approach) are using log prices to determine the spread of a pair? Why are they not simply using regular ...
Rkl4397qa's user avatar
0 votes
1 answer
298 views

Understanding Look Back Period

When people say look back period of 6 months, how does that data look like? Are that 6 months of raw data or a weighted average of that data? I am a little confused on how you come up with beta values ...
Deepankar Joshi's user avatar
1 vote
0 answers
77 views

How can one, from regular predictions of high & low prices of a security, their variances and error covariance, construct a trading strategy?

Suppose I have an algorithm that provides a prediction of the daily high and low of some security n periods in the future, a confidence interval for each of these predictions, and the correlation ...
andrewH's user avatar
  • 111
0 votes
1 answer
643 views

Pairs trading/Cointegration confusion

I've been trying to wrap my head around cointegration. Currently I use the log returns of both stocks A and B, calculate the spread given by: $S = log(A) - n*log(B)$ where $n$ is the Hedge Ratio ...
43zombiegit's user avatar
0 votes
0 answers
202 views

Cointegration and hedge ratio

I've recently been looking into pairs trading through cointegration. So far I've used the log returns of stock A and stock B in a rolling OLS to find the hedge ratio. However, I've noticed that for a ...
43zombiegit's user avatar
1 vote
0 answers
78 views

Number of observations required for cointegration test

Hopefully a very simple one. I've got two assets daily close prices. How many observations should I use to test for cointegration between these two assets ? Any pointers wuold be great. A
AVSG's user avatar
  • 11
1 vote
0 answers
53 views

How do we know if cointegration is down to luck?

I have done some analysis of various pairs of tickers on the NYSE. I did a brain dead algorithm to come up with all combinations of pairs and then checked all pairs for cointegration/stationarity. I ...
brownie74's user avatar
1 vote
0 answers
62 views

Given a cointegrated portfolio of stocks, how to build a synthetic option position by using the options on the stocks

The setting Let stocks $A$, $B$, and $C$ are cointegrated. Moreover, we know the weights of the cointegrated portfolio (scaled so that the absolute value of the maximum weight is $0.5$): $w_A = 0.15$ ...
Lisa Ann's user avatar
  • 2,131
1 vote
1 answer
514 views

How to compute returns of a Pairs Trading Strategy with different holding periods?

I am currently working on a project where I am testing a Pairs Trading Strategy based on Cointegration. In this strategy I am considering to trade a couple of hundred stock pairs every day over a time ...
Rkl4397qa's user avatar
1 vote
0 answers
263 views

Pairs Trading (Cointegration Approach) - Daily Cointegration Test

I have a question regarding the Pairs Trading strategy based on the Cointegration Approach. Most of the papers/literature I found on Pairs Trading using the Cointegration Approach are usually testing ...
Rkl4397qa's user avatar
0 votes
1 answer
865 views

Calibrating the Ornstein-Uhlenbeck process with an additional parameter

Firstly I find the spread between two cointegrated time-series $Y_t$ and $Z_t$ by finding the best slope parameter $\beta$ in the equation $spread_t = Y_t - \beta Z_t$ (via Cointegrated Dickey-Fuller ...
MilTom's user avatar
  • 165
2 votes
0 answers
146 views

Cointegration where first differences are not jointly stationary

Note: This is a crosspost from this post on cross-validated, where it did not receive an answer. I thought I might have better luck here. I am looking for a rigorous and general treatment of ...
Aaron Bergman's user avatar
2 votes
1 answer
522 views

What should the look-back period be when calculating Cointegration?

So I am confused as to what the look-back period should be when calculating Cointegration. By this I mean when running for example a Johansen or ADF test, should my look-back period be 6 months?...
benito.cano's user avatar
1 vote
1 answer
162 views

Should I calculate a spread using stock prices or the ratio?

So I am creating a trading algorithm thats uses cointegration, for a pairs trading strategy. Imagine there is stock A for 100 dollars and stock B for 25 dollars. My questions is when caulcating the ...
benito.cano's user avatar
0 votes
1 answer
385 views

Pairs Trading: Normalized price series (co-integrated and correlated) always end up diverging

Need some expert advice and suggestions: I am trying out pairs trading or statistical arbitrage (as traders say). But even if two price series are co-integrated (ADF test, Hurst exponent, Ornstein–...
rockav's user avatar
  • 3
1 vote
1 answer
219 views

Why is OLS based spread not reflective of actual difference?

I'm trying to define and track the spread between two time series (data available here), for the purpose of learning pair trading basics. When running a cointegration test the two series seem to be ...
oshi2016's user avatar
  • 111
0 votes
2 answers
264 views

lead lag relationship among futures, options and stock prices

I have the data of past 10 years of NIFTY (the National Stock Exchange of India) stock, futures and options and I want to show the lead-lag relationship (which reacts first, futures, options or stocks)...
tanvinagpal98's user avatar
0 votes
0 answers
252 views

Understanding output from Johansen Cointegration test

I have a VECM model that Im using to determine the revenues for a firm, based on factors like Interest rates, S&P 500 and company specific variables, as follows: Stage 1: $$z_t= a+ bX_t+e_t$$ ...
Jojo's user avatar
  • 895
1 vote
1 answer
53 views

What value to put in lm() function when testing for cointegration (R)

I'm a CS student working on a financial computing project + have a question regarding cointegration testing using linear regression with the lm() function. https://www.rdocumentation.org/packages/...
Tom's user avatar
  • 11
2 votes
0 answers
337 views

Johansen cointegration Test for spread generation

I'm using the python statsmodels version of the johansen cointegration test and I'm looking for some advice on how best to generate the spread used within a pairs trading algorithm. For example I've ...
floorscrapers's user avatar
3 votes
0 answers
82 views

Law of one Price and Cointegration relationship

I have a question on the relationship between the law of one price and cointegration of (financial) time series. To set things clear I start with something simple: Suppose there is an unobserved "...
Stefan Voigt's user avatar
  • 1,456
2 votes
0 answers
47 views

Cointegration between prices and dividends. How do I get the following expression?

Actually, I have two questions: 1. Let us assume that expected returns are constant. Then, we have the following expression for how the prices should be determined, provided that the operators are ...
Alchemy's user avatar
  • 171
1 vote
1 answer
199 views

Trading 3 stocks X Y Z where X cointegrated to Y, Y to Z, but no other cointegration is available

Suppose you have 3 stocks, say X Y Z. You also know that X is cointegrated to Y using some test (say ADF) and Y is cointegrated to Z. However, no transitivity, and no threesome cointegration ...
Mirco A. Mannucci's user avatar
2 votes
1 answer
298 views

generalisation of cointegrated stock pair strategies to multiple cointegration

Question: as it is well known, there are strategies to trade pairs of stocks which are known to be co-integrated. See for instance here: https://medium.com/auquan/pairs-trading-data-science-...
Mirco A. Mannucci's user avatar
1 vote
1 answer
120 views

when a co-integrated times series pair has broken the leash

I have two times series, say $T_i$ and $S_i$ over a reasonably large time window, and I have calculated their cointegration (using python's OLS and Adfuller) . Say that the test has passed with high ...
Mirco A. Mannucci's user avatar
1 vote
0 answers
87 views

Spot trading: exact mathematical definition of the positions for a portfolio

Let us say that I want to spot trade a portfolio constituted of a pair of two stocks of respective prices (for example in USD) $S^1_t$ and $S^2_t$, and suppose for example that they co-integrate ...
Arnold's user avatar
  • 11
1 vote
0 answers
109 views

Fractional cointegration in R

I'm looking for a package (or some code that anyone has written) that will help me to estimate a VECM for fractionally cointegrated series. I.e. like the ca.jo ...
Quantdaddy's user avatar
1 vote
0 answers
164 views

Pairs trading strategy: Portfolio returns and NAV

Currently trying a pairs trading approach using cointegration. Tried both formations: $$log(P_t^A)=log(P_t^B) \hat{\gamma}+\hat{\mu}+\epsilon_t \hspace{0.5cm} (1)$$ $$P_t^A=P_t^B \hat{\gamma}+\hat{\...
alexbougias's user avatar
  • 1,416
1 vote
0 answers
80 views

Johansen Cointegration Test in R

I know its probably been asked bevor but i just don't get it. I have 2 values (Oil and corn price) and i want to check if they are cointegrated. Bevor that, i have tested if they really are non ...
Amelie's user avatar
  • 11
4 votes
1 answer
710 views

What is the logic of the eigenvectors of the Johanson cointegration test determining hedge ratios?

Reading Algorithmic Trading: Winning Strategies and Their Rationale, Ernie Chan and there is a short section about the Johanson test for cointegration where it is mentioned that the eigenvectors ...
lampShadesDrifter's user avatar
5 votes
2 answers
2k views

Cointegration and Ratio Pair Trading

I'm having some confusion doing Engle-Granger Cointegration test and then trade the ratio. Methodology: Run an OLS fit for A and B price time series without a constant. Therefore, $\hat{Y} = \gamma \...
TomDecimus's user avatar
1 vote
0 answers
209 views

Cointegration between daily time series and intraday time series

I am working with time series data of daily prices, and intraday prices. For simplicity sake I will refer to the daily time series as 'A' and 'B', and the intraday time series of the same instruments ...
jod51's user avatar
  • 141
1 vote
0 answers
68 views

Is my coding for my kalman filter off when testing this specific set of pairs?

My kalman filter seems to be off for this specific set of pairs I'm looking at. As you can see, in the kalman filtered linear regression, there seems to be an outlying blue line nowhere near the data ...
H. Acuna's user avatar
1 vote
1 answer
1k views

Cointegration on prices or difference of prices

Is it better to run my cointegration tests on prices or difference of prices? Difference of prices are more likely to be stationary so the results of my regression (which gives me the beta for my ...
ababoua's user avatar
  • 187
12 votes
1 answer
2k views

Does Chan use the wrong state transition model in his Kalman filter code?

In his book, Algorithmic Trading: Winning Strategies and Their Rationale, Ernie Chan shows how to use a Kalman filter to improve the returns of a cointegrated portfolio. Recall that the state equation ...
Amanda G.'s user avatar
  • 361