correlation-analysis

Perform correlation and cointegration analysis to identify pairs trading opportunities.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/hxhyyy/Vibe-Trading --skill correlation-analysis-hxhyyy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: correlation-analysis
Source: https://github.com/hxhyyy/Vibe-Trading/tree/main/agent/src/skills/correlation-analysis
Command: npx skills add https://github.com/hxhyyy/Vibe-Trading --skill correlation-analysis-hxhyyy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, scipy, statsmodels, matplotlib, seaborn.

What problem does it solve?

This skill addresses the complexity of identifying and validating trading opportunities by automating the discovery of co-moving assets and verifying long-term equilibrium relationships.

Core Features & Use Cases

  • Co-movement Discovery: Scan large asset universes to identify highly correlated candidates for pairs trading.
  • Cointegration Testing: Utilize Engle-Granger and Johansen methods to ensure statistical validity of trading pairs.
  • Dynamic Hedge Ratios: Employ Kalman filters to adapt to shifting market regimes, ensuring robust spread monitoring.
  • Use Case: A quantitative trader can use this to identify sector-specific pairs in the A-share market and generate real-time Z-score signals for entry and exit.

Quick Start

Use the correlation-analysis skill to scan the provided asset universe for pairs with a Pearson correlation above 0.7 and validate them using the Engle-Granger cointegration test.

Frequently Asked Questions about correlation-analysis

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

FAQPage Schema
How do I find cointegrated pairs for a pairs trading strategy?

To find cointegrated pairs for a pairs trading strategy, scan your asset universe for highly correlated candidates and validate their long-term equilibrium using Engle-Granger or Johansen cointegration tests. This ensures statistical stationarity for robust spread monitoring.

How do Kalman filters calculate dynamic hedge ratios for trading pairs?

Kalman filters calculate dynamic hedge ratios for trading pairs by continuously adapting to shifting market regimes. This advanced estimation method ensures robust spread monitoring and generates real-time Z-score signals for accurate quantitative entry and exit points.

What is the difference between correlation and cointegration in quantitative trading?

In quantitative trading, correlation identifies co-moving assets through short-term price relationships, while cointegration verifies a long-term statistical equilibrium. Cointegration testing satisfies stationarity requirements, ensuring identified pairs reliably revert to their mean over time.

Can I perform sector clustering and lead-lag analysis for a multi-asset universe?

Yes, you can perform sector clustering and lead-lag transmission analysis across a multi-asset universe. The skill supports regime-conditional correlation studies to identify sector-specific pairs and analyze how price shocks transmit between assets.

Do I need statsmodels and scipy to run cointegration tests on asset pairs?

Yes, you need statsmodels and scipy along with pandas and numpy to run cointegration tests on asset pairs. These dependencies provide the necessary statistical functions to execute Engle-Granger, Johansen methods, and stationarity testing.

What is the best way to automate Z-score signal generation for mean reversion?

The best way to automate Z-score signal generation for mean reversion is to apply dynamic hedge ratio estimation via Kalman filters. This adapts to market regimes, continuously monitoring the spread to trigger automated entry and exit signals.