Skip to main content
ClaudeWave
Skill12k repo starsupdated today

earnings-forecast

Earnings-forecast generates trading signals by analyzing discrepancies between proprietary earnings forecasts and analyst consensus expectations. It employs top-down macroeconomic analysis, bottom-up revenue decomposition, standardized unexpected earnings (SUE) calculations, post-earnings announcement drift (PEAD) tracking, and analyst estimate revision momentum to identify stocks likely to experience price movements driven by earnings surprises. Use this skill when screening for earnings-surprise trading opportunities, validating earnings estimates across different forecasting methodologies, or timing entries around earnings announcements.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading /tmp/earnings-forecast && cp -r /tmp/earnings-forecast/agent/src/skills/earnings-forecast ~/.claude/skills/earnings-forecast
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# 盈利预测与一致预期

## 概述

围绕企业盈利预测和市场一致预期偏差构建交易信号。核心逻辑:股价短期由盈利预期差驱动,捕捉「预期差」比预测绝对盈利更有价值。两条主线:① 自主预测 vs 一致预期对比寻找偏差;② 跟踪分析师预期修正动量。

## 核心概念

### 1. 自上而下预测法(Top-Down)

**预测链条:**

```
GDP增速预测 → 行业增加值增速 → 行业收入增速 → 龙头公司收入增速 → 利润率假设 → EPS预测
```

**A股实战示例(以白酒行业为例):**

| 层级 | 指标 | 预测逻辑 |
|------|------|---------|
| 宏观 | GDP +5.0% | 消费占GDP比重65%,消费增速约+6% |
| 行业 | 白酒收入 +8% | 高端白酒量价齐升,结构升级 |
| 公司 | 贵州茅台(600519.SH) | 出厂价+10%,销量+2%,收入约+12% |
| 盈利 | 净利润率55% | 提价传导,费用率稳定 |
| EPS | 约62元 | 净利润/总股本 |

**适用场景:** 行业beta判断、大盘盈利周期定位、宏观策略配合

### 2. 自下而上预测法(Bottom-Up)

**收入拆解三板斧:**

```python
# 方法1:量价拆解
revenue = volume * price
# 例:中国神华(601088.SH) = 煤炭销量(亿吨) × 煤价(元/吨) + 电力收入

# 方法2:客户/产品拆解
revenue = sum(segment_revenue for segment in business_lines)
# 例:美的集团(000333.SZ) = 暖通空调 + 消费电器 + 机器人及自动化

# 方法3:门店/用户拆解
revenue = stores * revenue_per_store  # 或 users * ARPU
# 例:海底捞(6862.HK) = 门店数 × 翻台率 × 客单价 × 营业天数
```

**利润率假设关键点:**
- 毛利率:原材料成本占比变动、产品结构升级
- 费用率:规模效应(收入增、费用率降)、研发投入变动
- 税率:高新技术企业15% vs 普通25%,是否有税收优惠到期

### 3. 标准化未预期盈利(SUE)

**公式:**

```python
SUE = (actual_EPS - consensus_EPS) / std(actual_EPS - consensus_EPS)
# consensus_EPS = 分析师一致预期EPS(取中位数)
# std = 过去8个季度预测偏差的标准差
```

**信号阈值(A股实证参考):**

| SUE范围 | 含义 | 交易动作 |
|---------|------|---------|
| SUE > +2.0 | 大幅超预期 | 强买入信号 |
| SUE +1.0~+2.0 | 温和超预期 | 买入信号 |
| SUE -1.0~+1.0 | 符合预期 | 无信号 |
| SUE -2.0~-1.0 | 温和低于预期 | 卖出信号 |
| SUE < -2.0 | 大幅低于预期 | 强卖出信号 |

### 4. 盈余公告后漂移(PEAD)

**现象:** 业绩公告后,超预期方向的股价漂移可持续30-60个交易日。

**A股PEAD策略实现:**

```python
# 策略逻辑
# 1. 业绩公告日(年报4/30前,中报8/31前,季报各截止日)
# 2. 计算SUE
# 3. SUE > +1.5 的股票买入持有 40 个交易日
# 4. SUE < -1.5 的股票卖出/做空(如果可以)

# 关键参数
holding_period = 40      # 持有交易日数
sue_threshold = 1.5      # SUE阈值
max_positions = 10       # 最大持仓数
rebalance_on = "earnings_date"  # 在业绩公告日调仓
```

**A股PEAD注意事项:**
- A股做空受限(融券),PEAD策略通常只做多头
- 业绩预告(1月底/7月中旬)比正式报告更早,抢先反应
- 年报4/30截止,集中在4月发布,信息拥挤期需分散

### 5. 分析师预期修正动量

**三个关键指标:**

```python
# 1. 预期修正比率(ERM)
ERM = (上调家数 - 下调家数) / 总覆盖家数
# ERM > 0.3 = 正面动量, ERM < -0.3 = 负面动量

# 2. 预期变化幅度
eps_change_pct = (new_consensus - old_consensus_30d_ago) / abs(old_consensus_30d_ago)
# 变化 > +5% = 显著上调

# 3. 预期离散度
dispersion = std(all_analyst_EPS) / mean(all_analyst_EPS)
# 离散度 > 0.3 = 分歧大, 不确定性高
# 离散度 < 0.1 = 共识强, 确定性高
```

**预期修正动量策略:**
- 买入:ERM > +0.3 且 eps_change_pct > +5% 且 dispersion < 0.25
- 卖出:ERM < -0.3 且 eps_change_pct < -5%
- 信号有效期:约 60-90 个交易日(预期修正动量衰减)

## 分析框架

### 盈利分析四步法

1. **构建预测**:选择Top-Down或Bottom-Up方法,输出EPS预测值
2. **获取一致预期**:从Wind/东方财富/同花顺获取分析师一致预期EPS
3. **计算偏差**:SUE或简单百分比偏差,判断超预期/低于预期方向
4. **信号生成**:根据SUE阈值生成交易信号,结合PEAD持有期管理仓位

### 财报日历(A股关键时间节点)

| 时间 | 事件 | 策略动作 |
|------|------|---------|
| 1月中旬 | 年报业绩预告披露高峰 | 抢先捕捉预期差 |
| 3-4月 | 年报正式发布 | 确认SUE,PEAD建仓 |
| 4月30日 | 年报截止日 | 未披露 = 利空信号 |
| 7月中旬 | 中报业绩预告 | 半年度预期修正 |
| 8月31日 | 中报截止日 | 同上 |
| 10月31日 | 三季报截止日 | Q3数据验证全年预期 |

### 预期差交易组合构建

```python
# 组合构建参数
config = {
    "universe": "沪深300成分股",          # 流动性保障
    "signal": "SUE > +1.5 或 ERM > +0.3", # 超预期信号
    "max_positions": 20,                  # 最大持仓
    "position_weight": "equal",           # 等权
    "holding_period": 40,                 # 交易日
    "rebalance": "earnings_calendar",     # 按财报日历调仓
    "stop_loss": -0.08,                   # 8%止损
}
```

## 输出格式

```
## 盈利预测分析 — [标的代码] [公司名称]

### 盈利预测
- 预测方法:[Top-Down / Bottom-Up]
- 预测EPS:[X元]
- 预测依据:[收入增速X%,利润率X%,关键假设]

### 一致预期对比
- 一致预期EPS:[X元](来源:[Wind/东财],覆盖[N]家)
- 预期偏差:[+X% / -X%]
- SUE:[+X.X]
- 预期离散度:[X.X]([高分歧/低分歧])

### 分析师动量
- ERM(预期修正比率):[+X.X](过去30日[N]家上调/[M]家下调)
- 预期变化幅度:[+X%]

### 信号判断
- SUE信号:[强买入/买入/无/卖出/强卖出]
- 动量信号:[正面/中性/负面]
- PEAD建仓窗口:[是/否](距财报发布[X]日)

### 风险提示
- [具体风险:如一次性收益、会计政策变更、商誉减值等]
```

## 注意事项

- 一致预期数据需要Wind/Choice等付费终端,免费数据源(东方财富网页版)可能不够及时
- SUE计算需要至少8个季度的历史预测偏差数据来估计标准差
- 业绩预告和业绩快报是比正式财报更早的信号源,但精度较低
- A股财报季信息拥挤(4月/8月),PEAD信号可能互相干扰
- 一次性损益(资产处置/政府补贴/投资收益)会扭曲EPS,需剔除非经常性损益用扣非EPS
- 预期修正动量有自我实现倾向(分析师羊群效应),拐点识别比趋势跟踪更有价值
- 小市值股票分析师覆盖少(< 3家),一致预期统计意义弱,优先选择沪深300/中证500成分股
- 本框架仅用于研究回测,不构成投资建议
vibe-tradingSkill

Professional finance research toolkit — backtesting (7 engines + benchmark comparison panel), factor analysis, Alpha Zoo (452 pre-built alphas across qlib158/alpha101/gtja191/academic), options pricing, 77 finance skills, 29 multi-agent swarm teams, Trade Journal analyzer, and Shadow Account (extract → backtest → render) across 7 data sources (tushare, yfinance, okx, akshare, mootdx, ccxt, futu).

adr-hshareSkill

ADR/H-share/A-share cross-listing premium analysis — track pricing gaps between US-listed ADRs, HK-listed H-shares, and A-shares for arbitrage signals, dual-listing valuation, and delisting risk assessment.

akshareSkill

AKShare financial data aggregator (18k+ stars). Free, no API key. Covers A-shares, US, HK, futures, macro, forex. Primary fallback for tushare and yfinance.

alpha-zooSkill

Browse and bench the bundled alpha zoos — prebuilt cross-sectional factor libraries (Kakushadze 101, GTJA 191, Qlib 158, Fama-French / Carhart). Use when the user asks "which alphas exist", wants metadata on a named alpha, or wants to run IC/IR on a whole zoo over a universe.

ashare-pre-st-filterSkill

A 股 ST/*ST 风险预测框架 — 基于最新中报/三季报或业绩预告/快报,预测下一财年是否会因营收、利润、净资产、分红不达标而被风险警示,并将新浪监管处罚记录作为独立证据面纳入风险等级。仅适用于 A 股,不预测财务造假。

asset-allocationSkill

Asset allocation theory and optimizer usage — MPT / Black-Litterman / risk budgeting / all-weather strategy, including guides for 4 optimizers and rebalancing rules.

backtest-diagnoseSkill

Diagnose failed or underperforming backtests, locate the root cause, and fix the issue

behavioral-financeSkill

Behavioral finance applications: theories of overreaction and underreaction, behavioral explanations for momentum and reversal, investor sentiment cycles, cognitive-bias checklists, and debiasing quantitative strategies.