Cointegration Analysis

Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis

564 stars 113 forksTesting & QA Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add agiprolabs/claude-trading-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add agiprolabs/claude-trading-skills --skill cointegration-analysis
Manual install
git clone --depth 1 https://github.com/agiprolabs/claude-trading-skills.git /tmp/claude-trading-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-trading-skills/skills/cointegration-analysis ~/.claude/skills/cointegration-analysis

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# 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 assets may have low short-term correlation
during temporary divergences — which is exactly when pairs trades are entered.

### Why It Matters

- **Pairs trading**: Long the underperformer, short the outperformer, profit on convergence
- **Statistical arbitrage**: Systematic mean-reversion on spread z-scores
- **Spread trading**: Trade the spread directly as a synthetic instrument
Read the full skill on GitHub

Details

Skill name
cointegration-analysis
Path
skills/cointegration-analysis/SKILL.md
License
MIT
Repo updated
3 September 2026

FAQ

What does the Cointegration Analysis skill do?

Cointegration testing for pairs trading using Engle-Granger, Johansen, and rolling stability analysis

How do I install the Cointegration Analysis skill?

Claude Code plugin: /plugin marketplace add agiprolabs/claude-trading-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Cointegration Analysis popular?

It lives in agiprolabs/claude-trading-skills, which has 564 GitHub stars and 113 forks.

Related skills

Backtrader

564

agiprolabs/claude-trading-skills

Event-driven backtesting with bar-by-bar execution, complex order types, multiple analyzers, and custom indicators

Other113

Birdeye API

564

agiprolabs/claude-trading-skills

Solana token market data via Birdeye — prices, OHLCV, trades, token metadata, security checks, and trader activity

Software Development113

Coingecko API

564

agiprolabs/claude-trading-skills

Broad crypto market data from CoinGecko covering 13,000+ tokens. Global market stats, historical price data going back years, exchange volumes, trending tokens, and category filters. Best for macro analysis and long-term historical data.

Software Development113

Mean Reversion

564

agiprolabs/claude-trading-skills

Mean-reversion strategy tools including Hurst exponent, half-life estimation, z-score signals, ADF testing, and Ornstein-Uhlenbeck modeling

Testing & QA113

Flaky Test Killer

517

dotslashsimran/simcraft

Find why a test is flaky and fix the root cause, never by adding retries, sleeps or bigger timeouts. Measures the flake rate with a confidence interval, runs the test under stressors (random order, timezone, fake clock at month end or DST, CPU load, fresh temp dir, low file limits), bisects for the test that pollutes it, and proves the fix with before and after numbers. Use when the user says "flaky test", "test passes locally fails in CI", "intermittent failure", "random test failure", "works on my machine", "test fails sometimes", "only fails in the full suite", or wants to quarantine or ret

Testing & QA39

01 Acceptance QA

564

ai-driven-dev/framework

Validate a reviewed candidate's observable behavior against its acceptance criteria and record short named videos as reviewer evidence. Use when acceptance criteria exist and a browser-observable journey needs proof it holds. Do NOT use for diff review, unit or integration tests, or application fixes.

Testing & QA65

Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.