Earnings Forecast logo

Earnings Forecast

OrganizationPopular
HKUDS
earnings-forecast

盈利预测与一致预期分析(自上而下/自下而上预测法/SUE/PEAD/分析师预期修正),捕捉业绩超预期交易机会。

Overview

PublisherHKUDS
RepositoryVibe-Trading
Skill nameearnings-forecast
Stars
33.6K
Forks
5.5K
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by HKUDS on GitHub. Read the source before you install it.

Installation

Install the Earnings Forecast AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git /tmp/Vibe-Trading
mkdir -p .claude/skills
cp -r /tmp/Vibe-Trading/agent/src/skills/earnings-forecast .claude/skills/earnings-forecast
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Earnings Forecast in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Earnings Forecast on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Earnings Forecast is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

盈利预测与一致预期

概述

围绕企业盈利预测和市场一致预期偏差构建交易信号。核心逻辑:股价短期由盈利预期差驱动,捕捉「预期差」比预测绝对盈利更有价值。两条主线:① 自主预测 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成分股
  • 本框架仅用于研究回测,不构成投资建议

Frequently asked questions

What does the Earnings Forecast AI skill do?

盈利预测与一致预期分析(自上而下/自下而上预测法/SUE/PEAD/分析师预期修正),捕捉业绩超预期交易机会。

Why use Earnings Forecast on TypingMind?

Because you install it once and use it with any model. Earnings Forecast is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Earnings Forecast in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/earnings-forecast. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Earnings Forecast?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Earnings Forecast?

As many as you like. As long as a model supports skills, you can use Earnings Forecast with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Earnings Forecast AI skill free?

Yes. It is published on GitHub by HKUDS under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇