SuperAPI AI Directory

sentiment-analysis

Data & analytics

View repository

Updated 10-15 22:13

About this skill

Market Sentiment Analysis

Overview

Quantify market sentiment, transforming the subjective "greed and fear" into measurable indicators. Covers five major dimensions: the Fear & Greed Index, options sentiment, leveraged capital, foreign capital flows, and social sentiment. Sentiment indicators are often used as contrarian indicators.

Fear & Greed Index

Crypto Fear & Greed Index

分值范围: 0-100
Score Sentiment State Historical Signal
0-20 Extreme Fear Bottom zone (contrarian buy)
20-40 Fear Near bottom
40-60 Neutral Wait and see
60-80 Greed Near top
80-100 Extreme Greed Top zone (contrarian sell)

Component factors:

  • Volatility (25%): BTC 30-day/90-day volatility
  • Market momentum (25%): BTC price vs MA(30/90)
  • Social media (15%): Twitter/Reddit sentiment word frequency
  • Surveys (15%): Investor surveys
  • Bitcoin dominance (10%): BTC Dominance
  • Google Trends (10%): "Bitcoin" search popularity

### A股恐贪指标

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

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

### 恐贪指数使用方法

Core principle: Be greedy when others are fearful, and fearful when others are greedy

Practical application:

  1. Extreme fear (<20): Signal to build positions in batches

    • Do not go all in at once; split into 3-5 batches
    • Confirm there is fundamental support (not fear caused by a blowup)
  2. Extreme greed (>80): Signal to gradually reduce positions

    • Do not short (the trend may continue)
    • Reduce positions to a safe level (e.g., from 80% position to 50%)
  3. Neutral range: Sentiment indicators fail; look at other factors


## Put-Call Ratio

### 定义与解读

Put-Call Ratio = Put option volume / Call option volume

PCR Meaning Signal (contrarian indicator)
> 1.5 Extremely bearish sentiment Bullish (excessive fear)
1.0-1.5 Bearish Bullish
0.7-1.0 Neutral No clear signal
0.5-0.7 Bullish Bearish
< 0.5 Extremely bullish sentiment Bearish (excessive greed)

### 不同市场PCR参考

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

### PCR与VIX配合使用

High PCR + high VIX = extreme panic (strong bullish reversal signal) Low PCR + low VIX = extreme complacency (watch out for black swans) High PCR + low VIX = hedging demand (institutions protecting longs) Low PCR + high VIX = contradictory signal (needs more confirmation)


## 融资融券信号(A股)

### 融资余额分析

Margin financing = borrowing money to buy stocks (bullish leverage) Securities lending = borrowing stocks to sell (bearish leverage)

Margin financing balance indicators:

  • Absolute value: Reflects the total amount of leveraged capital (about 1.5-1.8 trillion in 2024)
  • Rate of change: Week-over-week/month-over-month, direction matters more than absolute value
  • Proportion: Margin financing balance / total A-share market capitalization, usually 2-3%

### 融资融券信号

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

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

2015 bull market top: 2.27 trillion (extreme) 2018 bear market bottom: 0.76 trillion 2020 normal range: 1.0-1.2 trillion 2024 normal range: 1.4-1.8 trillion

Rule of thumb: Margin financing balance monthly increase >10% → overheating warning Margin financing balance monthly decrease >10% → panic warning


## 北向资金信号(A股)

### 北向资金分析框架

Northbound capital = foreign capital buying A-shares through the Shanghai-Hong Kong Stock Connect and Shenzhen-Hong Kong Stock Connect

Core characteristics:

  1. Scale: Cumulative net buying of about 2 trillion
  2. Style: preference for white horses (consumer + financial + tech leaders)
  3. Foresight: has repeatedly added positions at bottoms in history
  4. Limitation: divergence between active vs passive after 2023

### 北向资金信号

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

### 北向资金使用注意

Changes after 2023:

  1. The share of passive funds (ETFs) has risen, reducing the reference value of active stock picking
  2. Large single-day fluctuations may be hedging trades (non-directional)
  3. "Fake foreign capital" (mainland funds routed through Hong Kong) interferes with signals

Suggestions:

  • Look at weekly/monthly cumulative figures and ignore single-day fluctuations
  • Distinguish active vs passive (some data sources can break this down)
  • Cross-validate with margin balances and ETF subscriptions/redemptions

## 社交媒体舆情分析

### 舆情量化框架

Data sources:

  • Chinese: Xueqiu/Eastmoney Guba/Weibo/WeChat Official Accounts
  • English: Twitter(X)/Reddit/Telegram
  • Crypto: CryptoTwitter/Discord/Telegram groups

Quantitative dimensions:

  1. Discussion heat: mention frequency / baseline frequency
  2. Sentiment tendency: proportion of positive/negative/neutral
  3. Sentiment intensity: positive average - negative average
  4. Sentiment change: direction of change versus the previous period

### 舆情指标

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

### 社交媒体情绪周期

Bottom: no one discussing → a few people bottom-fishing → controversy period Rise: discussion increases → optimism spreads → newcomers pour in Top: everyone discussing → extreme optimism → those not bullish are mocked Decline: controversy → panic → no one discussing (back to the bottom)

Buffett indicator: taxi drivers/barbers start discussing stocks = top


## 综合情绪评分框架

### 评分模型

Composite sentiment = 0.25×Fear & Greed + 0.20×PCR + 0.20×margin + 0.20×northbound + 0.15×public opinion

Each dimension is standardized to 0-100: 0-20: extreme fear 20-40: fear 40-60: neutral 60-80: greed 80-100: extreme greed


### 情绪 → 操作映射

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

## 输出格式

```markdown
## 市场情绪分析

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

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

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

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

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

Notes

  1. Contrarian indicators are not precise timing: sentiment can persist for a long time in extreme zones; do not short/long based on sentiment alone
  2. Combine sentiment + trend: greed in an uptrend is normal, and fear in a downtrend is also normal
  3. Different markets have different thresholds: sentiment thresholds differ greatly across A-shares, U.S. stocks, and crypto
  4. Data acquisition limitations: some sentiment data requires paid APIs (such as Bloomberg sentiment indicators, Glassnode)
  5. Social media is very noisy: bots/marketing accounts can interfere with public opinion analysis and need to be filtered
  6. Changes in northbound capital: after 2023, northbound data disclosure rules changed, and real-time data is less transparent than before
  7. Margin data is T+1: margin trading and securities lending data is published on a T+1 basis and lags