correlation-analysis
Correlation Analysis helps traders and portfolio managers understand how crypto assets move in tandem across different market conditions. It covers Pearson, Spearman, and Kendall correlation methods, rolling correlation windows for regime detection, hierarchical clustering to group similar assets, and tail dependence analysis to reveal crash co-movement that standard metrics miss. Use it to build diversified portfolios, generate pairs trading signals, and protect against concentration risk.
Correlation Analysis measures how crypto assets move together to assess diversification, manage portfolio risk, and identify trading opportunities.
AI-generated summary based on this skill's SKILL.md
Install
agiprolabs/claude-trading-skills/correlation-analysis · repository language: Python
git clone https://github.com/agiprolabs/claude-trading-skills
cp -r claude-trading-skills/skills/correlation-analysis ~/.claude/skills/correlation-analysisFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I calculate correlation between crypto assets with correlation-analysis?
correlation-analysis supports multiple correlation methods including Pearson, Spearman, and Kendall to measure how crypto assets move together. Pearson captures linear relationships, Spearman ranks-based correlation handles non-linear patterns, and Kendall provides robust tail dependence insights. You can compute pairwise correlations across your portfolio to identify which assets diversify each other and which move in lockstep, helping you understand concentration risk.
What is tail dependence and how does correlation-analysis detect it?
correlation-analysis identifies tail dependence—the tendency for assets to crash together—which standard correlation metrics miss. During market crashes, assets often become highly correlated despite appearing uncorrelated in normal conditions. Tail dependence analysis reveals this hidden co-movement, letting you assess whether your diversification actually protects during extreme events. This is critical for crash protection and portfolio stress testing.
Can correlation-analysis detect correlation regime shifts in markets?
Yes. correlation-analysis uses rolling correlation windows and regime detection to identify when asset relationships fundamentally change. Market shifts cause correlation structures to break down—altcoins may decouple from Bitcoin, or previously stable pairs may suddenly spike together. By tracking regime-dependent correlation changes, you can adapt your trading signals and rebalance portfolios before diversification benefits disappear.
How does correlation-analysis build diversified portfolios?
correlation-analysis constructs correlation matrices and applies hierarchical clustering to group similar assets and identify uncorrelated pairs. It then supports minimum variance portfolio construction using correlation-adjusted weights, optimizing allocation to maximize diversification benefit. You can assess whether adding an altcoin truly reduces portfolio risk or just adds correlated exposure to existing holdings.
How can I generate pairs trading signals from correlation divergence?
correlation-analysis tracks rolling correlations between asset pairs and flags when correlations diverge from historical norms. When two normally correlated assets suddenly decouple, or uncorrelated assets spike together, these divergences signal mean-reversion opportunities for pairs trading. The skill identifies breakdowns in established correlation patterns to generate actionable trading signals.
What methods does correlation-analysis use for rolling analysis?
correlation-analysis employs exponential weighted moving average (EWMA) and sliding window approaches for rolling correlation analysis. EWMA gives more weight to recent price movements, making it sensitive to regime shifts. These rolling methods let you track how BTC-ETH correlation or other pairs evolve over time, detect when relationships strengthen or weaken, and time entries and exits based on correlation regime changes.
SKILL.md
rendered from the published skill — quoted content, verbatim
Correlation Analysis
Cross-asset correlation analysis for diversification assessment, risk management, pairs trading signal generation, and portfolio construction.
Why Correlation Matters
Correlation measures how assets move together. In crypto markets this is critical for:
- Diversification: holding correlated assets provides no diversification benefit — you are effectively holding one concentrated position
- Risk management: portfolio risk depends on the correlation structure, not just individual asset volatility
- Pairs trading: highly correlated assets that temporarily diverge create mean-reversion opportunities
- Portfolio construction: optimal allocation requires accurate correlation estimates
- Crash protection: understanding tail dependence reveals whether assets crash together
Correlation Methods
Pearson Correlation
Linear correlation assuming normality. Most common but least robust for crypto.
```python import pandas as pd import numpy as np
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 5 files
skills/correlation-analysis/SKILL.md
skills/correlation-analysis/references/methodology.md
skills/correlation-analysis/references/portfolio_applications.md
skills/correlation-analysis/scripts/correlation_matrix.py
skills/correlation-analysis/scripts/rolling_correlation.py