cointegration-analysis
Cointegration Analysis identifies when two non-stationary price series move together toward a stable equilibrium, enabling statistical arbitrage and mean-reversion trading. The skill implements Engle-Granger two-step regression, Johansen multivariate testing, and rolling window monitoring to detect relationship breakdowns. Use it to screen correlated assets, estimate hedge ratios, and validate spread mean reversion before deploying pairs strategies.
Cointegration Analysis tests asset pairs for long-run equilibrium relationships suitable for pairs trading strategies.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-06-24
Cointegration Analysis tests asset pairs for long-run equilibrium relationships suitable for pairs trading strategies. Cointegration Analysis identifies when two non-stationary price series move together toward a stable equilibrium, enabling statistical arbitrage and mean-reversion trading. The skill implements Engle-Granger two-step regression, Johansen multivariate testing, and rolling window monitoring to detect relationship breakdowns. Use it to screen correlated assets, estimate hedge ratios, and validate spread mean reversion before deploying pairs strategies.
Use it when
- Cointegration-analysis screens correlated assets by applying Engle-Granger and Johansen tests to identify pairs with stable long-run.
- Cointegration-analysis distinguishes cointegration from correlation: correlation measures instantaneous price movement similarity.
Verify before relying
Read SKILL.md below before installing (5 files). Open directory: indexed for reading, not audited.
Install
agiprolabs/claude-trading-skills/cointegration-analysis · repository language: Python
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What cointegration testing methods does cointegration-analysis support?
Cointegration-analysis implements Engle-Granger two-step regression for pairs and Johansen multivariate testing for multiple series. Both methods detect when non-stationary price series move together toward a stable long-run equilibrium, forming the foundation for statistical arbitrage. The skill also includes ADF testing of residuals to confirm stationarity and Phillips-Ouliaris cointegration as an alternative framework for validating relationships.
How do I find cointegrated trading pairs using this skill?
Cointegration-analysis screens correlated assets by applying Engle-Granger and Johansen tests to identify pairs with stable long-run equilibrium relationships. The skill estimates hedge ratios from cointegrated relationships and validates that spreads exhibit mean reversion. Once a cointegrated pair is identified, you can monitor the spread using z-score signals to trigger entry and exit points for mean-reversion trades.
What is the difference between cointegration vs correlation?
Cointegration-analysis distinguishes cointegration from correlation: correlation measures instantaneous price movement similarity, while cointegration identifies non-stationary series that share a stable equilibrium relationship. Two assets can be highly correlated but not cointegrated, or cointegrated without high correlation. Cointegration is more reliable for pairs trading because it captures mean-reversion dynamics rather than temporary price moves.
How does rolling cointegration window analysis detect relationship breakdowns?
Cointegration-analysis monitors rolling cointegration stability by recalculating Engle-Granger or Johansen test statistics over sliding time windows. This detects hedge ratio drift and structural breaks when the long-run equilibrium relationship weakens or fails. Walk-forward backtesting with rolling windows reveals when pairs strategies lose statistical validity, helping you avoid trading spurious cointegration or relationships damaged by market regime shifts.
How do I avoid spurious cointegration and structural break pitfalls?
Cointegration-analysis mitigates spurious cointegration by validating residual stationarity through ADF testing and monitoring rolling window stability. The skill flags structural breaks where the cointegrated relationship deteriorates, preventing false signals from regime changes. Walk-forward validation ensures hedge ratios and spread mean-reversion half-life estimates remain current, reducing the risk of deploying pairs strategies on broken relationships.
Can cointegration-analysis identify crypto pairs like SOL-ETH for arbitrage?
Cointegration-analysis applies Engle-Granger and Johansen testing to any asset pair, including crypto pairs like SOL-ETH or stablecoin peg arbitrage relationships. The skill estimates hedge ratios and monitors spread mean reversion for liquid staking derivatives and other correlated crypto assets. Rolling window analysis detects when crypto pairs lose cointegration due to market volatility or protocol changes, helping you time entry and exit of statistical arbitrage positions.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Cointegration Analysis
Cointegration testing identifies pairs of assets that share a long-run equilibrium relationship, enabling statistical arbitrage and pairs trading strategies.
What Is Cointegration?
Two price series are cointegrated when they are individually non-stationary (random walks) but a linear combination of them is stationary (mean-reverting). Intuitively, the prices may wander apart temporarily but are pulled back to an equilibrium spread over time.
Cointegration vs Correlation
| Property | Correlation | Cointegration |
|---|---|---|
| Measures | Short-term co-movement | Long-run equilibrium |
| Stationarity | Requires stationary returns | Works with non-stationary prices |
| Time horizon | Can change rapidly | Stable over months/years |
| Trading use | Momentum/trend signals | Mean-reversion pairs trades |
| Failure mode | Breaks in regime changes | Breaks on structural shifts |
Two assets can be highly correlated but not cointegrated (e.g., two unrelated uptrends). Conversely, cointegrated
(truncated - see the full file via the links below)
File tree — 5 files
skills/cointegration-analysis/SKILL.md
skills/cointegration-analysis/references/methodology.md
skills/cointegration-analysis/references/pairs_trading.md
skills/cointegration-analysis/scripts/pairs_backtest.py
skills/cointegration-analysis/scripts/test_cointegration.py
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Find cointegration testing methods for pairs trading strategies”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Correlation-Analysis discovers asset pairs with strong co-movement for pairs trading and hedging through multiple analytical modes: co-movement scanning, deep return correlation studies, sector clustering, and cointegration testing. It computes Pearson, Spearman, and Kendall correlations, rolling dynamics, and spread Z-scores to identify statistically significant relationships.
Mean-reversion identifies when prices, spreads, or other financial metrics deviate from their long-run average and predictably return. This skill provides statistical tests (ADF, Hurst exponent, variance ratio) to confirm mean reversion, half-life estimation to time entries and exits, z-score frameworks for signal generation, and Ornstein-Uhlenbeck process modeling for continuous-time analysis.
Pair Trade Screener detects statistical arbitrage opportunities by identifying cointegrated stock pairs within sectors and analyzing their spread behavior. The skill uses correlation analysis, cointegration testing, and z-score calculations to generate market-neutral trading signals based on mean-reversion patterns. Designed for investors seeking uncorrelated trading strategies that profit regardless of overall market direction.
Transform raw market data into stationary, predictive features for crypto trading models. This skill covers price, volume, technical, microstructure, and on-chain feature construction with emphasis on avoiding lookahead bias and ensuring stationarity. Feature quality matters more than model complexity in trading ML.
Quant-statistics provides time-series testing and volatility modeling tools for quantitative investing. It covers stationarity detection via ADF tests, cointegration analysis for pair trading, GARCH volatility forecasting, and regression diagnostics including heteroskedasticity and autocorrelation checks.
Longbridge Quant provides frameworks for building and backtesting quantitative strategies, including pairs trading with cointegration, volatility regime detection, multi-factor stock selection, and factor research with IC/IR analysis. Run indicator scripts against K-line data via CLI, optimize strategy parameters with walk-forward validation, and model execution costs and hedging approaches.
More skills regime-detection (MIT) · correlation-analysis (MIT) · stock-correlation (MIT) · pywayne-statistics (MIT)