correlation-analysis

Identify and validate cointegrated asset pairs for trading strategies.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/0xZKnw/vibe-trading-tap --skill correlation-analysis-0xzknw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: correlation-analysis
Source: https://github.com/0xZKnw/vibe-trading-tap/tree/main/agent/src/skills/correlation-analysis
Command: npx skills add https://github.com/0xZKnw/vibe-trading-tap --skill correlation-analysis-0xzknw

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill solves the challenge of identifying stable long-term relationships between assets, enabling data-driven pairs trading and robust portfolio risk management.

Core Features & Use Cases

  • Co-movement Discovery: Scan large asset universes to find highly correlated candidates for potential pairs trading.
  • Deep Analytical Framework: Perform comprehensive bivariate analysis including Pearson/Spearman/Kendall correlations, cointegration testing (Engle-Granger/Johansen), and dynamic hedge ratio estimation via Kalman filters.
  • Regime-Adaptive Analysis: Analyze how correlations evolve across different market regimes (bull, bear, high-volatility) to ensure strategy robustness.

Quick Start

Use the correlation-analysis skill to identify the top 10 cointegrated pairs from the provided asset universe and generate their Z-score signals.

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 asset pairs for a pairs trading strategy?

You can identify cointegrated asset pairs by scanning your asset universe for highly correlated candidates, then validating them using Engle-Granger or Johansen tests to confirm long-term statistical relationships suitable for trading.

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

Correlation measures short-term co-movement between assets, while cointegration identifies stable long-term relationships. This skill uses both, screening with Pearson or Spearman correlation before applying rigorous cointegration tests to validate pairs.

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

Dynamic hedge ratios are calculated by applying a Kalman filter to your cointegrated asset pairs. This continuously updates the ratio over time, adapting to changing market conditions better than static regression methods.

Can I analyze how asset correlations change across different market regimes?

Yes, this skill performs regime-adaptive analysis to evaluate how correlations evolve across bull, bear, and high-volatility markets, ensuring your pairs trading strategy remains robust under varying market conditions.

What Python libraries do I need for cointegration testing and Z-score signal generation?

You need pandas, numpy, scipy, and statsmodels for the statistical analysis and cointegration testing, with matplotlib and seaborn used for visualizing the resulting Z-score signals and correlation clusters.

Does high Pearson correlation guarantee a valid pairs trading opportunity?

No, high correlation alone does not guarantee a valid pairs trading opportunity. You must perform deep bivariate analysis and cointegration testing to ensure the spread is stationary before generating trading signals.