correlation-analysis

Analyze asset return series to identify market co-movement with Python.

Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ebrahim-sani/trading-automation --skill correlation-analysis-ebrahim-sani
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: correlation-analysis
Source: https://github.com/ebrahim-sani/trading-automation/tree/main/vibe-trading/agent/src/skills/correlation-analysis
Command: npx skills add https://github.com/ebrahim-sani/trading-automation --skill correlation-analysis-ebrahim-sani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Traders and analysts struggle to pinpoint truly related assets and to validate whether those relationships are stable enough for reliable pair‑trading or diversification, leading to misguided strategies and unexpected losses.

Core Features & Use Cases

  • Asset screening: Scan a universe for highly correlated candidates and filter them with cointegration tests.
  • Deep statistical analysis: Compute Pearson, Spearman, Kendall, rolling correlations, hedge ratios, half‑life, and Kalman‑filter dynamic ratios.
  • Signal generation: Produce Z‑score based entry/exit signals for automated pair‑trading strategies.
  • Cross‑market insights: Evaluate sector clustering, realized correlation, and lead‑lag relationships across markets.

Quick Start

Ask the correlation analysis skill to find the top 5 assets correlated with AAPL and generate pair‑trade 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 correlated assets for pair trading?ā–¼

To find correlated assets for pair trading, scan a universe of return series to identify highly correlated candidates and filter them with cointegration tests to validate relationship stability for reliable signals.

How do I generate pair-trade entry and exit signals from asset return series?ā–¼

Generate pair-trade signals by computing Z-scores from the spread of cointegrated asset return series, producing entry and exit triggers for automated trading strategies based on statistical mean reversion.

What statistical methods are used to detect market co-movement and cointegration?ā–¼

Detect market co-movement and cointegration using Pearson, Spearman, and Kendall correlation methods alongside rolling correlations and hedge ratios to evaluate the stability of asset relationships for diversification.

Do I need Python pandas and statsmodels to analyze asset correlations?ā–¼

Yes, analyzing asset correlations requires Python pandas, NumPy, SciPy, and statsmodels to compute statistical metrics, with optional matplotlib for visualizing rolling correlations and pair-trade signal outputs.

Can I compute dynamic hedge ratios using a Kalman filter for portfolio diversification?ā–¼

Yes, you can compute dynamic hedge ratios using a Kalman filter for portfolio diversification, adjusting ratios continuously over time to maintain optimal asset allocation and stable co-movement in changing markets.

When should I not use correlation analysis for trading strategies?ā–¼

Avoid using correlation analysis for trading strategies when asset return series show no statistical cointegration, as unstable relationships lead to misguided pair-trading signals and unexpected portfolio diversification losses.