---
name: a-share-cross-market-a9613fa7aa82
description: 跨市场联动分析（A股/港股/美股/大宗商品）。当用户说"跨市场"、"联动"、"A股和美股"、"港股联动"、"AH溢价"、"中概股"、"美股跌了A股会跌吗"、"原油对A股影响"、"汇率影响"、"cross market"、"人民币贬值利好什么"、"跨市场联动"、"全球市场"时触发。MUST USE when user asks about cross-market correlation, AH premium, how US/HK markets affect A-shares, or commodity/FX impact on Chinese stocks. 分析A股与全球主要市场（美股/港股/商品/汇率）的联动关系、AH溢价、中概股映射、大宗商品传导。支持研报风格（formal）和快速参考风格（brief）。
---

### 数据源
```bash
# cn-stock-data 统一层获取行情（跨市场用 snowball 路由）
python -c "
import subprocess, json

# A股主要指数（通过 cn-stock-data → efinance 路由）
# 上证指数 000001, 沪深300 000300, 创业板指 399006
# 用 cn-stock-data skill 的 quote/kline 接口

# 港股（snowball 路由，HK 前缀）
# 恒生指数 HK00001, 恒生科技 HKHSTECH, H股指数 HK00011

# 美股（snowball 路由，US 前缀）
# 标普500 US.SPX, 纳斯达克 US.IXIC, 道琼斯 US.DJI

# 需要 pysnowball token 才能获取港美股数据
import pysnowball as ball
# ball.set_token('your_token')
# ball.quotec('SH000001,HKHSI,.DJI,.IXIC,.INX')  # 跨市场报价
# ball.kline('SH000001', period='day', count=-120)  # K线数据
"

# AH 股比较数据（akshare 直接调用）
python -c "
import akshare as ak
# AH 股比价
df = ak.stock_a_ah_comparison_em()
print(df.head(20).to_string())
# 返回字段：代码/名称/A股价格/H股价格/比价(A/H)/溢价率
"

# 大宗商品（akshare）
python -c "
import akshare as ak
# 国际原油
df = ak.futures_foreign_hist(symbol='CL')  # WTI原油
# 伦敦金
df = ak.futures_foreign_hist(symbol='GC')  # COMEX黄金
# LME铜
df = ak.futures_foreign_hist(symbol='HG')  # COMEX铜
print(df.tail(5).to_string())
"
```
补充 web 搜索：美股收盘情况、大宗商品实时价格、美元指数、离岸人民币汇率、美联储议息会议纪要、全球央行动态。

### Workflow (5 steps):

**Step 1: 多市场数据获取**
根据用户需求确定分析范围：
- **全面联动**："跨市场分析" → A股指数 + 美股三大指数 + 恒指 + 商品 + 汇率
- **双市场对比**："A股和美股联动" → 聚焦 A 股与美股
- **AH 溢价**："AH溢价分析" → 聚焦 A+H 双上市公司
- **商品传导**："原油对A股影响" → 聚焦特定商品 → A股传导链
- **汇率影响**："人民币贬值影响" → 聚焦汇率 → 行业影响

获取数据（近 60-120 个交易日）：
| 市场 | 标的 | 数据源 |
|------|------|--------|
| A股 | 上证/沪深300/创业板指 | cn-stock-data (efinance路由) |
| 美股 | S&P500/纳斯达克/道琼斯 | cn-stock-data (snowball路由) |
| 港股 | 恒生指数/恒生科技/H股指数 | cn-stock-data (snowball路由) |
| 商品 | 原油/黄金/铜/铁矿石 | akshare futures |
| 汇率 | 美元指数/离岸人民币 | web搜索 |

**Step 2: 相关性与领先滞后分析**

**相关系数计算**：
- 取日收益率序列，计算 Pearson 相关系数（近 60 日/120 日）
- 相关系数解读：|r|>0.7 强相关, 0.4-0.7 中等, <0.4 弱相关

**领先滞后关系**：
- 计算滞后 1-5 日的互相关系数
- 判断谁领先谁：隔夜美股 → 次日 A 股开盘是最常见的领先关系
- 注意：领先关系会随市场阶段变化，非固定规律

**联动强度变化**：
- 对比近期（20日）vs 中期（60日）相关系数，判断联动是否在加强/减弱
- 高联动阶段通常对应：全球风险事件、美联储政策转向、流动性冲击

**Step 3: AH 溢价分析（如涉及）**

通过 `ak.stock_a_ah_comparison_em()` 获取 AH 股数据：
- **整体溢价水平**：恒生 AH 溢价指数（HSAHP）历史区间 100-160，均值约 130
- **个股溢价排序**：找出溢价最高/最低的股票
- **溢价变动趋势**：近期溢价是扩大还是收窄
- **套利信号**：极端溢价个股可能存在价值回归机会（但需考虑汇率/流动性/制度差异）

| 溢价区间 | 市场状态 | 含义 |
|---------|---------|------|
| <110 | 罕见低溢价 | A股相对低估或港股相对高估 |
| 110-130 | 正常区间 | 反映制度差异溢价 |
| 130-150 | 偏高 | A股情绪偏热或港股承压 |
| >150 | 极端高溢价 | A股显著高估，关注回归风险 |

**Step 4: 传导机制分析**

**资金流传导**：
- 北向资金（沪深港通）→ A股直接影响
- 全球流动性（美联储政策）→ 新兴市场资金流向 → A股
- 美元强弱 → 人民币汇率 → 北向资金意愿

**情绪传导**：
- 隔夜美股大涨/大跌 → A股开盘跳空
- VIX 恐慌指数飙升 → 全球risk-off → A股承压
- 中概股异动 → A股对标公司联动

**基本面传导**：
- 原油上涨 → 化工/航空成本上升，油服/煤化工受益
- 铜价上涨 → 有色板块受益，新能源成本承压
- 美国经济衰退 → 中国出口承压 → 出口链公司
- 人民币贬值 → 出口企业受益，航空/造纸（美元债）承压

**政策传导**：
- 美联储加息/降息 → 中美利差 → 资金流向
- 美国关税政策 → 贸易摩擦 → 相关行业
- 全球央行协同/分化 → 汇率波动 → 跨境资金

**Step 5: 输出**

### 风格说明
| 维度 | formal（机构跨市场研究） | brief（快速跨市场参考） |
|------|----------------------|----------------------|
| 篇幅 | 4-8 页 | 1-2 页 |
| 市场覆盖 | A股+美股+港股+商品+汇率全覆盖 | 聚焦用户关心的2-3个市场 |
| 相关性分析 | 完整相关系数矩阵+滞后分析 | 定性描述联动方向和强度 |
| AH溢价 | 完整AH溢价表+历史对比 | 整体溢价水平+异常个股 |
| 传导机制 | 详细多路径分析 | 核心传导链1-2条 |
| 历史对比 | 类似历史情景回顾 | 不需要 |
| 免责声明 | 需要 | 不需要 |

### 关键规则
1. **相关不等于因果**：两个市场同涨同跌不代表存在因果关系，可能受同一因素驱动
2. **联动强度因阶段而异**：A股受外盘影响程度在不同市场阶段差异显著（牛市中后期更独立，恐慌阶段高度联动）
3. **AH溢价有制度基础**：AH溢价不会归零，因为A/H两地存在投资者结构、流动性、交易制度的系统性差异
4. **汇率影响因行业而异**：人民币贬值对出口型企业利好，对进口依赖型/美元债较多企业利空，不可一概而论
5. **时差与交易时间**：美股收盘→A股开盘有时差，需注意盘后/盘前信息；港股与A股交易时间有重叠
6. **数据来源标注**：跨市场数据来源多样，务必标注每项数据的来源和时间点
7. **与其他 skill 联动**：跨市场分析结论可指导 a-share-sector（受影响行业）、a-share-northbound（北向资金分析）、a-share-macro（宏观政策背景）

## 使用示例

### 示例 1: 基本使用

```python
# 调用 skill
result = run_skill({
    "param1": "value1",
    "param2": "value2"
})
```

### 示例 2: 命令行使用

```bash
python scripts/run_skill.py --input data.json
```


---
Source attribution: aifinlab
Original project: https://github.com/aifinlab/FinClaw/blob/9e62862d1412157fa03ffd1f0b74969dcf0ed66c/skills/a-share-cross-market/SKILL.md
License: Apache-2.0
License information: https://www.apache.org/licenses/LICENSE-2.0
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   Copyright 2026 FinClaw Contributors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.



# Mega AI Hub resource metadata

Creator / publisher: aifinlab
Original project: https://github.com/aifinlab/FinClaw/blob/9e62862d1412157fa03ffd1f0b74969dcf0ed66c/skills/a-share-cross-market/SKILL.md
Attribution basis: Source repository record

Fields of work: Data & Analytics, Finance & Accounting, Marketing, Product Management
Roles: Data Analyst, Financial Analyst, Growth Marketer, Market Research Analyst, Product Manager
Specialties: API, Database
Tools: Akshare, Pysnowball
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: d5cb1312d9d0af9f7d718f8efdd40790030b540914e5baa543a73e99cf97aabc
