Sentiment Analysis logo

Sentiment Analysis

OrganizationPopular
HKUDS
sentiment-analysis

市场情绪分析——恐贪指数/Put-Call Ratio/融资融券/北向资金信号解读、社交媒体舆情量化框架

Overview

PublisherHKUDS
RepositoryVibe-Trading
Skill namesentiment-analysis
Stars
35.2K
Forks
5.7K
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 Sentiment Analysis 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.
    https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/sentiment-analysis
  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/sentiment-analysis .claude/skills/sentiment-analysis
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sentiment Analysis 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 Sentiment Analysis 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 Sentiment Analysis 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.

市场情绪分析

概述

量化市场情绪,将主观的"贪婪与恐惧"转化为可衡量的指标。覆盖恐贪指数、期权情绪、杠杆资金、外资流向和社交舆情五大维度。情绪指标常作为反向指标使用。

恐贪指数

加密恐贪指数(Crypto Fear & Greed Index)

分值范围: 0-100

| 分值 | 情绪状态 | 历史信号 |
|------|---------|---------|
| 0-20 | 极度恐惧 | 底部区域(逆向买入)|
| 20-40 | 恐惧 | 偏底部 |
| 40-60 | 中性 | 观望 |
| 60-80 | 贪婪 | 偏顶部 |
| 80-100 | 极度贪婪 | 顶部区域(逆向卖出)|

构成因子:
- 波动率 (25%): BTC 30天/90天波动率
- 市场动量 (25%): BTC价格 vs MA(30/90)
- 社交媒体 (15%): Twitter/Reddit情绪词频
- 调查 (15%): 投资者调查
- 比特币市占率 (10%): BTC Dominance
- Google趋势 (10%): "Bitcoin"搜索热度

A股恐贪指标

A股没有统一的恐贪指数,用以下组合替代:

指标数据源极度恐惧极度贪婪
上证换手率交易所<0.5%>2.5%
涨停家数/跌停家数行情数据<0.3>5.0
新增开户数(周)中登<20万>100万
融资余额变化(月)交易所净流出>500亿净流入>1000亿
ETF净申购基金数据宽基ETF净申购(抄底)净赎回(获利了结)

恐贪指数使用方法

核心原则: 别人恐惧时贪婪,别人贪婪时恐惧

实操:
1. 极度恐惧(<20): 分批建仓信号
   - 不要一次性全仓,分3-5批
   - 确认有基本面支撑(不是暴雷导致的恐惧)

2. 极度贪婪(>80): 逐步减仓信号
   - 不要做空(趋势可能持续)
   - 减仓到安全水位(如从80%仓位降到50%)

3. 中性区间: 情绪指标失效,看其他因素

Put-Call Ratio

定义与解读

Put-Call Ratio = Put期权成交量 / Call期权成交量

| PCR | 含义 | 信号(反向指标)|
|-----|------|----------------|
| > 1.5 | 极度看空情绪 | 看多(恐惧过度)|
| 1.0-1.5 | 偏空 | 偏多 |
| 0.7-1.0 | 中性 | 无明确信号 |
| 0.5-0.7 | 偏多 | 偏空 |
| < 0.5 | 极度看多情绪 | 看空(贪婪过度)|

不同市场PCR参考

市场数据源正常范围极端区间
美股(CBOE)VIX期权0.7-1.2<0.5 或 >1.5
A股(上证50ETF)上交所0.5-1.5<0.3 或 >2.0
BTC(Deribit)Deribit0.3-0.8<0.2 或 >1.2

PCR与VIX配合使用

PCR高 + VIX高 = 极度恐慌(强烈看多反转信号)
PCR低 + VIX低 = 极度自满(警惕黑天鹅)
PCR高 + VIX低 = 对冲需求(机构在保护多头)
PCR低 + VIX高 = 矛盾信号(需要更多确认)

融资融券信号(A股)

融资余额分析

融资 = 借钱买股(看多杠杆)
融券 = 借股卖出(看空杠杆)

融资余额指标:
- 绝对值: 反映杠杆资金总量(2024年约1.5-1.8万亿)
- 变化率: 周环比/月环比,方向比绝对值重要
- 占比: 融资余额/A股总市值,通常2-3%

融资融券信号

指标看多信号看空信号
融资余额底部企稳后连续增加高位加速增加(过热)
融资净买入连续5天净买入连续5天净卖出
融券余额大幅增加后减少(空头回补)突然大增(有人做空)
融资/融券比比值回落后反弹极端高位(杠杆过高)

融资余额历史阈值(A股)

2015年牛市顶部: 2.27万亿(极端)
2018年熊市底部: 0.76万亿
2020年正常区间: 1.0-1.2万亿
2024年正常区间: 1.4-1.8万亿

经验法则: 融资余额月增>10% → 过热警示
          融资余额月减>10% → 恐慌警示

北向资金信号(A股)

北向资金分析框架

北向资金 = 通过沪深港通买A股的外资

核心特征:
1. 规模: 累计净买入约2万亿
2. 风格: 偏好白马(消费+金融+科技龙头)
3. 前瞻性: 历史上多次在底部加仓
4. 局限: 2023年后主动型vs被动型分化

北向资金信号

指标看多信号看空信号
单日净流入>100亿(强烈信号)<-100亿
连续流入天数>10天连续流入>10天连续流出
月度净流入>500亿<-500亿
持仓变化增持低估值白马减持周期+概念股

北向资金使用注意

2023年后变化:
1. 被动资金(ETF)占比上升,主动选股参考价值下降
2. 单日大额波动可能是对冲交易(非方向性)
3. "假外资"(内地资金绕道香港)干扰信号

建议:
- 看周度/月度累计,忽略单日波动
- 区分主动型vs被动型(有些数据源可拆分)
- 与融资余额、ETF申赎交叉验证

社交媒体舆情分析

舆情量化框架

数据源:
- 中文: 雪球/东方财富股吧/微博/微信公众号
- 英文: Twitter(X)/Reddit/Telegram
- 加密: CryptoTwitter/Discord/Telegram群

量化维度:
1. 讨论热度: 提及频次 / 基准频次
2. 情绪倾向: 正面/负面/中性比例
3. 情绪强度: 正面均值 - 负面均值
4. 情绪变化: 较上期的变化方向

舆情指标

指标计算反向信号
热度指数搜索量/讨论量 vs MA(30)热度暴增=过热
看多比例看多帖子/总帖子>80%=极度乐观(警惕)
新人指数新注册账号讨论占比>50%=散户涌入(顶部)
KOL一致性大V观点一致度一致看多=危险

社交媒体情绪周期

底部: 无人讨论 → 少数人抄底 → 争议期
上涨: 讨论增加 → 乐观蔓延 → 新人涌入
顶部: 全民讨论 → 极度乐观 → 不看好者被嘲笑
下跌: 争议 → 恐慌 → 无人讨论(回到底部)

巴菲特指标: 出租车司机/理发师开始讨论股票 = 顶部

综合情绪评分框架

评分模型

综合情绪 = 0.25×恐贪 + 0.20×PCR + 0.20×融资 + 0.20×北向 + 0.15×舆情

每个维度标准化到 0-100:
0-20: 极度恐惧
20-40: 恐惧
40-60: 中性
60-80: 贪婪
80-100: 极度贪婪

情绪 → 操作映射

综合情绪仓位建议操作
0-2080-100%逆向满仓
20-4060-80%逐步加仓
40-6040-60%标准仓位
60-8020-40%逐步减仓
80-1000-20%逆向清仓

输出格式

markdown
## 市场情绪分析

### 情绪仪表盘
| 指标 | 当前值 | 分位 | 信号 |
|------|--------|------|------|
| 恐贪指数(加密) | 72 | 75% | 贪婪 |
| A股换手率 | 1.8% | 70% | 偏活跃 |
| PCR(50ETF) | 0.65 | 35% | 偏乐观 |
| 融资余额变化(周) | +280亿 | 80% | 杠杆加速 |
| 北向净流入(周) | +120亿 | 60% | 偏正面 |

### 综合情绪评分: 68/100(贪婪区间)

### 情绪解读
当前市场情绪偏贪婪,多个指标指向乐观:
- 融资余额加速增长,杠杆资金积极
- 北向资金持续流入,外资态度正面
- 但PCR偏低,期权市场缺乏对冲意识

### 操作建议
- 建议仓位: 降至40-50%
- 不追高,等回调再加仓
- 可适当买入看跌期权对冲

### 风险提示
- 情绪指标是反向指标,不是精确择时工具
- 趋势强时情绪可以持续极端很久

注意事项

  1. 反向指标不是精确择时:情绪可以在极端区域持续很久,不要仅凭情绪做空/做多
  2. 情绪+趋势结合:上升趋势中的贪婪是正常的,下降趋势中的恐惧也是正常的
  3. 不同市场不同阈值:A股、美股、加密的情绪阈值差异大
  4. 数据获取限制:部分情绪数据需要付费API(如Bloomberg情绪指标、Glassnode)
  5. 社交媒体噪音大:机器人/营销号会干扰舆情分析,需要过滤
  6. 北向资金变化:2023年后北向数据披露规则变化,实时数据不如以前透明
  7. 融资数据T+1:融资融券数据为T+1日公布,有滞后

Frequently asked questions

What does the Sentiment Analysis AI skill do?

市场情绪分析——恐贪指数/Put-Call Ratio/融资融券/北向资金信号解读、社交媒体舆情量化框架

Why use Sentiment Analysis on TypingMind?

Because you install it once and use it with any model. Sentiment Analysis 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 Sentiment Analysis in TypingMind?

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

Which AI models can use Sentiment Analysis?

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 Sentiment Analysis?

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

Is the Sentiment Analysis 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 👇