a-share-correlation
A股相关性分析/联动关系/相关系数计算。当用户说"相关性"、"联动"、"correlation"、"XX和YY相关吗"、"哪些股票走势相似"、"分散化"、"对冲"、"beta"、"同涨同跌"、"相关性分析"、"相关系数"、"相关性矩阵"时触发。MUST USE when user asks about…
Skill by aifinlab
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/aifinlab-a-share-correlation
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/a-share-correlation
What's inside
- Skill name
a-share-correlation- Description
- A股相关性分析/联动关系/相关系数计算。当用户说"相关性"、"联动"、"correlation"、"XX和YY相关吗"、"哪些股票走势相似"、"分散化"、"对冲"、"beta"、"同涨同跌"、"相关性分析"、"相关系数"、"相关性矩阵"时触发。MUST USE when user asks about correlation analysis, correlation coefficient between stocks/sectors, or diversification analysis based on correlation. 计算个股/指数/行业之间的收益率相关系数、Beta值,分析联动关系和分散化效果,辅助组合构建和对冲决策。支持研报风格(formal)和快速查看风格(brief)。
- License
- Apache-2.0
- Instructions
- 93 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- correlation-guide.md · references/
SKILL.md (first lines)
# A股相关性分析 (Correlation & Co-movement Analysis)
## 数据源
通过 cn-stock-data skill 获取数据:
- `kline` 路由:多标的历史日K线(至少 1 年,推荐 2-3 年)
- `quote` 路由:实时行情、所属行业
计算工具:Python numpy/pandas
- `pandas.DataFrame.corr()` 计算皮尔逊相关系数矩阵
- `numpy` 做回归计算 Beta
- `pandas.DataFrame.rolling().corr()` 计算滚动相关性
## Workflow
### Step 1: 获取历史K线(多标的)
- 解析用户输入,识别 2-10 个标的(个股代码/指数代码/行业ETF)
- 通过 cn-stock-data 获取各标的日K线,时间跨度至少 1 年(默认 2 年)
- 同时获取大盘基准(沪深300 / 上证指数)作为 Beta 计算基准
- 对齐交易日,剔除停牌/缺失日期,确保数据完整性
- 计算日收益率序列:`r_t = (close_t - close_{t-1}) / close_{t-1}`
### Step 2: 计算相关系数矩阵(Correlation Matrix)
- 基于日收益率序列,计算皮尔逊相关系数矩阵
- 输出 N x N 矩阵表格,对角线为 1.0
- 标注相关性强度等级(参考 references/correlation-guide.md):
- |r| > 0.7:强相关(红色/深色标记)
- 0.3 < |r| < 0.7:中等相关
- |r| < 0.3:弱相关(绿色/浅色标记)
- r < 0:负相关(特别标注)
- 找出最高/最低相关性配对,重点分析
### Step 3: Beta 计算
- 对每个标的,以大盘指数(默认沪深300)为基准计算 Beta:
- `Beta = Cov(r_stock, r_market) / Var(r_market)`
- 解读 Beta 含义:
- Beta > 1.2:高弹性,涨跌幅大于大盘
- 0.8 < Beta < 1.2:与大盘同步
- Beta < 0.8:防御型,波动小于大盘
- Beta < 0:反向标的(极少见,如对冲类)
- 同时计算 R-squared(拟合优度),判断 Beta 的可靠性
### Step 4: 滚动相关性分析(Rolling Correlation)
- 计算 60 日滚动相关性(可自定义窗口期)
- 分析相关性的时间变化趋势:
- 相关性是否稳定?波动区间?
- 是否存在结构性变化(如某事件后相关性突增/骤降)?
- 近期相关性 vs 长期相关性的偏离度
- 用文字描述滚动相关性走势(如"近3个月相关性从0.3升至0.7")
### Step 5: 输出分析结果
**formal 风格**:
1. 分析概览:标的列表、数据区间、样本量
2. 相关系数矩阵(热力图描述 + 数据表格)
3. 关键配对分析(最强正相关、最强负相关、最弱相关各 top3)
4. Beta 分析表(含 R-squared)
5. 滚动相关性趋势分析
6. 分散化建议:基于相关性矩阵,推荐低相关组合
7. 风险提示
**brief 风格**(默认):
1. 相关系数矩阵表格
2. 一句话总结:关键联动关系 + Beta 特征
3. 分散化结论:哪些标的适合同时持有
4. 风险提示
## 注意事项
- 相关性不稳定,会随市场环境变化,务必结合滚动相关性判断
- 极端行情(如股灾、熔断)下相关性趋向 1,分散化失效
- 相关不等于因果,不能仅凭高相关性推断业务联系
- 分散化需要真正低相关的资产,同行业/同概念股往往高度相关
- 停牌期间数据需剔除,否则会扭曲相关性计算
- 数据为历史统计结果,不构成投资建议
## 使用示例
### 示例 1: 基本使用
```python
# 调用 skill
result = run_skill({
"param1": "value1",
"param2": "value2"
})
```
### 示例 2: 命令行使用
```bash
python scripts/run_skill.py --input data.json
```From aifinlab/FinClaw, Apache-2.0.
More from aifinlab/FinClaw
- 0.461score
a-share-capital-allocation
aifinlab
A股资本配置/再投资分析/资本支出与股东回报评估。当用户说"资本配置"、"capital allocation"、"回购"、"增发"、"并购"、"钱怎么花的"、"XX在做什么并购"、"定增"、"再融资"、"股份回购"、"资本开支"、"资本配置策略"、"资本配置分析"、"CAPEX"、"股东回报"时触发。MUST…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-concept
aifinlab
A股概念板块/题材分析/热点概念追踪。当用户说"概念板块"、"题材"、"热点板块"、"概念股"、"XX概念"、"AI概念"、"新能源概念"、"XX板块有哪些股票"、"今天什么板块涨了"、"风口"、"概念板块分析"、"热点题材"时触发。MUST USE when user asks about…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-material-check-accident-insurance-assistant
aifinlab
���û���Ҫ�����������������������ṹ������Ԥ���������Լ�顢�¹����֤�����顢��ҽ����ƥ���顢�����嵥����������ǰ����ʶ��ʱʹ�ñ�…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-board-analysis
aifinlab
A股涨跌停板分析/连板追踪/涨停板统计。当用户说"涨停"、"跌停"、"涨停板"、"连板"、"打板"、"炸板"、"涨停分析"、"今天多少家涨停"、"连板股"、"首板"、"二板"、"三板"、"涨停原因"、"XX涨停了"、"涨停板分析"时触发。MUST USE when user asks about…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-competitive-moat
aifinlab
A股企业护城河/竞争优势分析/竞争壁垒评估。当用户说"护城河"、"竞争优势"、"moat"、"壁垒"、"XX的护城河是什么"、"竞争力分析"、"可持续竞争优势"、"品牌溢价"、"转换成本"、"网络效应"、"护城河分析"、"竞争壁垒"时触发。MUST USE when user asks about…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-comps
aifinlab
A股可比公司分析/行业估值对标。当用户说"可比公司"、"估值对标"、"行业估值"、"comps"、"comparable company"、"同行对比"、"XX跟同行比怎么样"、"XX板块估值"、"可比公司分析"、"comps analysis"时触发。MUST USE when user asks about…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-case-summary-audit-assistant
aifinlab
���û���Ҫ�ѷ�ɢ�����������������ʺ�������ˡ����ˡ�������˻��ڲ�����ʹ�õİ���ժҪʱʹ�ñ� skill�������ڻ������������顢�¹ʾ���˵���������¼��סԺ���ϡ���Ժ��¼�����֤������鱨�桢�������桢����…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-case-summary-customer-service-assistant
aifinlab
���û���Ҫ�����ⰸ�����ϡ����̼�¼������״̬�������ڵ��ͨ��Ϣ�������ʺϿͷ������������Ա����Ӫ֧����Աʹ�õİ���ժҪʱʹ�ñ�…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-material-check-life-insurance-assistant
aifinlab
���û���Ҫ���������������������ṹ������Ԥ���������Լ�顢������ʵ������ԭ�����֤�����顢�����˺��������ʸ����ϼ�顢�����嵥����������ǰ����ʶ��ʱʹ�ñ�…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-autocorrelation
aifinlab
A股自相关/序列相关性/收益率自相关结构分析。当用户说"自相关"、"autocorrelation"、"序列相关"、"收益率预测性"、"动量还是反转"、"自相关系数"、"ACF"、"PACF"、"Ljung-Box"、"收益率是否可预测"、"随机游走检验"时触发。MUST USE when user asks…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-cash-flow
aifinlab
A股现金流分析/自由现金流质量评估。当用户说"现金流"、"自由现金流"、"FCF"、"cash flow"、"经营现金流"、"XX的现金流怎么样"、"收现比"、"净现比"、"资本开支"、"现金流量表"、"现金流分析"、"现金流质量"时触发。MUST USE when user asks about cash…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-convertible-bond
aifinlab
A股可转债分析/转债策略/可转债估值与筛选。当用户提到"可转债"或"转债"就触发。关键词:"可转债"、"转债"、"convertible bond"、"转股"、"转股价值"、"双低策略"、"强赎"、"XX转债怎么样"、"可转债打新"、"转债溢价率"、"转债分析"、"可转债筛选"、"转债到期收益率"、"YTM"、"下修…
SkillDFreshness: D★ 261Claude Code +9
Signals
- Stars
- 261
- Forks
- 39
- Open issues
- 2
- Last commit (this folder)
- Mar 26, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/aifinlab/FinClaw
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from aifinlab
- 0.461score
claims-material-check-accident-insurance-assistant
aifinlab
���û���Ҫ�����������������������ṹ������Ԥ���������Լ�顢�¹����֤�����顢��ҽ����ƥ���顢�����嵥����������ǰ����ʶ��ʱʹ�ñ�…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-autocorrelation
aifinlab
A股自相关/序列相关性/收益率自相关结构分析。当用户说"自相关"、"autocorrelation"、"序列相关"、"收益率预测性"、"动量还是反转"、"自相关系数"、"ACF"、"PACF"、"Ljung-Box"、"收益率是否可预测"、"随机游走检验"时触发。MUST USE when user asks…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-case-summary-audit-assistant
aifinlab
���û���Ҫ�ѷ�ɢ�����������������ʺ�������ˡ����ˡ�������˻��ڲ�����ʹ�õİ���ժҪʱʹ�ñ� skill�������ڻ������������顢�¹ʾ���˵���������¼��סԺ���ϡ���Ժ��¼�����֤������鱨�桢�������桢����…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-case-summary-customer-service-assistant
aifinlab
���û���Ҫ�����ⰸ�����ϡ����̼�¼������״̬�������ڵ��ͨ��Ϣ�������ʺϿͷ������������Ա����Ӫ֧����Աʹ�õİ���ժҪʱʹ�ñ�…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
claims-material-check-life-insurance-assistant
aifinlab
���û���Ҫ���������������������ṹ������Ԥ���������Լ�顢������ʵ������ԭ�����֤�����顢�����˺��������ʸ����ϼ�顢�����嵥����������ǰ����ʶ��ʱʹ�ñ�…
SkillDFreshness: D★ 261Claude Code +9 - 0.461score
a-share-board-analysis
aifinlab
A股涨跌停板分析/连板追踪/涨停板统计。当用户说"涨停"、"跌停"、"涨停板"、"连板"、"打板"、"炸板"、"涨停分析"、"今天多少家涨停"、"连板股"、"首板"、"二板"、"三板"、"涨停原因"、"XX涨停了"、"涨停板分析"时触发。MUST USE when user asks about…
SkillDFreshness: D★ 261Claude Code +9
Cite this page
a-share-correlation skill. Agent Mart. https://agentmart.dev/skills/aifinlab-a-share-correlation (last updated 2026-10-24)