@openfinclaw/findoo-datahub-plugin 2026.3.2 → 2026.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/DESIGN.md +492 -151
  2. package/_vendor/claude-skills-finance/SKILL.md +192 -0
  3. package/_vendor/claude-skills-finance/assets/dcf_analysis_template.md +184 -0
  4. package/_vendor/claude-skills-finance/assets/expected_output.json +161 -0
  5. package/_vendor/claude-skills-finance/assets/forecast_report_template.md +177 -0
  6. package/_vendor/claude-skills-finance/assets/sample_financial_data.json +219 -0
  7. package/_vendor/claude-skills-finance/assets/variance_report_template.md +122 -0
  8. package/_vendor/claude-skills-finance/references/financial-ratios-guide.md +396 -0
  9. package/_vendor/claude-skills-finance/references/forecasting-best-practices.md +294 -0
  10. package/_vendor/claude-skills-finance/references/valuation-methodology.md +255 -0
  11. package/_vendor/claude-skills-finance/scripts/budget_variance_analyzer.py +406 -0
  12. package/_vendor/claude-skills-finance/scripts/dcf_valuation.py +449 -0
  13. package/_vendor/claude-skills-finance/scripts/forecast_builder.py +494 -0
  14. package/_vendor/claude-skills-finance/scripts/ratio_calculator.py +432 -0
  15. package/index.ts +332 -14
  16. package/openclaw.plugin.json +2 -2
  17. package/package.json +1 -1
  18. package/references/cn-market-specifics.md +165 -0
  19. package/references/crypto-analysis.md +635 -0
  20. package/references/financial-ratios-cn.md +452 -0
  21. package/references/hk-market-specifics.md +166 -0
  22. package/references/macro-cycle-cn.md +409 -0
  23. package/references/valuation-cn.md +427 -0
  24. package/skills/README.md +294 -0
  25. package/skills/a-concept-cycle/skill.md +200 -0
  26. package/skills/a-convertible-arb/skill.md +294 -0
  27. package/skills/a-dividend-king/skill.md +187 -0
  28. package/skills/a-earnings-season/skill.md +221 -0
  29. package/skills/a-index-timer/skill.md +192 -0
  30. package/skills/a-ipo-new/skill.md +297 -0
  31. package/skills/a-northbound-decoder/skill.md +185 -0
  32. package/skills/a-quant-board/skill.md +286 -0
  33. package/skills/a-share/skill.md +347 -0
  34. package/skills/a-share-radar/skill.md +185 -0
  35. package/skills/cross-asset/skill.md +202 -0
  36. package/skills/crypto/skill.md +269 -0
  37. package/skills/crypto-altseason/skill.md +208 -0
  38. package/skills/crypto-btc-cycle/skill.md +231 -0
  39. package/skills/crypto-defi-yield/skill.md +181 -0
  40. package/skills/crypto-funding-arb/skill.md +158 -0
  41. package/skills/crypto-stablecoin-flow/skill.md +149 -0
  42. package/skills/data-query/skill.md +124 -30
  43. package/skills/derivatives/skill.md +188 -35
  44. package/skills/etf-fund/skill.md +216 -0
  45. package/skills/factor-screen/skill.md +186 -0
  46. package/skills/hk-china-internet/skill.md +190 -0
  47. package/skills/hk-dividend-harvest/skill.md +192 -0
  48. package/skills/hk-hsi-pulse/skill.md +154 -0
  49. package/skills/hk-southbound-alpha/skill.md +163 -0
  50. package/skills/hk-stock/skill.md +295 -0
  51. package/skills/macro/skill.md +244 -53
  52. package/skills/risk-monitor/skill.md +171 -0
  53. package/skills/us-dividend/skill.md +162 -0
  54. package/skills/us-earnings/skill.md +149 -0
  55. package/skills/us-equity/skill.md +235 -0
  56. package/skills/us-etf/skill.md +261 -0
  57. package/skills/us-sector-rotation/skill.md +223 -0
  58. package/src/config.ts +4 -5
  59. package/src/datahub-client.test.ts +4 -7
  60. package/src/datahub-client.ts +6 -1
  61. package/src/register-tools.ts +720 -0
  62. package/src/tool-helpers.ts +89 -0
  63. package/test/e2e/l3-gateway-bootstrap.live.test.ts +339 -0
  64. package/test/e2e/l4-skill-tool-chain.live.test.ts +465 -0
  65. package/skills/crypto-defi/skill.md +0 -69
  66. package/skills/equity/skill.md +0 -64
  67. package/skills/market-radar/skill.md +0 -47
@@ -0,0 +1,190 @@
1
+ ---
2
+ name: fin-hk-china-internet
3
+ description: "China Internet sector — 5-stock basket (Tencent/Alibaba/Meituan/JD/Bilibili) performance, valuation bands, fundamental scorecard, relative strength, regime overlay. Use when: user asks about China tech stocks, KWEB, China Internet valuation, Tencent vs Alibaba, or whether to buy China tech dip. NOT for: individual HK stock deep-dive (use fin-hk-stock), A-share tech stocks (use fin-a-share), US-listed ADRs (use fin-us-equity), southbound flow analysis (use fin-hk-southbound-alpha)."
4
+ metadata:
5
+ { "openclaw": { "emoji": "\U0001F310", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
6
+ ---
7
+
8
+ # China Internet Sector Analysis
9
+
10
+ Analyze the 5 core China Internet stocks listed in Hong Kong as a basket and individually. Cut through sentiment noise with fundamental scorecards, valuation bands, and relative strength ranking. China Internet is an emotional rollercoaster — this skill provides the data-driven handrails.
11
+
12
+ ## When to Use
13
+
14
+ - "中概互联网现在什么情况" / "How is China Internet doing?"
15
+ - "腾讯阿里美团怎么选" / "Tencent vs Alibaba vs Meituan comparison"
16
+ - "中概互联网现在便宜吗" / "Is China Internet cheap now?"
17
+ - "中概科技 basket 今年表现" / "China tech basket YTD return"
18
+ - "中概互联网抄底" / "Should I buy the China tech dip?"
19
+ - "哪只中概互联网最强" / "Which China Internet stock is leading?"
20
+ - "腾讯估值处于历史什么位置" / "Where is Tencent's valuation historically?"
21
+
22
+ ## When NOT to Use
23
+
24
+ - 单只港股深度分析 (00700.HK 财报全景) → use `/fin-hk-stock`
25
+ - A 股科技股 (688xxx 科创板) → use `/fin-a-share`
26
+ - 美股 ADR 分析 (BABA/JD US-listed) → use `/fin-us-equity`
27
+ - 南向资金趋势分析 → use `/fin-hk-southbound-alpha`
28
+ - 恒指整体估值 → use `/fin-hk-hsi-pulse`
29
+ - 港股高息股 → use `/fin-hk-dividend-harvest`
30
+ - 宏观数据 (GDP/CPI) → use `/fin-macro`
31
+
32
+ ## Basket Universe
33
+
34
+ | Code | Company | Weight | Sector Focus |
35
+ | -------- | -------- | ------ | ------------------------ |
36
+ | 00700.HK | Tencent | 20% | Gaming, social, fintech |
37
+ | 09988.HK | Alibaba | 20% | E-commerce, cloud |
38
+ | 03690.HK | Meituan | 20% | Local services, delivery |
39
+ | 09618.HK | JD.com | 20% | E-commerce, logistics |
40
+ | 09626.HK | Bilibili | 20% | Video, gaming, Gen-Z |
41
+
42
+ Equal-weighted basket. When computing basket return: simple average of 5 individual returns.
43
+
44
+ ## Tools & Parameters
45
+
46
+ ### fin_stock — Individual stock data
47
+
48
+ | Parameter | Type | Required | Format | Default | Example |
49
+ | ---------- | ------ | -------- | ---------- | ------- | ---------------- |
50
+ | symbol | string | Yes | XXXXX.HK | — | 00700.HK |
51
+ | endpoint | string | Yes | see below | — | price/historical |
52
+ | start_date | string | No | YYYY-MM-DD | — | 2025-01-01 |
53
+ | end_date | string | No | YYYY-MM-DD | — | 2026-03-07 |
54
+ | limit | number | No | 1-5000 | 200 | 250 |
55
+
56
+ #### Endpoints
57
+
58
+ | endpoint | Description | Example |
59
+ | -------------------- | --------------------- | ---------------------------------------------------------------------- |
60
+ | `price/historical` | OHLCV for each stock | `fin_stock(symbol="00700.HK", endpoint="price/historical", limit=250)` |
61
+ | `hk/income` | IFRS income statement | `fin_stock(symbol="00700.HK", endpoint="hk/income", limit=8)` |
62
+ | `fundamental/ratios` | PE/PB/PS/ROE | `fin_stock(symbol="00700.HK", endpoint="fundamental/ratios")` |
63
+ | `profile` | Company overview | `fin_stock(symbol="00700.HK", endpoint="profile")` |
64
+
65
+ ### fin_data_regime — Sector regime detection
66
+
67
+ | Parameter | Type | Required | Example |
68
+ | --------- | ------ | -------- | -------- |
69
+ | symbol | string | Yes | 00700.HK |
70
+ | market | string | Yes | equity |
71
+
72
+ ### fin_ta — Technical analysis
73
+
74
+ | Parameter | Type | Required | Example |
75
+ | --------- | ------ | -------- | -------- |
76
+ | symbol | string | Yes | 00700.HK |
77
+ | indicator | string | Yes | rsi |
78
+
79
+ ### fin_market — Southbound flow context
80
+
81
+ | endpoint | Description | Example |
82
+ | ---------------- | ------------------------ | ------------------------------------------------- |
83
+ | `flow/ggt_daily` | Southbound daily net buy | `fin_market(endpoint="flow/ggt_daily", limit=20)` |
84
+
85
+ ## China Internet Analysis Pattern
86
+
87
+ 1. **Basket performance snapshot** — Pull prices for all 5 stocks
88
+ `fin_stock(symbol="00700.HK", endpoint="price/historical", limit=250)` — repeat for 09988/03690/09618/09626
89
+ - Compute: individual YTD/1M/3M returns + equal-weight basket return
90
+ - Compute: basket return vs HSI return = basket alpha
91
+ - ⚠️ If basket alpha > 10% → sector strongly outperforming, momentum play
92
+ - ⚠️ If basket alpha < -10% → sector under heavy pressure, check fundamentals (step 3)
93
+ - 💡 Rank 5 stocks by return: leaders vs laggards reveal market's sector preferences
94
+
95
+ 2. **Relative strength ranking** — Identify divergence within basket
96
+ - Rank 5 stocks by 1M/3M/YTD return
97
+ - Compute: return spread (best performer - worst performer)
98
+ - ⚠️ If spread > 30% → severe divergence, not a "rising tide lifts all boats" market
99
+ - ⚠️ If Bilibili (09626) significantly underperforming → growth/profitability concerns in smaller names
100
+ - 💡 Leaders rotating from value (BABA/JD) to quality (Tencent/Meituan) or vice versa = market sentiment shift
101
+
102
+ 3. **Fundamental scorecard** `fin_stock(endpoint="hk/income", limit=8)` for each stock — Revenue/margin quality
103
+ - For each stock extract: revenue YoY growth, gross margin, operating margin, net income
104
+ - Build scorecard:
105
+ | Metric | Scoring |
106
+ | ------------------ | -------------------------------- |
107
+ | Revenue growth | >15% = strong, 5-15% = moderate, <5% = weak |
108
+ | Gross margin trend | Expanding = positive, compressing = negative |
109
+ | Operating margin | >15% = healthy, <10% = pressure |
110
+ | Net income | Positive + growing = strong |
111
+ - ⚠️ If revenue growth <5% AND margin compressing → "structural slowdown", not just cyclical
112
+ - ⚠️ If net income negative (Bilibili historically) → check OCF — cash burn rate matters
113
+ - 💡 Cross-ref: margin improvement = "降本增效" (cost-cutting) narrative — sustainable if revenue still growing, fragile if revenue flat
114
+
115
+ 4. **Valuation band analysis** `fin_stock(endpoint="fundamental/ratios")` for each stock — Historical context
116
+ - For each: current PE/PS + 3Y/5Y percentile position
117
+ - ⚠️ If PE < 25th percentile of 5Y range → historically cheap for this stock
118
+ - ⚠️ If PS < 1x for any name (e.g., Alibaba/JD) → "priced for permanent impairment"
119
+ - 💡 Compare across basket: Tencent PE premium over Alibaba PE — if spread narrows, market seeing convergence
120
+ - 💡 PE alone can mislead for growth stocks — also check PS (revenue-based) and PEG if growth data available
121
+
122
+ 5. **Regime and technical overlay** `fin_data_regime(symbol="00700.HK", market="equity")` — Trend direction
123
+ - Check regime for Tencent (sector bellwether) as proxy for sector regime
124
+ - `fin_ta(symbol="00700.HK", indicator="rsi")` — Overbought/oversold check
125
+ - ⚠️ If RSI <30 for 2+ basket members → sector oversold, potential bounce
126
+ - ⚠️ If RSI >70 for 3+ basket members → sector overheated, take-profit risk
127
+ - 💡 Combine: cheap valuation (step 4) + oversold RSI + bullish regime = strongest entry signal
128
+ - 💡 Combine: expensive valuation + overbought RSI + bearish regime = strongest exit signal
129
+
130
+ 6. **Southbound flow context** `fin_market(endpoint="flow/ggt_daily", limit=20)` — Mainland money behavior
131
+ - On days with large southbound inflow, check if tech names had volume spikes
132
+ - ⚠️ If southbound surging + tech volume spiking → mainland "smart money" rotating into sector
133
+ - ⚠️ If southbound surging but tech volume flat → flow going to dividend/banks, not tech
134
+ - 💡 Cross-ref `/fin-hk-southbound-alpha` for full flow analysis
135
+
136
+ 7. **Policy risk assessment** — The X-factor for China Internet
137
+ - Not data-driven (no endpoint), but MUST be included in every analysis
138
+ - Key risk factors: antitrust enforcement, data security regulation, gaming restrictions, geopolitics
139
+ - ⚠️ Always mention that regulatory risk is the #1 non-fundamental driver of China Internet valuations
140
+ - 💡 Historical pattern: post-regulation-shock recovery takes 6-18 months, but stocks typically overshoot on downside
141
+
142
+ ## Signal Quick-Reference
143
+
144
+ | Basket Condition | Valuation | Regime/RSI | Signal |
145
+ | ------------------------------------ | ------------------ | -------------- | --------------------- |
146
+ | Basket alpha >10%, all 5 rising | Fair/cheap | Bullish | Momentum buy |
147
+ | Basket alpha <-10%, divergence high | Deep value (<25th) | Oversold (<30) | Contrarian accumulate |
148
+ | Basket alpha <-10%, margins falling | Fair | Bearish | Avoid / wait |
149
+ | Leaders rotating value→quality | Mixed | Neutral | Be selective |
150
+ | Tencent/Meituan leading, BABA/JD lag | Premium expanding | Mixed | Quality over value |
151
+
152
+ ## Data Notes
153
+
154
+ - **Price data**: yfinance, ~15 min delay, historical data reliable for trend analysis
155
+ - **HK financials**: tushare `hk/income`, semi-annual (interim Aug, annual Feb-Apr), lag 1-2 months after filing
156
+ - **Fundamental ratios**: yfinance, PE/PB/PS updated with market price, earnings from last filing
157
+ - **Regime detection**: algorithmic, not a forecast; reflects current trend state
158
+ - **RSI**: 14-period default from fin_ta
159
+ - **Missing**: ETF data (2840.HK/KWEB AUM/flow), ADR premium (BABA ADR vs 09988.HK spread), regulatory event timeline database, analyst consensus estimates
160
+ - **ADR linkage**: for ADR-listed names (BABA/JD/BILI), use `/fin-us-equity` for US-side price; spread = US close converted to HKD vs HK close
161
+
162
+ ## Response Guidelines
163
+
164
+ ### Number Format
165
+
166
+ - Stock price: HK$388.60 (2 decimals with HK$ prefix)
167
+ - PE/PS: 20.5x / 1.8x (1 decimal + "x")
168
+ - Returns: +25.3% / -8.1% (always signed, 1 decimal)
169
+ - Revenue: 1,528 亿 RMB (integer, specify RMB for mainland-incorporated companies)
170
+ - Gross margin: 47.2% (1 decimal)
171
+ - Basket alpha: +12pp (percentage points vs HSI)
172
+
173
+ ### Must Include
174
+
175
+ - Data cutoff date
176
+ - Basket equal-weight return vs HSI (alpha)
177
+ - Individual stock return ranking (leader to laggard)
178
+ - At least 2 stocks' valuation percentile position
179
+ - Fundamental scorecard summary (revenue growth + margin trend for each)
180
+ - Regime label for sector
181
+ - Policy/regulatory risk caveat (EVERY response must mention this)
182
+
183
+ ### Display Format
184
+
185
+ - Lead with basket snapshot (1-2 sentences: basket return, alpha, divergence level)
186
+ - Performance table: 5 stocks x (Price / 1M / 3M / YTD / PE / PS)
187
+ - Fundamental scorecard table: 5 stocks x (Rev Growth / Gross Margin / Op Margin / Net Income trend)
188
+ - Valuation context: current PE vs 5Y range (cheap/fair/expensive label)
189
+ - Relative strength ranking: #1 to #5 with brief reason
190
+ - End with: sector signal + policy risk caveat + what to watch next
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: fin-hk-dividend-harvest
3
+ description: "HK dividend strategy — tax-adjusted yield (H-share 20%/red-chip 10%/foreign 0%), dividend safety score, liquidity filter, yield trap detection. Use when: user wants HK high-yield stocks, dividend income strategy, after-tax yield comparison, or asks if a HK stock's dividend is sustainable. NOT for: individual HK stock analysis (use fin-hk-stock), A-share dividends (use fin-a-share), REITs/ETFs (use fin-etf-fund), HSI valuation (use fin-hk-hsi-pulse)."
4
+ metadata:
5
+ { "openclaw": { "emoji": "\U0001F4B0", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
6
+ ---
7
+
8
+ # HK Dividend Harvest
9
+
10
+ Screen and evaluate Hong Kong high-dividend stocks with **tax-adjusted yields**. HK's unique multi-tier dividend tax (H-share 20%, red-chip 10%, foreign 0%) means headline yield ≠ real yield. This skill ensures investors compare after-tax returns and avoid liquidity traps.
11
+
12
+ ## When to Use
13
+
14
+ - "港股高息股推荐" / "HK high-yield stock picks"
15
+ - "想买港股收息" / "HK dividend income strategy"
16
+ - "中移动和工行收息哪个好" / "China Mobile vs ICBC for dividends"
17
+ - "这只股 yield 9% 靠谱吗" / "Is this 9% yield sustainable?"
18
+ - "港股股息税怎么算" / "HK dividend tax explained"
19
+ - "港股收息组合" / "HK dividend portfolio"
20
+ - "港股高息陷阱" / "HK yield trap"
21
+
22
+ ## When NOT to Use
23
+
24
+ - 单只港股全景分析 (财报/技术面/AH溢价) → use `/fin-hk-stock`
25
+ - A 股红利策略 / A 股股息 → use `/fin-a-share`
26
+ - 港股 REITs/ETF 分析 → use `/fin-etf-fund`
27
+ - 恒指估值判断 → use `/fin-hk-hsi-pulse`
28
+ - 美股股息 → use `/fin-us-equity`
29
+ - 港股流动性专项检查 → use `/fin-hk-stock` (Liquidity Trap Detection)
30
+ - ETF/基金分红 → use `/fin-etf-fund`
31
+
32
+ ## Tools & Parameters
33
+
34
+ ### fin_stock — Individual stock data
35
+
36
+ | Parameter | Type | Required | Format | Default | Example |
37
+ | ---------- | ------ | -------- | ------------- | ------- | ------------------ |
38
+ | symbol | string | Yes | 5-digit + .HK | — | 00941.HK |
39
+ | endpoint | string | Yes | see below | — | fundamental/ratios |
40
+ | start_date | string | No | YYYY-MM-DD | — | 2023-01-01 |
41
+ | end_date | string | No | YYYY-MM-DD | — | 2026-03-07 |
42
+ | limit | number | No | 1-5000 | 200 | 20 |
43
+
44
+ #### Endpoints
45
+
46
+ | endpoint | Description | Example |
47
+ | ----------------------- | ------------------------ | --------------------------------------------------------------------- |
48
+ | `fundamental/ratios` | PE/PB/dividend yield | `fin_stock(symbol="00941.HK", endpoint="fundamental/ratios")` |
49
+ | `fundamental/dividends` | Dividend history | `fin_stock(symbol="00941.HK", endpoint="fundamental/dividends")` |
50
+ | `hk/income` | IFRS P&L (payout calc) | `fin_stock(symbol="00941.HK", endpoint="hk/income")` |
51
+ | `hk/cashflow` | OCF (sustainability) | `fin_stock(symbol="00941.HK", endpoint="hk/cashflow")` |
52
+ | `price/historical` | Price + volume | `fin_stock(symbol="00941.HK", endpoint="price/historical", limit=60)` |
53
+ | `profile` | Company info + structure | `fin_stock(symbol="00941.HK", endpoint="profile")` |
54
+
55
+ ### Auxiliary
56
+
57
+ | Tool / Endpoint | Use Case | Example |
58
+ | ----------------------------- | ----------------------------- | ------------------------------------------------ |
59
+ | `fin_macro(endpoint="hibor")` | Risk-free rate (yield spread) | `fin_macro(endpoint="hibor")` |
60
+ | `fin_data_regime` | Market regime overlay | `fin_data_regime(symbol="HSI", market="equity")` |
61
+
62
+ ## HK Dividend Tax Structure
63
+
64
+ **This is the core knowledge edge.** Always compute tax-adjusted yield before comparison.
65
+
66
+ | Company Structure | Tax Rate | Examples | Detection Method |
67
+ | -------------------------------------------- | -------- | --------------------------------------------------------- | ---------------------------------------------- |
68
+ | **H-share** (mainland-incorporated) | 20% | ICBC (01398), PetroChina (00857), BYD (01211) | `profile` → incorporated in mainland China |
69
+ | **Red-chip** (HK-incorporated, mainland ops) | 10% | China Mobile (00941), CNOOC (00883), China Unicom (00762) | `profile` → HK incorporated, mainland revenue |
70
+ | **HK-local / Foreign** | 0% | HSBC (00005), AIA (01299), CLP (00002) | `profile` → HK/foreign incorporated + operated |
71
+ | **Stock Connect (southbound individual)** | 20% | Applies to all HK stocks via Connect | Channel-based, not stock-based |
72
+ | **Stock Connect (southbound institution)** | 10% | Applies to all HK stocks via Connect | Channel-based |
73
+
74
+ Formula: `after_tax_yield = headline_yield * (1 - tax_rate)`
75
+
76
+ Example: ICBC H-share headline yield 7.2% → after-tax 5.76%; China Mobile red-chip 6.8% → after-tax 6.12%. Same ballpark headline, but red-chip nets 0.36% more annually.
77
+
78
+ ## Dividend Harvest Analysis Pattern
79
+
80
+ 1. **Headline yield screening** `fin_stock(endpoint="fundamental/ratios")` — Get dividend yield, PE, PB
81
+ - Target: headline DY > 5% (to clear tax drag and still beat deposits)
82
+ - ⚠️ If DY > 8% → high probability of yield trap, proceed to step 5 immediately
83
+ - 💡 PE <12x is a basic margin of safety; PE >15x + high DY = likely one-time special dividend
84
+
85
+ 2. **Liquidity gate** `fin_stock(endpoint="price/historical", limit=60)` — Compute avg daily turnover (volume \* close)
86
+ - **MUST run before any buy recommendation**
87
+ - ⚠️ Daily turnover < 10M HKD → **REJECT** — liquidity trap, "easy to buy, impossible to exit"
88
+ - ⚠️ Daily turnover 10-50M HKD → **WARN** — limited liquidity, position sizing critical
89
+ - Daily turnover > 50M HKD → PASS
90
+ - 💡 Connect eligibility (`fin_market(endpoint="flow/hs_const")`) adds southbound liquidity buffer
91
+
92
+ 3. **Tax classification** `fin_stock(endpoint="profile")` — Determine company structure → tax rate
93
+ - Map incorporation + revenue geography to H-share/red-chip/local categories
94
+ - Compute after-tax yield = headline \* (1 - tax_rate)
95
+ - ⚠️ If user invests via Stock Connect → always apply 20% regardless of company structure
96
+ - 💡 For same headline yield, prefer red-chip (10%) over H-share (20%) = 0.6-0.7% annual edge
97
+
98
+ 4. **Dividend safety assessment** — Multi-factor sustainability check
99
+ a. **Payout ratio** `fin_stock(endpoint="hk/income")` — dividend / net income
100
+ - ⚠️ Payout ratio > 90% → unsustainable unless utility/REIT with guaranteed cash flow
101
+ - Healthy range: 30-70%
102
+ b. **Cash flow cover** `fin_stock(endpoint="hk/cashflow")` — OCF / total dividends paid
103
+ - ⚠️ OCF/Dividend < 1.2x → dividends funded by debt or asset sales, not operations
104
+ - Healthy: OCF/Dividend > 1.5x
105
+ c. **Earnings stability** `fin_stock(endpoint="hk/income", limit=12)` — 3-year net income trend
106
+ - ⚠️ 2+ consecutive years of declining net income → dividend cut risk elevated
107
+ d. **Dividend history** `fin_stock(endpoint="fundamental/dividends")` — Continuity
108
+ - Consecutive years of payment ≥ 5 years → stable payer
109
+ - ⚠️ Skipped a year in past 5 years → unreliable, apply discount
110
+
111
+ **Dividend Safety Score**:
112
+ | Factor | Green | Yellow | Red |
113
+ | --------------------------- | ------------ | --------------- | ---------------- |
114
+ | Payout ratio | 30-70% | 70-90% | >90% or negative |
115
+ | OCF/Dividend | >1.5x | 1.2-1.5x | <1.2x |
116
+ | Earnings trend (3Y) | Stable/growing| Flat | Declining |
117
+ | Consecutive dividend years | ≥5 years | 3-4 years | <3 years |
118
+
119
+ Score: 4 Green = **Safe** | 3+ Green = **Adequate** | Any Red = **At Risk** | 2+ Red = **Dangerous**
120
+
121
+ 5. **Yield trap detection** — When DY looks too good to be true
122
+ - ⚠️ DY > 8% + payout > 90% + earnings declining → **YIELD TRAP** — dividend cut is imminent
123
+ - ⚠️ DY > 10% + daily turnover < 30M HKD → **ILLIQUID YIELD TRAP** — worst combination
124
+ - ⚠️ Special/one-time dividend inflating trailing yield → next year's yield will be much lower
125
+ - 💡 Check `fundamental/dividends` for consistency: if latest dividend >> historical average, it's likely non-recurring
126
+
127
+ 6. **Yield spread vs HIBOR** `fin_macro(endpoint="hibor")` — Is dividend income attractive vs risk-free?
128
+ - Yield spread = after-tax DY - HIBOR 3M
129
+ - ⚠️ If spread < 1.5% → deposit rates nearly as good, equity risk not compensated
130
+ - 💡 Falling HIBOR (Fed cutting) → yield spread widens → dividend stocks re-rate upward (dual catalyst: yield + valuation)
131
+ - Historical avg spread ~2.5-3.5%
132
+
133
+ 7. **Cross-reference signals**
134
+ - 💡 Combine with `/fin-hk-hsi-pulse`: if HSI PE at deep value + high-yield stocks passing all filters → strongest buy signal
135
+ - 💡 Combine with `/fin-macro` (hibor): falling HIBOR = positive for dividend spread
136
+ - 💡 AH-listed stocks: compare A-share DY (tax-free if held >1Y) vs H-share DY (taxed) → sometimes A-side is better for dividends
137
+
138
+ ## Classic HK Dividend Stocks (Reference)
139
+
140
+ | Stock | Code | Structure | Tax Rate | Typical DY | Sector |
141
+ | --------------- | -------- | --------- | -------- | ---------- | ----------- |
142
+ | China Mobile | 00941.HK | Red-chip | 10% | 6-7% | Telecom |
143
+ | CNOOC | 00883.HK | Red-chip | 10% | 7-9% | Energy |
144
+ | ICBC-H | 01398.HK | H-share | 20% | 7-8% | Bank |
145
+ | CCB-H | 00939.HK | H-share | 20% | 7-8% | Bank |
146
+ | BOC-H | 03988.HK | H-share | 20% | 6-7% | Bank |
147
+ | CLP Holdings | 00002.HK | HK-local | 0% | 4-5% | Utility |
148
+ | HK Electric | 02638.HK | HK-local | 0% | 5-6% | Utility |
149
+ | Link REIT | 00823.HK | Trust | 0% | 5-7% | REIT |
150
+ | China Shenhua-H | 01088.HK | H-share | 20% | 8-10% | Coal/Energy |
151
+ | HSBC | 00005.HK | Foreign | 0% | 4-5% | Bank |
152
+
153
+ ⚠️ This table is for reference only. Always verify current yield and safety score with live data.
154
+
155
+ ## Data Notes
156
+
157
+ - **Dividend yield (fundamental/ratios)**: yfinance, trailing 12M, ~15min delay during trading
158
+ - **HK financials (hk/income, hk/cashflow)**: tushare, semi-annual (interim Aug, final Mar-Apr), IFRS
159
+ - **Dividend history (fundamental/dividends)**: yfinance, may miss very recent declarations
160
+ - **Profile**: yfinance, static data — company structure classification requires manual interpretation
161
+ - **Tax rate classification**: approximation based on profile; edge cases exist (e.g., some red-chips have mainland subsidiaries paying H-share rates on portion of dividends)
162
+ - **Missing**: ex-dividend calendar (precise ex-date/payment date), precise company structure database (H-share/red-chip labels not in any endpoint — inferred from profile)
163
+
164
+ ## Response Guidelines
165
+
166
+ ### Number Format
167
+
168
+ - Dividend yield: 6.80% (2 decimals, always %)
169
+ - After-tax yield: 5.44% (2 decimals, explicitly labeled "tax-adjusted" or "after-tax")
170
+ - Tax rate: 20% / 10% / 0% (always state company structure reason)
171
+ - Payout ratio: 65.3% (1 decimal)
172
+ - OCF/Dividend: 1.8x (1 decimal + "x")
173
+ - Daily turnover: HK$85M / HK$1.2B (use M/B with HK$ prefix)
174
+ - Stock price: HK$72.50 (2 decimals with HK$ prefix)
175
+ - Yield spread: 2.3 ppt (percentage points)
176
+
177
+ ### Must Include
178
+
179
+ - **Tax-adjusted yield** for every stock mentioned (never show only headline yield)
180
+ - Company structure classification (H-share/red-chip/local) with tax rate
181
+ - Liquidity status (daily turnover in HKD)
182
+ - Dividend safety score (Green/Yellow/Red per factor)
183
+ - Data cutoff date
184
+ - If user invests via Stock Connect: remind them of 20% flat rate
185
+
186
+ ### Display Format
187
+
188
+ - Single stock: narrative with key metrics bolded, safety scorecard table
189
+ - Multi-stock comparison: table with columns: Stock / Code / Structure / Tax% / Headline DY / After-Tax DY / Safety Score / Liquidity
190
+ - Always sort by after-tax yield (not headline) — this is the core value proposition
191
+ - Yield trap alerts: use bold + warning language, place before any positive commentary
192
+ - End with yield spread vs HIBOR assessment and rate cycle positioning
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: fin-hk-hsi-pulse
3
+ description: "HSI valuation pulse — PE/PB percentile, equity risk premium (ERP = 1/PE - HIBOR), historical bottom analogy, regime overlay. Use when: user asks if HK market is cheap, HSI valuation, Hang Seng PE percentile, whether to bottom-fish HK. NOT for: individual HK stocks (use fin-hk-stock), A-shares (use fin-a-share), US stocks (use fin-us-equity), southbound flow (use fin-hk-stock)."
4
+ metadata:
5
+ { "openclaw": { "emoji": "\U0001F4C9", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
6
+ ---
7
+
8
+ # HSI Valuation Pulse
9
+
10
+ Quantify whether the Hang Seng Index is cheap or expensive using PE/PB percentiles, equity risk premium, and historical bottom analogies. Turns "is HK cheap?" from gut feeling into a data-anchored judgment.
11
+
12
+ ## When to Use
13
+
14
+ - "港股现在便宜吗" / "Is the Hang Seng cheap?"
15
+ - "恒指估值分位" / "HSI PE percentile"
16
+ - "恒指 PE 多少" / "HSI valuation"
17
+ - "该不该抄底港股" / "Should I bottom-fish HK?"
18
+ - "恒指什么时候这么便宜过" / "When was HSI this cheap historically?"
19
+ - "恒指成分股有多少破净" / "How many HSI constituents trade below book?"
20
+
21
+ ## When NOT to Use
22
+
23
+ - 单只港股分析 (00700.HK 财报/估值) → use `/fin-hk-stock`
24
+ - A 股指数估值 (沪深300 PE) → use `/fin-a-share`
25
+ - 美股大盘估值 (S&P 500) → use `/fin-us-equity`
26
+ - 南向资金流向 → use `/fin-hk-stock`
27
+ - 港股高息股筛选 → use `/fin-hk-dividend-harvest`
28
+ - 宏观经济数据 (GDP/CPI) → use `/fin-macro`
29
+ - 联系汇率压力 / HIBOR → use `/fin-macro`
30
+
31
+ ## Tools & Parameters
32
+
33
+ ### fin_index — HSI valuation data
34
+
35
+ | Parameter | Type | Required | Format | Default | Example |
36
+ | ---------- | ------ | -------- | ---------- | ------- | ----------- |
37
+ | symbol | string | Yes | HSI | — | HSI |
38
+ | endpoint | string | Yes | see below | — | daily_basic |
39
+ | start_date | string | No | YYYY-MM-DD | — | 2016-01-01 |
40
+ | end_date | string | No | YYYY-MM-DD | — | 2026-03-07 |
41
+ | limit | number | No | 1-5000 | 200 | 2500 |
42
+
43
+ #### Endpoints
44
+
45
+ | endpoint | Description | Example |
46
+ | ------------------ | ----------------------------- | ----------------------------------------------------------------- |
47
+ | `daily_basic` | HSI PE/PB/DY history | `fin_index(symbol="HSI", endpoint="daily_basic", limit=2500)` |
48
+ | `price/historical` | HSI price (close/open/volume) | `fin_index(symbol="HSI", endpoint="price/historical", limit=250)` |
49
+ | `constituent` | HSI constituent stocks (~82) | `fin_index(symbol="HSI", endpoint="constituent")` |
50
+
51
+ ### fin_macro — Rate environment
52
+
53
+ | endpoint | Description | Example |
54
+ | ------------- | --------------------- | ----------------------------------- |
55
+ | `hibor` | HIBOR (HKD interbank) | `fin_macro(endpoint="hibor")` |
56
+ | `treasury_us` | US Treasury yields | `fin_macro(endpoint="treasury_us")` |
57
+
58
+ ### fin_data_regime — Market regime
59
+
60
+ | Parameter | Type | Required | Example |
61
+ | --------- | ------ | -------- | ------- |
62
+ | symbol | string | Yes | HSI |
63
+ | market | string | Yes | equity |
64
+
65
+ ## HSI Valuation Analysis Pattern
66
+
67
+ 1. **Valuation snapshot** `fin_index(symbol="HSI", endpoint="daily_basic", limit=2500)` — Get PE/PB/DY history for percentile calculation
68
+ - Compute current PE/PB percentile over 10Y window
69
+ - ⚠️ If PE < 10th percentile (~8x) → "deep value" zone, historically rare
70
+ - ⚠️ If PB < 1.0x (below book) → extreme pessimism, occurred only in 2008/2016/2022 bottoms
71
+ - 💡 PE percentile alone is insufficient — must cross-check with ERP (step 3)
72
+
73
+ 2. **Price context** `fin_index(symbol="HSI", endpoint="price/historical", limit=250)` — Current price level, drawdown from peak, YTD return
74
+ - ⚠️ If HSI drawdown from 52-week high > 20% → bear market territory
75
+ - 💡 Cross-ref with step 1: deep value PE + large drawdown = historically strong buy signal (but may persist)
76
+
77
+ 3. **Equity Risk Premium (ERP)** `fin_macro(endpoint="hibor")` — HIBOR as risk-free rate proxy
78
+ - Formula: `ERP = (1/PE) - HIBOR_3M`
79
+ - HSI 10Y average ERP ~3.5-4.0%
80
+ - ⚠️ If ERP > 5% → risk compensation is generous, equity attractive vs deposits
81
+ - ⚠️ If ERP < 2% → stocks not compensating for risk, bonds may be better
82
+ - 💡 Also fetch `fin_macro(endpoint="treasury_us")` for global rate anchor; if US 10Y > 4.5%, high rates globally suppress equity valuations
83
+
84
+ 4. **Cheap-for-a-Reason check** — Diagnose WHY it's cheap before concluding "buy"
85
+ - High HIBOR (Fed tightening) → liquidity drain, valuation compression is mechanical
86
+ - Earnings downgrade cycle → low PE may be "value trap" if E is about to drop
87
+ - Geopolitical/policy risk → structural discount (not mean-reverting)
88
+ - Capital outflow (southbound selling) → sentiment-driven, more likely to revert
89
+ - ⚠️ If multiple "cheap-for-a-reason" factors active → label as "cheap but catalysts absent, may stay cheap longer"
90
+
91
+ 5. **Market regime overlay** `fin_data_regime(symbol="HSI", market="equity")` — Trend direction
92
+ - 💡 Combine regime + valuation:
93
+ - Deep value + bullish trending = **strong buy signal**
94
+ - Deep value + bearish trending = **accumulate cautiously / wait for regime flip**
95
+ - Fair value + bullish = **hold / momentum play**
96
+ - Expensive + any regime = **reduce**
97
+
98
+ 6. **Historical bottom analogy** — Compare current PE/PB to known bottoms
99
+ - Reference bottoms: 2008 GFC (PE ~7x, PB ~0.85), 2016 China scare (PE ~8.5x, PB ~0.9), 2022 Covid/regulation (PE ~8x, PB ~0.8)
100
+ - Post-bottom returns: 2008→+52% in 1Y; 2016→+36% in 1Y; 2022→+28% in 6M
101
+ - ⚠️ Past performance ≠ future results — always caveat
102
+ - 💡 If current valuation matches a historical bottom but ERP is lower than at that bottom → less attractive than headline suggests
103
+
104
+ 7. **Constituent breadth** `fin_index(symbol="HSI", endpoint="constituent")` + batch `fin_stock(endpoint="fundamental/ratios")` — How many are cheap
105
+ - Count: PE <10x, PB <1x, DY >5% among ~82 constituents
106
+ - ⚠️ If >50% of constituents PE <10x → broad-based cheapness, not just one sector dragging index
107
+ - 💡 Sector breakdown (banks/energy/tech/property) reveals whether cheapness is concentrated or dispersed
108
+
109
+ ## Signal Quick-Reference
110
+
111
+ | HSI PE (10Y ptile) | PB | ERP vs 10Y avg | Regime | Signal |
112
+ | ------------------ | ------- | -------------- | ------- | --------------------------- |
113
+ | < 10th (~8x) | < 1.0 | ERP > 5% | Any | Deep value — accumulate |
114
+ | 10-25th (~9-10x) | ~1.0 | ERP 3.5-5% | Bullish | Attractive — build position |
115
+ | 25-75th (~10-12x) | 1.0-1.2 | ERP 2-3.5% | Any | Fair value — hold |
116
+ | > 75th (~13x+) | > 1.3 | ERP < 2% | Any | Expensive — trim |
117
+
118
+ ## Data Notes
119
+
120
+ - **HSI daily_basic**: tushare, EOD update, PE/PB/DY available back to ~2010
121
+ - **HIBOR**: daily, trading days only, tushare
122
+ - **US Treasury**: daily, tushare — use 10Y yield as global rate benchmark
123
+ - **HSI constituents**: ~82 stocks, rebalanced quarterly (Mar/Jun/Sep/Dec)
124
+ - **Regime detection**: algorithmic (trend + volatility), not a forecast
125
+ - **Missing**: HSTECH index valuation (new economy benchmark), constituent weights (cannot compute cap-weighted valuation precisely)
126
+
127
+ ## Response Guidelines
128
+
129
+ ### Number Format
130
+
131
+ - HSI level: 20,156.32 (comma-separated, 2 decimals)
132
+ - PE/PB: 9.8x / 0.92x (1 decimal + "x" suffix)
133
+ - Percentile: 18th percentile (integer + "th")
134
+ - ERP: 5.4% (1 decimal)
135
+ - HIBOR: 4.80% (2 decimals)
136
+ - Dividend yield: 3.85% (2 decimals)
137
+ - Returns: +52.3% / -18.7% (always signed)
138
+
139
+ ### Must Include
140
+
141
+ - Data cutoff date ("data as of YYYY-MM-DD")
142
+ - PE AND PB percentiles (both, not just PE)
143
+ - ERP calculation with explicit formula shown
144
+ - At least one historical bottom comparison
145
+ - "Cheap-for-a-reason" diagnosis (never just say "it's cheap, buy")
146
+ - Regime label from fin_data_regime
147
+
148
+ ### Display Format
149
+
150
+ - Lead with valuation verdict (1 sentence) before diving into data
151
+ - PE band table: current vs 10Y 10th/25th/50th/75th/90th percentiles
152
+ - Historical comparison table: current vs 2008/2016/2022 bottoms (PE, PB, ERP, post-recovery return)
153
+ - Constituent breadth stats: "X of 82 stocks PE <10x, Y stocks PB <1x"
154
+ - Always end with catalyst assessment: what could make cheap become "buy"