correlation-analysis

Compute correlations and cointegration tests to generate pair-trading signals.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/Liangwei-zhang/six-stock --skill correlation-analysis-liangwei-zhang
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: correlation-analysis
Source: https://github.com/Liangwei-zhang/six-stock/tree/main/Vibe-Trading/agent/src/skills/correlation-analysis
Command: npx skills add https://github.com/Liangwei-zhang/six-stock --skill correlation-analysis-liangwei-zhang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzes asset relationships to reveal co-movement patterns and long-run equilibrium opportunities through correlation and cointegration testing, enabling smarter pairs trading and diversification decisions.

Core Features & Use Cases

  • Compute Pearson, Spearman, and Kendall correlations across assets to identify the strongest co-movement candidates for pairing.
  • Perform Engle-Granger and Johansen cointegration tests to verify long-run relationships and estimate hedge ratios.
  • Conduct sector clustering and realized-correlation analyses to inform diversification and risk control across markets.
  • Generate end-to-end workflows that translate analytics into pair-trading signals and hedging guidance across cross-market contexts.

Quick Start

Run the correlation-analysis workflow to identify top correlated assets and confirm cointegration for practical pair trading.

Frequently Asked Questions about correlation-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test cointegration between two assets for pairs trading?

To test cointegration for pairs trading, you can use Engle-Granger or Johansen tests to verify long-run equilibrium relationships between assets and estimate hedge ratios for your tradable pairs.

What is the difference between Pearson, Spearman, and Kendall correlation for asset co-movements?

Pearson measures linear co-movements, while Spearman and Kendall capture monotonic and ordinal relationships respectively, helping you identify the strongest asset pairing candidates across diverse cross-asset universes.

How do I calculate dynamic hedge ratios using a Kalman filter?

Dynamic hedge ratios are calculated using the Kalman filter to continuously adjust your hedge ratios based on changing asset co-movements, translating cointegration analytics into precise pair-trading signals.

Can I use sector clustering to improve portfolio diversification across cross-market linkages?

Yes, sector clustering analyzes realized correlations and cross-market linkages to inform diversification decisions, grouping assets by co-movement patterns to enhance portfolio risk control across different markets.

What is half-life estimation in cointegration analysis?

Half-life estimation measures how quickly the spread between cointegrated assets reverts to its long-run mean, providing critical timing guidance for when to enter and exit pair-trading positions.

When should I not use correlation analysis alone for pair trading signals?

Correlation analysis alone is insufficient when assets lack long-run equilibrium, requiring Johansen or Engle-Granger cointegration tests to verify tradable relationships before generating pair-trading signals.