Stock Correlation Analysis
Your AI finds correlated stocks, measures pairwise correlation and beta, builds correlation matrices, and tracks rolling or regime-based co-movement using Yahoo Finance data. Great for pair trading, sector analysis, and risk management.
Try asking: “Show the correlation matrix for NVDA, AMD, AVGO, and GOOGL”
himself65 on GitHub
Curated by PromptsEdge from a public repo · MIT license. All credit goes to the author.
What is this skill?
Understanding how stocks move together is essential for pair trading, hedging, sector analysis, and risk management. With this skill, your AI analyzes historical price data to find correlated peers, measure pairwise correlation and beta, cluster groups into correlation matrices, and track rolling or regime-dependent co-movement. Whether you want to discover sympathy plays, analyze sector relationships, or build a diversified portfolio, this tool gives you actionable, data-backed insights.
What you can do
- Find correlated peers: "What stocks move with NVDA?" returns a ranked list of the most correlated tickers.
- Pairwise correlation and beta: "Correlation between AMD and NVDA" gives Pearson correlation, beta, R-squared, and spread stats.
- Build correlation matrices: "Correlation matrix for FAANG" shows NxN relationships and highlights clusters and outliers.
- Track rolling or regime-based correlation: "Rolling 60-day correlation for GOOGL and AVGO" plots how co-movement changes over time.
- Discover sector or supply-chain links: "Find sympathy plays for LITE" identifies related companies for event-driven trades.
- Compare relative performance in drawdowns: "What else drops when COHR drops?" reveals regime-dependent correlation.
How it works
When you provide a ticker or group of tickers, your AI fetches historical price data from Yahoo Finance using yfinance. For a single ticker, it searches a curated peer universe to find the most correlated stocks. For pairs, it calculates correlation, beta, and spread statistics, and for groups, it builds a full correlation matrix with optional hierarchical clustering. Rolling and regime-based analyses track how relationships change over different periods or market conditions. Results include clear tables, charts, and actionable commentary.
Good to know
- Requires Python 3.8+; yfinance, pandas, and numpy are auto-installed if missing.
- For sector clustering, scipy is optional (for advanced clustering).
- Works on all platforms with code execution (Claude Code, Claude.ai, etc.).
- Reference files document peer universe construction and fallback strategies.
Install this skill
- 1
Get the skill — it’s free
Use the Get this skill panel. Unlocked skills stay in My skills. - 2
Download or clone the files
Download the zip, or clone the repo and copy theplugins/market-analysis/skills/stock-correlationfolder. - 3
Put it where your agent looks for skills
For Claude Code, use your personal skills folder (every project) or a project’s own folder:~/.claude/skills/stock-correlation/SKILL.md # all projects .claude/skills/stock-correlation/SKILL.md # this project only
- 4
Just ask
No command needed. The agent reads the skill’s description and loads it on its own when your request matches.
SKILL.md frontmatter
What your agent reads to decide when to load this skill.
--- name: stock-correlation description: Analyze how stocks move together using Yahoo Finance price history (yfinance): find correlated peers for a ticker, measure correlation, beta, and spread between specific tickers, cluster a group into a correlation matrix, and track rolling or regime-dependent correlation. Use this skill whenever the user asks what moves with a stock, what else drops when it drops, related tickers or sympathy plays, sector or supply-chain peers, pair trading or hedging pairs, beta or relative performance, correlation matrices, co-movement, or rolling/realized correlation — including well-known pairs like AMD/NVDA, GOOGL/AVGO, or LITE/COHR. With a single ticker, assume the user wants its correlated peers. ---
Files
Open any Markdown file to read it here.
Related skills
View all →- Stock Liquidity AnalysisFreeYour AI analyzes a stock’s liquidity: bid-ask spreads, volume, order book depth, market impact, turnover, and slippage, all from Yahoo Finance data. Get a liquidity grade and cost estimates for trading.
- Yahoo Finance Data FetchFreeGet current quotes, price history, financial statements, options chains, dividends, analyst estimates, and more for any stock or ETF using Yahoo Finance data. Your AI handles tickers and custom screens.
- SaaS Valuation CompressionFreeYour AI analyzes how a private SaaS company’s ARR multiple changed between funding rounds, attributes the causes, and benchmarks against market medians and peers. Includes charts and a concise verdict.
- SEPA Stock AnalysisFreeYour AI analyzes stocks using Mark Minervini’s SEPA method: trend template, stage analysis, base patterns, pivot points, and risk-based sizing. Get a full readiness check for superperformance trades.