Skip to main content

Questions tagged [pairs-trading]

Pairs trading is a market-neutral trading strategy enabling traders to profit from virtually any market conditions: uptrend, downtrend, or sideways movement. This strategy is categorized as a statistical arbitrage and convergence trading strategy.

Filter by
Sorted by
Tagged with
0 votes
1 answer
345 views

Generating buy/sell signals in pairs trading

I'm reading a quantitative trading book"Quantitative Trading with R" by Harry Georgakopoulos. In the pairs trading section, there's an example that creates the spread and generate buy/sell ...
xyzt's user avatar
  • 341
1 vote
1 answer
273 views

pairs trading algorithm with returns

I'm having a difficulty grasping how to write a pair algorithm using returns instead of prices. With price differences, I have the mean difference over a long time period. When the current price ...
Don Chambers's user avatar
0 votes
0 answers
84 views

Pair Trade - Should stock order matter

I am testing a simple pair trading algorithm and I'm having problems if I swap the stocks around. I don't know which stock should be X and which should be Y. When I swap them I get very different ...
Don Chambers's user avatar
0 votes
0 answers
369 views

How can I normalize price data for 2 financial instruments from different categories?

Lets say I want to build a divergence / convergence strategy with FOREX currency pair and a correlated commodity. How can I normalize the prices so that I get an accurate idea of the movements of each,...
Riley Bolen's user avatar
0 votes
0 answers
2k views

Calculating % Return in Pairs Trading Strategy

Hi guys Could you help me here? I would like to calculate the return of a Pairs Trading strategy. For example: 18/11 - Open the Trade: I will go long on A and Short on B: Stock A : $ 32.24 Stock B ...
cassius's user avatar
  • 247
2 votes
1 answer
277 views

Pairs Trading parameters

I am looking to optimize the open/close signals and time for a pairs trading strategy my partner and I are researching. We don't want to go p-hacking so we have been trying to decide: We have 20+ ...
Bikenfly's user avatar
  • 454
4 votes
1 answer
73 views

Negatively Correlated Assets with similar medium-term trends

Theoretically, one could have stock prices with returns $\rho_1(k)$ and $\rho_2(k)$ having mean values $\mu_1$ and $\mu_2$, but still be negatively correlated with $$ \mathbb{E}[(\rho_1(k)-\mu_1)(\...
thisisenfield's user avatar
1 vote
1 answer
290 views

Pairs Trading situation with spread changes

I'm setting up pairs trades by summing the distances squared (SSD). After determining the best pairs, I have to track the spread between the normalized prices. Am I noticing something that is ...
cassius's user avatar
  • 247
1 vote
1 answer
358 views

Bootstrap Method for Assessing Pairs Trading Performance

After reading this paper I tried to replicate it. I almost done, but I am stuck on the section 3.6 where the author constructs a random pair (how he constructs this?) for Assessing Pairs Trading ...
cassius's user avatar
  • 247
4 votes
3 answers
1k views

Pair trading - short / long the spread

I am wading into pair trading concepts. Here is one article I've read. I understand for these strategies our intention is to go long on one asset and short another, however I do not understand what ...
quickshiftin's user avatar
2 votes
1 answer
304 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
0 answers
231 views

Pair trading: Hege ratio by price ratio or by regression on the stocks

So I feel things like this question do exist on the site however I failed to form a conclusion based on what was written, so I decided to formulate my query as exactly as possible and hopefully anyone ...
East's user avatar
  • 111
1 vote
0 answers
166 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,426
0 votes
1 answer
98 views

Short sale and zero investmest strategy

Suppose I want to build a pairs trading strategy. Theory says that we can create a zero-investment portfolio by going long stock A and short-selling stock B, given a certain hedge ratio. My question ...
alexbougias's user avatar
  • 1,426
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
3 votes
3 answers
1k views

Calculating Sharpe Ratio with dynamic position sizing

I'm currently backtesting a mean reversion pairs trading strategy. However, instead of simple long or short trading signals, I'm using multiple "levels", where the further away the spread is from the ...
wardzin's user avatar
  • 131
1 vote
0 answers
433 views

Pair trading strategies in fixed income

We usually hear about finding cointegrated pairs of stocks in pair trading, but it seems it is not as developed in fixed income despite the fact that the spectrum of securities is large (different ...
ababoua's user avatar
  • 207
12 votes
2 answers
15k views

How to calculate Sharpe Ratio from $ returns?

I have a pairs strategy that I am trying to calculate the sharpe ratio for. Currently I am using python for my analysis and calculation. I have a dataframe that contains the cumulative returns in $'s ...
jod51's user avatar
  • 141
1 vote
3 answers
1k views

If two price series are cointegrated but not correlated, how do I find the hedge ratio?

Mathematically, what is going on here?
Liam Donovan's user avatar
1 vote
2 answers
250 views

When constructing a cointegrating series, does choosing the linear regression with the lowest ADF test statistic yield the optimal hedging ratio?

Multiple sources say that you should find the optimal hedging ratio between two stocks in a pairs trade by conducting 2 linear regressions (with each stock as the independent variable), and using ...
Liam Donovan's user avatar
0 votes
2 answers
2k views

Standard deviation of a long-short portfolio with net position zero

I've come across the following question and I'm slightly stuck in answering it: Suppose you have a two-stock portfolio that is long one stock of asset A, and short one stock of asset B, with A ...
Ronnie268's user avatar
  • 157
1 vote
2 answers
1k views

Cointegration vs combination of returns

Hi Quantitative Finance, I understand that there are a wealth of pairs trading models out there. Recently, it got me thinking as to why we go through the trouble to find cointegrated pairs while we ...
Donny Lee's user avatar
  • 111
8 votes
3 answers
1k views

Why isn't it appropriate to use correlation between prices in a pairs trade strategy?

I've already seen this question and read through all the answers, but I'm still confused about why you shouldn't use price correlation in a pairs trade strategy. For example, if I'm looking at the ...
Anna's user avatar
  • 181
2 votes
1 answer
212 views

Is this the correct way to hedge two securities against each other?

Let's say I believe that $ts_1$ and $ts_2$ move together and I would like to pairs trade them. Am I correct in understanding that to hedge them against each other I would get their $Var_1$, $Var_2$, ...
user1367204's user avatar
1 vote
1 answer
2k views

How to "Standard Beta Hedge"?

Let's say I have 2 time-series, how would I "standard beta hedge" them against each other? For example, what if the position in 1 timeseries is 100 shares at 16 USD per share. Another time-series is ...
user1367204's user avatar
1 vote
0 answers
391 views

Cointegration and pairs trading

I have intuition that cointegration between elements of pair of equities somehow contradicts pairs trading strategies. Because the better is linear fit of the model the less opportunities we have for ...
Qbik's user avatar
  • 1,018
2 votes
2 answers
13k views

Calculating the returns of a long/short strategy

I feel like an idiot asking this but i haven't found the answer anywhere. I have backtestest a paris trading strategy, while calculating the returns of the strategy I run into some problems when the ...
Alejandro Andrade's user avatar
2 votes
0 answers
223 views

Relative Value Trading of American Style Options on Futures, Calcuating hedging ratios?

I am interested in Relative Value Trading of American style options on futures and have not found a whole lot of literature on it. The best resource I have discovered so far is a few pages in Colin ...
treydog999's user avatar
1 vote
2 answers
523 views

pair trading - rolling adf test

I am testing a pair trading strategy. Every day I recalculate the hedge ratio using the past N prices of the 2 underlying. With the hedge ratio, I calculate the past N spreads and do an ADF test to ...
patzoul's user avatar
  • 29
1 vote
1 answer
2k views

calculating the pair weights from log price hedge ratio

I am calculating the hedge ratio using log prices: $$ \ln(A) = \text{hedge_ratio} \cdot \ln(B) $$ How do I convert the hedge_ratio into a number of shares of A vs....
patzoul's user avatar
  • 29
3 votes
1 answer
392 views

How do you decide what time frame you're going to use when testing for cointegration?

I've been fiddling around with different time frames when doing tests for cointegration between two timeseries, and I've realized that the dates that you use for your start/stop of the test will ...
Spencer Smolen's user avatar
0 votes
1 answer
572 views

How can I apply error correction model in pairs trading?

I have read Vidyamurthy and others, but did not find clear example of error correction model (ECM) application in pairs trading. How should I use the ECM model in the pairs trading? How to use ECM ...
Analitiq's user avatar
2 votes
4 answers
6k views

Close or Adjusted Prices when Backtesting

I've been doing this for some years now, but recently, since I started fiddling around with an old pairs trading strat of mine again, when updating the databases before running the tests, I was ...
Eduardo Gonzatti's user avatar
-1 votes
1 answer
1k views

pair trading cointegration - calculating shares quantities traded, portfolio value and returns

I have a trading strategy based on the cointegration of X and Y where beta derived from the regression is 0.7. My initial capital to invest is 1000. My understanding that the quantities of X and Y to ...
Michal's user avatar
  • 711
1 vote
1 answer
523 views

What causes poor returns in pair trading of very cointegrated securities?

I've been running some backtests of a pair trading strategy on 1 year worth of 5 min bars of two securities and I've noticed pretty poor returns, especially once transaction costs are taken into ...
ErlichBachmann's user avatar
0 votes
1 answer
576 views

How buying/selling pairs and entering/exiting trade works in pairs trading?

Lets say I have two stocks x and y and their corresponding stock price p(x) and p(y). consider HR as hedge ratio. Then we can calculate the spread using this equation. $spread=p(x)-HR*p(y)$ from ...
Eka's user avatar
  • 647
5 votes
1 answer
3k views

What is the pseudo code for a pairs trading strategy?

I am trying to learn about pairs trading strategy. I know that we have to long and short cointegrated assests simultaneously. But I still have some confusion in how the strategy works. I wrote the ...
Eka's user avatar
  • 647
2 votes
0 answers
452 views

cointegration strategy

If it can be proved that two time series $$S_t^1=\alpha + \beta S_t^2 + \xi_t$$ representing stocks are correlated, with $\beta=-2$ and then are proved to be cointegrated, how a portfolio should be ...
Michal's user avatar
  • 711
6 votes
0 answers
3k views

How to trade the Ornstein-Uhlenbeck process?

My question comes from this paper, which is a short version of Avellaneda's paper The picture bellow provides a summary of the equations. Do I understand correctly that in order to trade OU process I ...
Artem Korol's user avatar
2 votes
1 answer
909 views

Mean reversion and adjusted beta for pairs trading

Trying to evaluate model for pairs trading. Consider classic formula: $\frac{dP}{P} = adt+b\frac{dQ}{Q}+dX$, where $P$ and $Q$ are stock prices, and $X$ is a mean reverting process (MRP) and $a$ is ...
Trader's user avatar
  • 21
2 votes
5 answers
487 views

Where can I get json currency data feeds every millisecond?

I have been looking for free or paid json data feeds on currencies for long. I have come across: currencylayer.com Oanda XE The problem is that I really need millisecond based updates. Can someone ...
Joel's user avatar
  • 21
1 vote
2 answers
1k views

Pairs Trading Signals and Positioning

I am currently working on a research project for a pairs trading strategy and would like to know the correct positions to take when a signal has been triggered. Say we are using this equation to ...
John Faxton's user avatar
1 vote
0 answers
649 views

Calculating PnL from log prices

I'm backtesting a statistical arbitrage strategy. To calculate the PnL I simply use $Y(t)-Y(t+n)$ for the profit on the first leg and $\beta*X(t) - \beta*X(t+n)$ for the profit on the second leg, ...
Artem Korol's user avatar
3 votes
3 answers
223 views

what are the criteria to select pairs?

I'm new to this forum, this is the first question I posted. I have many candidate pairs and I've used ADF test to make a first selection. There are more than 800 selected. The pairs are absolutely too ...
Lucas's user avatar
  • 31
11 votes
2 answers
3k views

What does the cointegration coefficient represent in pairs trading when cointegrating log stock prices?

In Pairs Trading by Vidyamurthy, on page 83 (and throughout the book), the author describes an elementary example of trading with log prices. The long run equilibrium of the basic portfolio is given ...
mathjacks's user avatar
  • 365
2 votes
1 answer
520 views

Pair trading based on cointegration - equity line

I'm preparing a project at my Uni where I have to make a simple pair trading strategy using cointegration between two stocks. I'm stuck on the equity line calculation. I have prepared opening and ...
macgivera's user avatar
  • 105
1 vote
1 answer
375 views

What P&L netting should one use when a strategy has trades in two different geographic locations?

I am familiar with the FIFO methodology of netting buys and sells to obtain a realized P&L and outstanding position. Suppose there's a strategy which runs in two different places A, and B and ...
Alicia Myskina's user avatar
4 votes
2 answers
2k views

How to select optimal look back period for statistical arbitrage?

Is it possible to estimate the optimal look back period for OLS from which we test if residuals are stationary? Almost all papers that I read use random look back periods of 100 days, 252 days, 500 ...
Artem Korol's user avatar
6 votes
1 answer
1k views

Mean reversion time estimation

I am new to mean reversion trading, and I would like to get some good references about how to estimate the time it takes to a mean reverting process to cross its long term mean.
paca's user avatar
  • 121
5 votes
3 answers
1k views

References on Statistical Arbitrages

Is there any basic materials (books, papers) to read on Statistical Arbitrage? I certainly understand much of the useful information is in the industry. I just want to get some understanding on the ...
CuriousMind's user avatar