A股协整检验/长期均衡关系分析。当用户说"协整"、"cointegration"、"长期均衡"、"价差平稳"、"XX和YY协整吗"时触发。量化检验股票间的协整关系。支持formal和brief风格。
Scanned 9/7/2026
Install to Claude Code
npx -y skills add aifinlab/FinClaw --skill a-share-cointegration-test --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of A Share Cointegration Test?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/aifinlab-a-share-cointegration-test)More formats (shields.io, HTML) on the badges page.
---
name: a-share-cointegration-test
description: A股协整检验/长期均衡关系分析。当用户说"协整"、"cointegration"、"长期均衡"、"价差平稳"、"XX和YY协整吗"时触发。量化检验股票间的协整关系。支持formal和brief风格。
---
# A股协整检验/长期均衡关系分析
## 数据源
```bash
SCRIPTS="$SKILLS_ROOT/cn-stock-data/scripts"
python "$SCRIPTS/cn_stock_data.py" kline --code [CODE] --freq daily --start [日期]
python "$SCRIPTS/cn_stock_data.py" quote --code [CODE]
python "$SCRIPTS/cn_stock_data.py" finance --code [CODE]
```
## Workflow
### Step 1: 获取多标的K线(价格序列)
### Step 2: 单位根检验
- ADF检验各序列是否I(1)
- KPSS检验辅助确认
### Step 3: 协整检验
- Engle-Granger两步法
- Johansen检验(多变量)
### Step 4: 误差修正模型
估计长期均衡关系和短期调整速度
### Step 5: 输出
| 维度 | formal | brief |
|------|--------|-------|
| 单位根 | ADF+KPSS结果 | 是否I(1) |
| 协整 | 检验统计量+p值 | 是否协整 |
| 价差分析 | 半衰期+均值回归参数 | 配对可行性 |
默认风格:brief。
## 关键规则
1. 协整是配对交易的理论基础——两股价差均值回归
2. 协整关系可能随时间变弱或消失——需定期重新检验
3. 同行业股票协整概率更高但非必然
4. Johansen检验适合多变量,Engle-Granger适合两变量
5. 半衰期过长(>60日)的协整关系实战价值有限
## 使用示例
### 示例 1: 基本使用
```python
# 调用 skill
result = run_skill({
"param1": "value1",
"param2": "value2"
})
```
### 示例 2: 命令行使用
```bash
python scripts/run_skill.py --input data.json
```
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Practical guide to testing web applications with screen readers for comprehensive accessibility validation.
克劳德代码会话的正式评估框架,实施评估驱动开发(EDD)原则
Django测试策略,包括pytest-django、TDD方法论、factory_boy、模拟、覆盖率以及测试Django REST Framework API。
Go测试模式包括表格驱动测试、子测试、基准测试、模糊测试和测试覆盖率。遵循TDD方法论,采用地道的Go实践。
在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。