correlation-analysis

Identify market co-movements and cointegration for pairs trading signals.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/DaddyElonMusk69/motis-agent --skill correlation-analysis-daddyelonmusk69
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: correlation-analysis
Source: https://github.com/DaddyElonMusk69/motis-agent/tree/main/skills/finance/correlation-analysis
Command: npx skills add https://github.com/DaddyElonMusk69/motis-agent --skill correlation-analysis-daddyelonmusk69

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Traders and analysts need reliable ways to uncover hidden relationships between assets, verify long‑run equilibrium, and turn those insights into profitable pairs‑trading opportunities, but manual statistical work is time‑consuming and error‑prone.

Core Features & Use Cases

  • Correlation Scanning: Quickly scan a universe of assets for high Pearson or Spearman correlations and filter candidates for further testing.
  • Deep Bivariate Analysis: Compute static and rolling correlations, beta, R², and Z‑Score spreads for two‑asset studies.
  • Sector Clustering: Perform hierarchical clustering on a correlation matrix to reveal sector structures and diversification gaps.
  • Realized & Regime‑Based Correlation: Generate rolling correlation series and conditional statistics across market regimes.
  • Cointegration Testing: Run Engle‑Granger and Johansen tests, calculate half‑life, and assess spread mean‑reversion.
  • Dynamic Hedge Ratios: Apply a Kalman filter to obtain time‑varying hedge ratios and spreads.
  • Cross‑Market Linkage: Analyze lead‑lag relationships and FX‑adjusted correlations across global markets.
  • Pair‑Trading Signal Generation: Produce entry, exit, and stop signals based on Z‑Score thresholds and dynamic spreads.

Quick Start

Ask the agent to perform a correlation scan on Apple’s returns against the S&P 500 universe.

Frequently Asked Questions about correlation-analysis

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

FAQPage Schema
How do I test if two stocks are cointegrated for pairs trading?

To test if two stocks are cointegrated for pairs trading, apply Engle-Granger and Johansen tests to verify long-run equilibrium, then estimate half-life to assess spread mean-reversion before generating entry signals.

What is the best way to find correlated assets across a large equity universe?

The best way to find correlated assets across an equity universe is performing a correlation scan using Pearson or Spearman metrics to filter candidates, followed by hierarchical clustering on the correlation matrix to reveal sector structures and diversification gaps.

How do I calculate dynamic hedge ratios for a pair trading strategy?

To calculate dynamic hedge ratios for pair trading, apply a Kalman filter to your asset return series to obtain time-varying hedge ratios and spreads, which adapt to changing market conditions better than static beta calculations.

Can I use rolling correlation to analyze market regime shifts?

Yes, rolling correlation can analyze market regime shifts by generating rolling correlation series and computing conditional statistics across different market regimes to identify structural breaks in asset co-movements.

Why use cointegration tests instead of correlation for pair trading signals?

Cointegration tests are used instead of correlation for pair trading signals because correlation only measures short-term co-movement direction, while cointegration verifies a long-run statistical equilibrium, ensuring the spread will mean-revert rather than trend apart indefinitely.

Does sector clustering work for identifying cross-market diversification gaps?

Sector clustering works for identifying cross-market diversification gaps by applying hierarchical clustering to a correlation matrix of global market returns, revealing sector structures and lead-lag relationships even across FX-adjusted cross-market linkages.