Skip to content
All library documents

Using Lagged Return Correlations to Rank Leading Stocks

Article Quant Q&A · Author: Jessica

Summary

The document explores whether cross-correlation between stock log returns can identify which stocks tend to move first. It describes calculating the correlation across a range of lags for each pair, selecting the largest correlation and its associated lag, and interpreting the lag direction as an indication of which series leads. A three-stock example compares pairwise results and proposes combining those relationships into an overall ordering.

The example illustrates how pairwise lead-lag claims might agree, but it does not validate the approach or offer statistical evidence that the inferred ordering predicts future prices. The author assumes equally spaced, homogeneous observations and stationary returns, after preprocessing irregular tick data. Selecting the strongest lag correlation alone can be misleading: correlations may be noisy, pairwise directions may conflict, and common market drivers can create apparent leadership. The document raises these limitations as open questions rather than resolving them, so the method is exploratory and requires additional validation.

Key ideas

  • Cross-correlation of log returns can be examined across time lags to identify pairwise lead-lag patterns.
  • The lag associated with a selected correlation peak is used to infer which stock moves first.
  • An overall ranking from pairwise relationships assumes those relationships are consistent across pairs.
  • The example does not show that the inferred leaders predict future returns.
  • The proposed analysis assumes equally spaced observations and stationary returns.

Tags

Full text
# Detecting leading stocks using lag correlation


# Detecting leading stocks using lag correlation












I am working on a project to find leading stocks in a stock market by using lag correlation.

Say I want to compare 2 stocks, X and Y, and I have the time series of stock prices.

Assume that the time series are equally spaced and homogeneous and their log returns are stationary (in my case I have raw tick data so it's unevenly spaced and contains many gaps but I have managed to preprocess the data to make them equally spaced and run tests for stationarity).

Finding the maximum lag correlation of 2 stocks is straightforward; I can use `ccf()` in R to find the maximum lag correlation of their log returns and the corresponding time lag.

```
Find_Max_CCF <- function(a,b)
{
  d <- ccf(a, b, plot = FALSE)
  cor = d$acf[,,1]
  lag = d$lag[,,1]
  res = data.frame(cor,lag)
  res_max = res[which.max(res$cor),]
  return(res_max)
}

> Find_Max_CCF(as.ts(X_logreturns), as.ts(Y_logreturns))
         cor  lag
   0.1459474 1200
```

Here, the strongest correlation occurs at time (t-1200), indicating that Y is the lagging indicator (X is the leading indicator).

Now, the problem is when I have more than 2 stocks. Say I have 3 stocks, X, Y and Z, and I want to find which stock is the leading trend of the other ones.

I've been looking into comparing multiple time series using lag correlations and it seems to me that there is no literature or discussion on this topic. So I came up with an idea and here's how I think: I can find the maximum lag correlation of log returns and the corresponding time lag for each pair of stocks, take two pairings with 1 stock in common, and compare them to find which stock is the top leading stock, second leading stock and so on.

For better illustration, look at the example below.

```
> Find_Max_CCF(as.ts(X_logreturns), as.ts(Y_logreturns))
         cor  lag
   0.1459474 1200
> Find_Max_CCF(as.ts(X_logreturns), as.ts(Z_logreturns))
         cor  lag
   0.1495813 -480
> Find_Max_CCF(as.ts(Y_logreturns), as.ts(Z_logreturns))
         cor  lag
   0.1935647 -360
```

In this case, we have the following pairs of relation: X succeeds Y, X precedes Z, and Y precedes Z. From the first two relations, we can see that if Z succeeds X, and if X succeeds Y, then it must be that Z is leading first, followed second by X, and lastly Y. This confirms the third relation that Y precedes Z (or Z succeeds Y).

Is it correct of me to think this way?

Will my idea work for comparing multiple time series?

Is it too naive?

Is there a better way to do this?

Any help will be greatly appreciated!

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.