correlation-analysis

Perform cointegration tests and estimate dynamic hedge ratios on financial time series.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill addresses the challenge of identifying and validating stable long-term relationships between financial assets, which is essential for effective pairs trading and risk-managed portfolio construction.

Core Features & Use Cases

  • Co-movement Discovery: Automatically scan large asset universes to find highly correlated candidates for potential pairs trading.
  • Deep Quantitative Analysis: Perform rigorous cointegration testing (Engle-Granger/Johansen), calculate dynamic hedge ratios via Kalman filters, and estimate mean-reversion half-lives.
  • Use Case: A trader can use this to identify a pair of stocks with a strong cointegrating relationship, calculate the optimal dynamic hedge ratio, and generate Z-score based entry/exit signals to exploit temporary price divergences.

Quick Start

Use the correlation-analysis skill to perform an Engle-Granger cointegration test on the price series of NVDA.US and AMD.US to determine if they are suitable for a pairs trading strategy.

Frequently Asked Questions about correlation-analysis

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

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

To calculate dynamic hedge ratios for statistical arbitrage, apply a Kalman filter to the price series of your asset pairs. This method continuously updates the hedge ratio based on new market data, optimizing Z-score entry and exit signals for temporary price divergences.

What is the best way to find mean-reverting pairs in a large asset universe?

Regime-conditional correlation analyzes asset relationships by segmenting market data into different volatility or trend states. This technique identifies how cross-market linkages shift during specific market regimes, providing deeper context for risk-managed portfolio construction and quantitative signal generation.

Can I use pandas and statsmodels to estimate mean-reversion half-life?

Yes, you can use pandas and statsmodels to estimate mean-reversion half-life by analyzing the Ornstein-Uhlenbeck process of the spread. This calculation determines the expected time for a cointegrated pair's price divergence to revert to its mean, guiding statistical arbitrage workflows.

Does quantitative correlation analysis work for cross-market linkages?

Yes, quantitative correlation analysis works for cross-market linkages by evaluating co-movements across different financial assets. It performs multi-asset clustering and regime-conditional correlation to identify stable statistical relationships, satisfying requirements for quantitative signal generation and risk management.