New advertisers: 50% off your first month with code FIRSTMONTHSee slots
himself65 avatar

Stock Correlation

Finds correlated peers, pairwise betas, and rolling co-movement for stocks using Yahoo Finance price history.

skills.sh installs
4K
GitHub stars
3.6K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Routes requests across four modes: peer discovery, two-ticker return correlation, matrix clustering, and rolling or conditional correlation
  • Covers daily log-return correlation, beta, R-squared, spread z-scores, and 60-day rolling statistics with yfinance
  • Builds peer universes at runtime from industry and sector screens, with no hardcoded ticker lists
  • Designed for research on pair trading, hedging pairs, and sympathy plays, with no investment advice provided

Install

$ npx -y skills add himself65/finance-skills --skill stock-correlation -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

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

Details

Repository
github.com/himself65/finance-skills
Categories
Finance & Trading, Data Science & Analytics
First seen
May 16, 2026

More from himself65/finance-skills

All 24

Similar to Stock Correlation

More Finance & Trading