MyClaw
HomeProductsUse CasesPricingSkillsResourcesCompany
HomeUse CasesPricingSkills
Sign In
Home
ProductsOpenClaw HostingHermes Agent Hosting
Use CasesPricingSkills
ResourcesCompareTutorialLearnBlogUpdatesResourcesCommunity
CompanyAboutSupport
Sign In
MyClaw.ai

Your AI agent, already running.

Product

OpenClaw HostingHermes Agent HostingUse CasesPricingCompareAlibaba Cloud

Resources

BlogUpdatesSkillsModelsSupportCommunityCapybara

Legal

TermsPrivacyCookieGDPRContact

© 2023 Cubo World Inc. All rights reserved.

← Back to Skills
Design & Media
🖼️

Stock Correlation

Analyze stock correlations to find related companies and trading pairs. Use when the user asks about correlated stocks, related companies, sector peers, trad…

by himself65v1.0.0
Connecting to VM...
Connecting to VM...
npx clawhub@latest install stock-correlation
2.8kStars
3.1kDownloads
5Current Installs
3.6kAll-time Installs
📦
v1.0.0Version
📅
Apr 11, 2026Updated
View Source(ClawHub)

Stock Correlation Skill Overview

Stock Correlation analyzes how stocks move together using historical price data sourced from Yahoo Finance via yfinance. It routes your request to the right analysis — from discovering which peers co-move with a single ticker, to deep-diving into a specific pair's relationship, clustering a group by correlation structure, or tracking how correlation shifts over time and across market regimes. Install it when you need data-driven insight into stock relationships for research, portfolio construction, or risk awareness.

How to Use It

Step 1: Run in your terminal or install this skill on MyClaw

npx clawhub@latest install stock-correlation
or

Click the Install button at the top of this page for one-click setup

When to Use Stock Correlation

Best Fit

  • You want to know which stocks tend to move with a ticker you're watching — e.g., "what correlates with NVDA" or "sympathy plays for TSLA."
  • You're analyzing a specific pair like AMD/NVDA or LITE/COHR and want metrics like Pearson correlation, beta, R-squared, and current spread z-score.
  • You have a basket of tickers and want to see the full correlation matrix, identify clusters of tightly linked stocks, and spot potential diversifiers or hedging candidates.
  • You want to understand how a pair's correlation changes over time — including rolling windows and whether correlation spikes during sell-offs or high-volatility regimes.

When Not to Use

  • You need real-time or intraday correlation data; this skill uses daily historical prices with a default one-year lookback.
  • You are looking for trade recommendations or financial advice — the skill presents data only and explicitly does not advise on positions.
  • You need correlation data for asset classes other than equities (e.g., futures, forex, fixed income).

Key Features

Intelligent Sub-Skill Routing

Automatically classifies your request and routes to one of four specialized analyses: Co-movement Discovery (single ticker), Return Correlation (specific pair), Sector Clustering (basket), or Realized Correlation (time-varying). Ambiguous requests default to sensible fallbacks — single ticker goes to discovery, two tickers go to pairwise analysis.

Co-movement Discovery (Sub-Skill A)

Given one ticker, dynamically builds a 15–30 stock peer universe by screening same-industry and adjacent-industry stocks via yf.screen() and yf.EquityQuery — no hardcoded lists. Returns a ranked table of the top correlated peers with company names, correlation values, and a brief explanation of why each link likely exists.

Pairwise Return Correlation (Sub-Skill B)

Computes Pearson correlation, beta, R-squared, 60-day rolling correlation statistics (mean, min, max, std dev), and current log-price spread z-score for any two tickers. The spread z-score highlights when a pair has diverged unusually far from its historical relationship.

Sector Clustering (Sub-Skill C)

Builds a full correlation matrix for a group of tickers and applies hierarchical clustering (Ward linkage via scipy, with a fallback to average-correlation sorting) to reorder the matrix and surface natural groupings. Identifies the strongest pairs, weakest pairs, and outlier tickers that may serve as diversifiers.

Realized & Regime-Conditional Correlation (Sub-Skill D)

Computes rolling correlations across 20-, 60-, and 120-day windows and breaks correlation down by market regime — up days, down days, high-volatility days, and large drawdown days. Highlights whether correlation spikes during stress, a critical consideration for risk management and hedging.

Honest Caveats Built In

Every response includes the lookback period used, number of observations, any tickers dropped for insufficient data, and standard reminders that correlation is not causation and past correlation does not guarantee future co-movement. No trades are ever recommended.

Use Cases

Finding Sympathy Plays Around Earnings

Ask "what moves with NVDA?" before a major earnings event. The skill screens sector and adjacent-industry peers, ranks them by realized correlation, and explains the likely link — helping you identify stocks that may react to NVDA's print even without reporting themselves.

Evaluating a Pair Trade Idea

Provide two tickers like AMD and NVDA. The skill returns correlation, beta, R-squared, rolling correlation stability, and the current spread z-score — giving you the quantitative foundation to assess whether a mean-reversion or pairs-trading idea has historical support.

Portfolio Diversification Check

Supply a basket of holdings and receive a clustered correlation matrix that reveals which positions are effectively moving together and which genuinely diversify the portfolio. Outlier tickers with low average group correlation are flagged as potential diversifiers.

Stress-Period Correlation Analysis

Ask "how has the correlation between LITE and COHR changed over time?" The skill computes rolling correlations across multiple windows and breaks results down by regime, showing whether the relationship tightens during sell-offs — the "correlations go to 1 in a crisis" effect that matters most for hedging.

Requirements

  • Python packages: yfinance, pandas, numpy (auto-installed by the skill if missing)
  • Optional: scipy for hierarchical clustering in Sub-Skill C (skill falls back gracefully if unavailable)
  • Data source: Yahoo Finance via yfinance — no API key required, but yfinance is not affiliated with or endorsed by Yahoo, Inc.
  • Internet access: Required at runtime to download historical price data
Connecting to VM...
npx clawhub@latest install stock-correlation
2.8kStars
3.1kDownloads
5Current Installs
3.6kAll-time Installs
📦
v1.0.0Version
📅
Apr 11, 2026Updated
View Source(ClawHub)

FAQ

Reviews

0 reviews

Log in to write a review

No reviews yet. Be the first to share your experience!