Stock Pair Cointegration Analyzer avatar

Stock Pair Cointegration Analyzer

Pricing

from $5.00 / 1,000 pair analyzeds

Go to Apify Store
Stock Pair Cointegration Analyzer

Stock Pair Cointegration Analyzer

Test stock/ETF pairs for cointegration: hedge ratio, half-life, spread z-score and a walk-forward check. Statistical data only, not investment advice.

Pricing

from $5.00 / 1,000 pair analyzeds

Rating

0.0

(0)

Developer

AutoWorks JP

AutoWorks JP

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Share

Test whether pairs of stocks or ETFs move together in a statistically stable way (cointegration), and see how far their spread is from its usual level today. Built for quants, pair-trading researchers and students who want clean statistics without writing their own pipeline.

This Actor provides statistical data only. It is not investment advice and does not recommend buying or selling any security.

What you get for each pair

FieldMeaning
cointegrationPValueEngle-Granger test p-value on log prices over the formation window
qValueBHp-value adjusted for testing many pairs at once (Benjamini-Hochberg)
cointegratedtrue if q < significance, hedge ratio > 0 and half-life is 2-30 days
hedgeRatioOLS beta of log(A) on log(B)
halfLifeDaysMean-reversion half-life of the spread (Ornstein-Uhlenbeck fit)
spreadZScoreToday's spread vs. the previous zWindow days (today excluded, no look-ahead)
spreadStateabove mean / below mean / within band
returnCorrelationCorrelation of daily log returns
walkForwardOut-of-sample style historical check: parameters re-estimated monthly using past data only, trades simulated with costs, results split into first/second half

Why the walk-forward check matters

Many pairs look cointegrated in hindsight. In our own 10-year test on 221 same-sector US large-cap pairs, pairs chosen on the first half of the data showed strong results in that half but were not statistically significant in the second half. Use walkForward.secondHalf and its tStat to judge whether a relationship has held up, not the first-half numbers.

Input

  • tickers: 2-40 symbols; every combination is analyzed (max 300 pairs per run)
  • pairs: specific pairs such as XOM/CVX
  • dataSource: yahoo or csvUrl (your own adjusted-close CSV: first column date, other columns tickers)
  • years, formationDays, zWindow, significance, zThreshold, includeBacktest, costBps

Pricing

Pay per event: you are charged once per analyzed pair (pair-result). A summary is stored in the key-value store as SUMMARY.

Notes

  • Yahoo Finance data is retrieved via the open-source yfinance library and is subject to Yahoo's terms. For commercial use, supply your own licensed data via csvUrl.
  • Results depend on the window chosen and on survivorship of the tickers you pick.