skillfed

correlation-analysis

Correlation-Analysis discovers asset pairs with strong co-movement for pairs trading and hedging through multiple analytical modes: co-movement scanning, deep return correlation studies, sector clustering, and cointegration testing. It computes Pearson, Spearman, and Kendall correlations, rolling dynamics, and spread Z-scores to identify statistically significant relationships.

Correlation-Analysis finds correlated asset pairs suitable for pairs trading and portfolio hedging strategies.

AI-generated summary based on this skill's SKILL.md

28,096 4,557 MIT updated by HKUDS

Install

HKUDS/Vibe-Trading/correlation-analysis · repository language: Python

git clone https://github.com/HKUDS/Vibe-Trading
cp -r Vibe-Trading/agent/src/skills/correlation-analysis ~/.claude/skills/correlation-analysis
npx skillfed install HKUDS/Vibe-Trading/correlation-analysis

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How does correlation-analysis find correlated assets for pairs trading?

Correlation-Analysis discovers asset pairs with strong co-movement through co-movement scanning and deep return correlation studies. It computes Pearson, Spearman, and Kendall correlations to identify statistically significant relationships suitable for pairs trading strategies. The tool also calculates rolling correlation dynamics to track how relationships evolve over time.

What is the difference between correlation and cointegration in Correlation-Analysis?

Correlation-Analysis tests both metrics: correlation measures contemporaneous co-movement between asset returns, while cointegration testing (via Engle-Granger and Johansen methods) validates long-run equilibrium relationships. Cointegration is stronger for pairs trading because it identifies mean-reverting spreads, whereas correlation alone may not guarantee stationarity for profitable signal generation.

Can Correlation-Analysis generate trading signals from spread mean reversion?

Yes. Correlation-Analysis generates trading signals using Z-scores applied to spreads between cointegrated pairs. It computes mean reversion half-life and spread stationarity via ADF tests to confirm signal validity. These Z-score signals identify overbought/oversold conditions for mean reversion trades, with hedge ratio calculations built into the framework.

How does Correlation-Analysis handle rolling correlation and regime changes?

Correlation-Analysis tracks rolling correlation across time windows to reveal how asset relationships shift. It analyzes correlation breakdown during crises and regime transitions, showing realized correlation changes and cross-market linkage dynamics. This regime analysis helps traders understand when historical correlations fail and diversification benefits disappear.

What portfolio insights does Correlation-Analysis provide through clustering?

Correlation-Analysis discovers sector structure and portfolio diversification patterns via sector clustering and correlation matrix analysis. It reveals co-movement discovery screening across asset universes, helping identify which assets truly diversify portfolios and which move together. This clustering uncovers hidden sector relationships for better portfolio construction.

Is Correlation-Analysis open source and what license does it use?

Correlation-Analysis is released under the MIT license, making it open source and freely usable for commercial and private projects. The permissive MIT license allows modification and redistribution with minimal restrictions.

SKILL.md

rendered from the published skill — quoted content, verbatim

Correlation and Cointegration Analysis

Overview

Correlation analysis is a foundational tool for pairs trading, portfolio construction, and risk management. This skill covers four analysis modes (co-movement discovery / return-correlation deep dive / sector clustering / realized correlation), a full cointegration-testing framework, cross-market linkage analysis, and the complete workflow from analytics to pair-trading signals.


Mode 1: Co-Movement Discovery

Use case: Given a target asset, scan a universe for highly correlated assets and build a candidate pool with similar industry or factor exposure, for use in pairs trading or substitute identification.

Workflow

``` 1. Pull daily return series for the target asset and N candidates 2. Compute Pearson / Spearman correlations between the target and each

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
agent/src/skills/correlation-analysis/SKILL.md

Related skills

Tags

statistical-arbitrage mean-reversion-trading portfolio-construction risk-management time-series-analysis market-regimes spread-trading asset-screening crisis-dynamics