# Stock Correlation

Analyze how stocks move together using Yahoo Finance price history (yfinance): find...

- Repository: https://github.com/himself65/finance-skills (3487 stars)
- Category: Business
- License: MIT
- Last updated: 2026-10-25
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add himself65/finance-skills --skill stock-correlation -g -a claude-code -y`
Codex: `npx skills add himself65/finance-skills --skill stock-correlation -g -a codex -y`
Cursor: `npx skills add himself65/finance-skills --skill stock-correlation -g -a cursor -y`
Gemini CLI: `npx skills add himself65/finance-skills --skill stock-correlation -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add himself65/finance-skills`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Stock Correlation Analysis Skill

If your host has not already executed the shell probes below (for example, in Codex), run the commands inside the `!` wrappers with its shell tool before choosing a setup path. Use the actual output; if shell access is unavailable, report that limitation.

Finds and analyzes correlated stocks using historical price data from Yahoo Finance via [yfinance](https://github.com/ranaroussi/yfinance). Routes to specialized sub-skills based on user intent.

**Important**: This is for research and educational purposes only. Not financial advice. yfinance is not affiliated with Yahoo, Inc.

---

## Step 1: Ensure Dependencies Are Available

**Current environment status:**

```
!`python3 -c "exec('try:\n import yfinance, pandas, numpy\n print(f\'yfinance={yfinance.__version__} pandas={pandas.__version__} numpy={numpy.__version__}\')\nexcept Exception:\n print(\'DEPS_MISSING\')')"`
```

If `DEPS_MISSING`, install required packages before running any code:

```python
import subprocess, sys
subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "yfinance", "pandas", "numpy"])
```

If all dependencies are already installed, skip the install step and proceed directly.

---

## Step 2: Route to the Correct Sub-Skill

Classify the user's request and jump to the matching sub-skill section below.

The rest: https://github.com/himself65/finance-skills/blob/HEAD/plugins/market-analysis/skills/stock-correlation/SKILL.md
