@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,163 @@
1
+ ---
2
+ name: fin-hk-southbound-alpha
3
+ description: "Southbound capital alpha — daily/monthly net buy trends, accumulation signals (5-day streak, single-day spike), sector attribution, contrarian bottom-fishing indicator. Use when: user asks about southbound flow trends, mainland money into HK, Stock Connect net buy, smart money signal. NOT for: individual HK stock analysis (use fin-hk-stock), northbound flow into A-shares (use fin-a-northbound-decoder), HSI valuation (use fin-hk-hsi-pulse)."
4
+ metadata:
5
+ { "openclaw": { "emoji": "\U0001F4B0", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
6
+ ---
7
+
8
+ # Southbound Capital Alpha
9
+
10
+ Track mainland capital flowing into Hong Kong via Stock Connect. Transform southbound flow from a news headline number into an actionable investment signal with trend analysis, accumulation detection, and contrarian indicators.
11
+
12
+ ## When to Use
13
+
14
+ - "南向资金今天买了多少" / "Southbound net buy today"
15
+ - "南向资金最近趋势" / "Southbound flow trend this month"
16
+ - "内地资金在买什么港股" / "What are mainland investors buying in HK?"
17
+ - "港股通净买入排名" / "Stock Connect top net buys"
18
+ - "南向资金连续流入说明什么" / "What does consecutive southbound inflow mean?"
19
+ - "南向大量卖出后恒指走势" / "HSI performance after heavy southbound selling"
20
+
21
+ ## When NOT to Use
22
+
23
+ - 单只港股基本面分析 (00700.HK 财报) → use `/fin-hk-stock`
24
+ - 北向资金 (外资买 A 股) → use `/fin-a-northbound-decoder`
25
+ - 恒指估值分位 / 恒指便不便宜 → use `/fin-hk-hsi-pulse`
26
+ - 港股高息股筛选 → use `/fin-hk-dividend-harvest`
27
+ - 中概互联网板块分析 → use `/fin-hk-china-internet`
28
+ - A 股全市场雷达 (龙虎榜/涨停) → use `/fin-a-share-radar`
29
+ - 宏观利率 (HIBOR/Fed) → use `/fin-macro`
30
+
31
+ ## Tools & Parameters
32
+
33
+ ### fin_market — Southbound flow data
34
+
35
+ | Parameter | Type | Required | Format | Default | Example |
36
+ | ---------- | ------ | -------- | ---------- | ------- | -------------- |
37
+ | endpoint | string | Yes | see below | — | flow/ggt_daily |
38
+ | start_date | string | No | YYYY-MM-DD | — | 2026-01-01 |
39
+ | end_date | string | No | YYYY-MM-DD | — | 2026-03-07 |
40
+ | limit | number | No | 1-5000 | 200 | 60 |
41
+
42
+ #### Endpoints
43
+
44
+ | endpoint | Description | Example |
45
+ | ------------------ | ---------------------------------- | --------------------------------------------------- |
46
+ | `flow/ggt_daily` | Daily southbound net buy (HKD) | `fin_market(endpoint="flow/ggt_daily", limit=60)` |
47
+ | `flow/ggt_monthly` | Monthly southbound summary | `fin_market(endpoint="flow/ggt_monthly", limit=12)` |
48
+ | `flow/hs_const` | Stock Connect constituent universe | `fin_market(endpoint="flow/hs_const")` |
49
+
50
+ ### fin_stock — Price verification
51
+
52
+ | Parameter | Type | Required | Format | Default | Example |
53
+ | --------- | ------ | -------- | --------- | ------- | ---------------- |
54
+ | symbol | string | Yes | XXXXX.HK | — | 00700.HK |
55
+ | endpoint | string | Yes | see below | — | price/historical |
56
+ | limit | number | No | 1-5000 | 200 | 20 |
57
+
58
+ #### Endpoints
59
+
60
+ | endpoint | Description | Example |
61
+ | ------------------ | ---------------- | --------------------------------------------------------------------- |
62
+ | `price/historical` | OHLCV for stocks | `fin_stock(symbol="00700.HK", endpoint="price/historical", limit=20)` |
63
+
64
+ ### fin_index — Benchmark
65
+
66
+ | endpoint | Description | Example |
67
+ | ------------------ | --------------------- | ---------------------------------------------------------------- |
68
+ | `price/historical` | HSI price for overlay | `fin_index(symbol="HSI", endpoint="price/historical", limit=60)` |
69
+
70
+ ## Southbound Capital Analysis Pattern
71
+
72
+ 1. **Daily flow dashboard** `fin_market(endpoint="flow/ggt_daily", limit=60)` — Get last 60 trading days of southbound net buy
73
+ - Compute: 5-day / 10-day / 20-day moving average of net buy
74
+ - Compute: today's net buy vs 20-day average ratio
75
+ - ⚠️ If single-day net buy > 3x the 20-day average → "institutional surge" signal, historically precedes 2-4 week rallies
76
+ - ⚠️ If net buy > 10B HKD in a single day → "major bottom-fishing" event
77
+ - ⚠️ If 5 consecutive days net buy > 5B HKD total → "trend allocation" mode
78
+ - 💡 Distinguish between Shanghai-HK Connect and Shenzhen-HK Connect flows if available — divergence indicates sector preference (SH = financials/energy, SZ = tech/consumer)
79
+
80
+ 2. **Monthly trend** `fin_market(endpoint="flow/ggt_monthly", limit=12)` — 12-month trend context
81
+ - ⚠️ If 3+ consecutive months net inflow → structural allocation trend, not tactical
82
+ - ⚠️ If monthly flow reverses from net sell to net buy → potential inflection point
83
+ - 💡 Overlay with HSI returns (step 5): flow leads price by 1-2 weeks historically
84
+
85
+ 3. **Accumulation signal scoring** — Combine daily signals into a composite score
86
+ - **Level 1** (Mild): 3-day cumulative net buy > 0 → normal
87
+ - **Level 2** (Notable): 5-day cumulative > 10B HKD → attention
88
+ - **Level 3** (Strong): 5-day cumulative > 20B HKD + single day > 3x avg → high conviction
89
+ - **Level 4** (Extreme): 10-day cumulative > 30B HKD → rare, historically 3 times in past 3 years
90
+ - ⚠️ Level 3/4 signals: HSI median 20-day forward return historically +3.2%
91
+
92
+ 4. **Sector attribution (degraded mode)** — Infer sector flow direction
93
+ - Since `flow/ggt_top10` (individual stock net buy) is unavailable, use proxy:
94
+ - Step 4a: On days with large southbound inflow, check volume spikes in key stocks:
95
+ `fin_stock(symbol="00700.HK", endpoint="price/historical", limit=5)` — Tencent (tech)
96
+ `fin_stock(symbol="00941.HK", endpoint="price/historical", limit=5)` — China Mobile (telecom/dividend)
97
+ `fin_stock(symbol="00883.HK", endpoint="price/historical", limit=5)` — CNOOC (energy/dividend)
98
+ `fin_stock(symbol="09988.HK", endpoint="price/historical", limit=5)` — Alibaba (tech)
99
+ - ⚠️ If tech names (00700/09988/03690) volume spike on high-inflow day → "growth allocation"
100
+ - ⚠️ If dividend names (00941/00883/01398) volume spike → "defensive/yield allocation"
101
+ - 💡 Cross-ref with `/fin-hk-china-internet` for deeper sector analysis when tech inflows dominate
102
+
103
+ 5. **HSI overlay** `fin_index(symbol="HSI", endpoint="price/historical", limit=60)` — Validate flow-to-price transmission
104
+ - Compute: correlation between 5-day cumulative net buy and HSI 5-day forward return
105
+ - ⚠️ If flow positive but HSI still declining → "absorption phase", smart money buying into weakness
106
+ - ⚠️ If flow negative but HSI rising → rally on thin support, caution
107
+ - 💡 Cross-ref `/fin-hk-hsi-pulse` for valuation context: strong inflow + deep value PE = highest conviction buy signal
108
+
109
+ 6. **Contrarian indicator** — Extreme selling as bottom signal
110
+ - Historical pattern: when southbound sells consecutively for 5+ days with cumulative >10B HKD outflow, HSI 20-day forward return median +4.1% (panic selling = contrarian buy)
111
+ - ⚠️ If consecutive net sell > 5 days → flag as "contrarian opportunity" with caveats
112
+ - ⚠️ Contrarian signal invalid if selling is driven by structural change (e.g., policy shock, not just sentiment)
113
+ - 💡 Validate with `/fin-hk-hsi-pulse` ERP: panic selling + ERP > 5% = strongest contrarian signal
114
+
115
+ ## Signal Quick-Reference
116
+
117
+ | Pattern | Daily/Cumulative | Signal | Historical Forward Return |
118
+ | --------------------------------- | ---------------- | -------------------------- | ------------------------- |
119
+ | Single day > 10B HKD | Daily | Major bottom-fishing | +4.5% / 20d |
120
+ | 5-day cumulative > 20B HKD | 5-day | Strong trend allocation | +3.2% / 20d |
121
+ | Single day > 3x 20-day average | Daily vs avg | Institutional surge | +2.8% / 20d |
122
+ | 3+ months consecutive net inflow | Monthly | Structural allocation | +8-12% / 3M |
123
+ | 5+ days consecutive net sell >10B | 5-day | Contrarian buy opportunity | +4.1% / 20d |
124
+ | Flow positive + HSI declining | Mixed | Absorption phase | Monitor for breakout |
125
+
126
+ ## Data Notes
127
+
128
+ - **ggt_daily**: tushare, EOD update (available to 2026-03-05), contains total southbound net buy/sell in HKD
129
+ - **ggt_monthly**: tushare, monthly aggregation, best for trend analysis
130
+ - **ggt_top10**: individual stock net buy data — CURRENTLY UNAVAILABLE (timeout), use volume proxy instead
131
+ - **hs_const**: Connect-eligible stock list, updated semi-annually
132
+ - **Sector attribution**: degraded mode (volume proxy) — accuracy ~60-70% vs ideal (stock-level flow data)
133
+ - **Flow timing**: EOD data, not intraday — cannot capture morning vs afternoon flow shifts
134
+ - **Missing**: individual stock-level southbound net buy/sell, ETF-level southbound flow (2840.HK/3188.HK), CCASS participant-level changes
135
+
136
+ ## Response Guidelines
137
+
138
+ ### Number Format
139
+
140
+ - Net buy amount: 68.3 亿 HKD (1 decimal, always specify HKD)
141
+ - Cumulative flow: 312 亿 HKD (integer for large amounts)
142
+ - Moving average: 45.6 亿 HKD (1 decimal)
143
+ - Ratio: 3.2x (1 decimal + "x")
144
+ - Returns: +3.2% / -1.8% (always signed)
145
+ - Consecutive days: 7 个交易日 (specify trading days)
146
+
147
+ ### Must Include
148
+
149
+ - Data cutoff date ("数据截至 YYYY-MM-DD")
150
+ - Today's net buy + 5/10/20-day moving average comparison
151
+ - Signal level (1-4) based on accumulation scoring
152
+ - Sector attribution (even if degraded/proxy-based, label it as estimate)
153
+ - At least one historical analogy for context
154
+ - Caveat: southbound flow is ONE signal, not a standalone buy/sell indicator
155
+
156
+ ### Display Format
157
+
158
+ - Lead with today's headline number + signal level (1 sentence)
159
+ - Flow trend table: last 5 trading days with daily net buy + cumulative
160
+ - Moving average comparison: 5d/10d/20d MA with trend arrows
161
+ - Monthly trend: 3-month summary with HSI return overlay
162
+ - Sector attribution: pie chart description (tech X% / dividend Y% / other Z%) with proxy caveat
163
+ - End with actionable interpretation: what does this flow pattern historically predict?
@@ -0,0 +1,295 @@
1
+ ---
2
+ name: fin-hk-stock
3
+ description: "HK stock analysis — IFRS financials (hk/income, hk/balancesheet, hk/cashflow), AH premium arbitrage calculation (hk/adj_factor), southbound capital tracking (ggt_daily/ggt_monthly), liquidity trap detection, dividend tax tiers (H-share 20%/red-chip 10%), HKD peg rate transmission via HIBOR. Use when: user mentions HK codes (00700.HK/09988.HK), asks about AH premium, southbound flow, or HK-specific valuation traps. NOT for: A-shares (use fin-a-share), US stocks (use fin-us-equity), crypto (use fin-crypto), northbound capital into A-shares (use fin-a-share-radar)."
4
+ metadata:
5
+ {
6
+ "openclaw":
7
+ { "emoji": "\U0001F1ED\U0001F1F0", "requires": { "extensions": ["findoo-datahub-plugin"] } },
8
+ }
9
+ ---
10
+
11
+ # HK Stock Analysis
12
+
13
+ Use **fin_stock**, **fin_market**, **fin_macro**, **fin_ta** for Hong Kong equity research. Primary providers: tushare (HK financials, southbound flow), yfinance (quotes, ratios).
14
+
15
+ ## Symbol Format
16
+
17
+ | Market | Format | Examples |
18
+ | ----------------------- | ----------------- | ---------------------------- |
19
+ | HK Main Board | 5-digit + .HK | 00700.HK, 01398.HK, 09988.HK |
20
+ | HK GEM | 5-digit + .HK | 08083.HK |
21
+ | AH dual-listed (A-side) | 6-digit + .SH/.SZ | 601398.SH, 601318.SH |
22
+
23
+ ## Available Endpoints
24
+
25
+ ### fin_stock (HK subset)
26
+
27
+ `price/historical` (OHLCV), `hk/income` (IFRS P&L), `hk/balancesheet` (资产负债表), `hk/cashflow` (现金流量表), `hk/fina_indicator` (财务指标), `hk/basic` (基本信息), `hk/adj_factor` (复权因子), `hk/trade_cal` (交易日历), `fundamental/ratios` (PE/PB/PS), `profile` (overview), `discovery/gainers` (movers). Providers: yfinance + tushare.
28
+
29
+ | endpoint | data | use case |
30
+ | ------------------- | ----------------- | --------------------------------- |
31
+ | `hk/income` | 港股利润表 (IFRS) | 营收/利润/毛利率分析 |
32
+ | `hk/balancesheet` | 港股资产负债表 | 资产质量、杠杆分析 |
33
+ | `hk/cashflow` | 港股现金流量表 | OCF/NI 质量验证 |
34
+ | `hk/fina_indicator` | 港股财务指标 | ROE/ROA 等衍生指标 |
35
+ | `hk/basic` | 港股基本信息 | 上市状态、行业分类 |
36
+ | `hk/adj_factor` | 复权因子 | AH 溢价精确计算、长期净值对比 |
37
+ | `hk/trade_cal` | 港股交易日历 | 南向资金分析需区分交易日/非交易日 |
38
+
39
+ ### fin_market (southbound capital)
40
+
41
+ `flow/ggt_daily` (daily net buy), `flow/ggt_monthly` (月度汇总), `flow/hs_const` (Connect constituents). Provider: tushare.
42
+
43
+ ⚠️ `flow/ggt_top10` 已知超时不可用,暂勿调用。`flow/ggt_daily` 正常(最新 2026-03-05)。
44
+
45
+ 补充: `fin_market(endpoint="flow/ggt_monthly")` → 南向月度汇总,适合中长期趋势判断。
46
+
47
+ ### Auxiliary tools
48
+
49
+ - **fin_macro**: `hibor` (HKD rate, tracks Fed), `currency/price/historical` USDCNH (AH calc)
50
+ - **fin_index**: `daily_basic` (HSI valuation)
51
+ - **fin_ta**: `sma`, `rsi`, `macd`, `bbands` on any HK symbol
52
+ - **fin_data_ohlcv** / **fin_data_regime**: cached candles + regime detection
53
+
54
+ ## Analysis Patterns
55
+
56
+ ### AH Premium Arbitrage (HK core pattern)
57
+
58
+ ```
59
+ Step 1: fin_stock(symbol="601398.SH", endpoint="price/historical") -> A-share price
60
+ Step 2: fin_stock(symbol="01398.HK", endpoint="price/historical") -> H-share price
61
+ Step 3: fin_macro(endpoint="currency/price/historical", symbol="USDCNH") -> exchange rate
62
+ ```
63
+
64
+ Formula: `premium = A_price_CNY / (H_price_HKD × CNYHKD_rate) - 1`
65
+
66
+ > ⚠️ H 股以 HKD 计价(非 USD),需用 CNY/HKD 汇率。
67
+ > 获取方式: `fin_macro(currency/price/historical, symbol="USDCNH")` 和 `fin_macro(currency/price/historical, symbol="USDHKD")`,
68
+ > 然后 CNYHKD = USDHKD / USDCNH。旧公式 `A/H*USDCNH` 币种错误。
69
+
70
+ | Percentile | Signal |
71
+ | ---------- | --------------------------- |
72
+ | > 75th | Long H-share (A overvalued) |
73
+ | < 25th | Long A-share (H overvalued) |
74
+ | 25-75th | Neutral |
75
+
76
+ Common AH pairs (top 10): ICBC (601398/01398), Ping An (601318/02318), Conch Cement (600585/00914), PetroChina (601857/00857), Sinopec (600028/00386), China Life (601628/02628), CNOOC (600938/00883), BYD (002594/01211), China Shenhua (601088/01088), Bank of China (601988/03988).
77
+
78
+ Seasonal premium: Q4 "跨年行情" drives A-share sentiment → premium expansion; contracts during HK earnings season (Mar/Aug) as H-share fundamentals re-anchor. Cross-ref: `fin-a-share` for A-side analysis.
79
+
80
+ ### Southbound Capital Tracking (HK-exclusive)
81
+
82
+ ```
83
+ Step 1: fin_market(endpoint="flow/ggt_daily", limit=20) -> 20-day net buy
84
+ Step 2: fin_market(endpoint="flow/ggt_monthly") -> 月度趋势判断
85
+ Step 3: fin_market(endpoint="flow/hs_const") -> verify Connect eligibility
86
+ # NOTE: flow/ggt_top10 已超时不可用,用 ggt_daily 大额净买入替代
87
+ ```
88
+
89
+ | Pattern | Signal |
90
+ | ---------------------------------- | -------------------- |
91
+ | 5-day consecutive net buy > 5B HKD | Trend allocation |
92
+ | Single-day net buy > 10B HKD | Major bottom-fishing |
93
+ | Consecutive net sell | Short-term pressure |
94
+ | ggt_monthly 连续 3 月净流入 | 中长期趋势性配置 |
95
+ | 单日净买入突然放大 >3x 均值 | 集中性机构配置信号 |
96
+
97
+ ### Liquidity Trap Detection (HK-exclusive)
98
+
99
+ ```
100
+ fin_stock(symbol="XXXXX.HK", endpoint="price/historical", limit=20)
101
+ -> compute avg daily turnover from volume * close
102
+ ```
103
+
104
+ | Daily Turnover (HKD) | Assessment |
105
+ | -------------------- | ------------------------------------------ |
106
+ | < 10M | Liquidity trap — easy to buy, hard to exit |
107
+ | 10M - 100M | Moderate liquidity |
108
+ | > 100M | Good liquidity |
109
+
110
+ Board lot impact (HK 特色): HK uses variable board lots (e.g. Tencent 100 shares/lot at ~HKD 380 = HKD 38K minimum). Check `profile` for lot size; real minimum investment = board_lot × price. High-price stocks with large lots create de facto retail barriers.
111
+
112
+ ### HK Valuation Specifics
113
+
114
+ Dividend tax tiers (critically affects real yield):
115
+
116
+ - **H-shares** (mainland-incorporated): 20% withholding
117
+ - **Red-chips** (HK-incorporated, mainland ops): 10% withholding
118
+ - **Foreign investors**: 0%
119
+ - **Through Stock Connect (southbound)**: 20% for individuals, 10% for institutions
120
+
121
+ Valuation trap decision tree — low PE alone is insufficient:
122
+
123
+ 1. **Liquidity check**: daily turnover < 10M HKD? → EXIT (illiquid discount justified)
124
+ 2. **Cycle check**: `hk/income` → revenue declining YoY? → likely cyclical peak, PE misleading
125
+ 3. **Governance check**: `profile` → free float < 25%? → governance/manipulation risk
126
+ 4. **Policy check**: sector in recent regulatory crosshair? → political risk premium justified
127
+ 5. Only if all 4 pass → proceed with fundamental valuation using `fundamental/ratios`
128
+
129
+ ### HKD Peg Rate Transmission
130
+
131
+ ```
132
+ fin_macro(endpoint="hibor") -> HIBOR tracks US rates via peg
133
+ ```
134
+
135
+ | Fed Action | HIBOR Impact | HK Equity Impact |
136
+ | ----------------------------- | ---------------------------------- | --------------------- |
137
+ | Rate hike | HIBOR rises | Valuation compression |
138
+ | Rate cut | HIBOR falls | Valuation expansion |
139
+ | Peg pressure (7.85 weak-side) | HKMA intervention, liquidity drain | Negative |
140
+
141
+ ### Technical Analysis
142
+
143
+ ```
144
+ fin_data_ohlcv(symbol="00700.HK", market="equity", timeframe="1d")
145
+ fin_ta(symbol="00700.HK", indicator="rsi") // + macd, bbands
146
+ fin_data_regime(symbol="00700.HK", market="equity")
147
+ ```
148
+
149
+ ## HK-Specific Patterns
150
+
151
+ ### 中概互联网板块分析 (China Internet Sector)
152
+
153
+ Basket: Tencent (00700.HK), Alibaba (09988.HK), Meituan (03690.HK), JD (09618.HK), Bilibili (09626.HK).
154
+
155
+ ```
156
+ Step 1: fin_stock(symbol="00700.HK", endpoint="price/historical", limit=60) -> repeat for all 5
157
+ Step 2: fin_stock(symbol="00700.HK", endpoint="hk/income") -> compare revenue/margin across basket
158
+ Step 3: fin_data_regime(symbol="00700.HK", market="equity") -> sector regime
159
+ Step 4: fin_market(endpoint="flow/ggt_daily", limit=20) -> mainland net buy trend for this sector
160
+ ```
161
+
162
+ Equal-weighted basket return divergence from HSI > 5% = sector alpha signal. Compare `hk/income` gross margins to identify relative strength. Cross-ref: `fin-etf-fund` for ETF tracking; `fin-macro` USDCNH for ADR/HK spread.
163
+
164
+ ### 港股高股息策略 (HK Dividend Play)
165
+
166
+ ```
167
+ Step 1: fin_stock(symbol="XXXXX.HK", endpoint="fundamental/ratios") -> PE, PB, dividend yield
168
+ Step 2: fin_stock(symbol="XXXXX.HK", endpoint="hk/income") -> earnings stability check
169
+ Step 3: fin_stock(symbol="XXXXX.HK", endpoint="price/historical", limit=60) -> volume for liquidity
170
+ ```
171
+
172
+ | Factor | Threshold | Why |
173
+ | ------------------------ | -------------------- | --------------------------- |
174
+ | Dividend yield (pre-tax) | > 5% | Compensates H4 20% tax drag |
175
+ | PE | < 12x | Margin of safety |
176
+ | Daily turnover | > 50M HKD | Avoid liquidity trap |
177
+ | Earnings trend | Stable or growing 3Y | Sustainable payout |
178
+
179
+ After-tax yield = headline yield × (1 - tax_rate). H-share 6% headline = 4.8% net; red-chip 6% = 5.4% net. Always compare net yields.
180
+
181
+ ### 恒生指数估值分析 (HSI Valuation)
182
+
183
+ ```
184
+ Step 1: fin_index(symbol="HSI", endpoint="daily_basic", limit=250) -> PE/PB history
185
+ Step 2: fin_index(symbol="HSI", endpoint="price/historical", limit=250) -> price context
186
+ Step 3: fin_macro(endpoint="hibor") -> rate environment
187
+ ```
188
+
189
+ HSI PE bands (10Y): <10th (~8x) = deep value; 10-25th (~9-10x) = accumulate; 25-75th (~10-12x) = fair; >75th (~13x+) = reduce.
190
+
191
+ ### 港股午盘效应 (Lunch Break Reversal)
192
+
193
+ HK lunch break 12:00-13:00 HKT. Morning sell-off often reverses in PM session (fresh southbound flow). Use `fin_data_ohlcv(timeframe="1h")` — the 13:00-14:00 bar frequently shows reversal characteristics.
194
+
195
+ ### IPO 打新框架 (HK IPO Framework)
196
+
197
+ ```
198
+ fin_stock(symbol="XXXXX.HK", endpoint="profile") -> listing date
199
+ fin_stock(symbol="XXXXX.HK", endpoint="price/historical", limit=30) -> first 30 days
200
+ fin_market(endpoint="flow/ggt_daily", limit=5) -> southbound interest near listing date
201
+ ```
202
+
203
+ Cornerstone lock-up (typically 6 months) → selling pressure near expiry. First-day gain >10% with declining volume = early exit signal.
204
+
205
+ ## Stock Connect (港股通) Trading Guide
206
+
207
+ 港股通交易规则速查,帮助内地投资者避免常见操作失误。
208
+
209
+ ### 费用结构
210
+
211
+ | 费用项目 | 费率 | 备注 |
212
+ | -------- | -------------------------- | ------------------------- |
213
+ | 佣金 | ~0.03-0.25% | 各券商不同,最低 ~50 HKD |
214
+ | 印花税 | 0.13% | 双向收取 (2024年下调后) |
215
+ | 交易征费 | 0.00565% | 证监会征费 |
216
+ | 交易费 | 0.00231% | 联交所 |
217
+ | 结算费 | 0.002% | 最低 2 HKD,最高 100 HKD |
218
+ | 股息税 | 20% (H股个人) / 10% (红筹) | 见 HK Valuation Specifics |
219
+
220
+ **综合费率:** 单边约 0.17-0.40%,远高于 A 股 (~0.05%)。频繁交易成本显著。
221
+
222
+ ### 交易时间 (HKT)
223
+
224
+ | 时段 | 时间 | 说明 |
225
+ | ------------ | ----------- | ------------ |
226
+ | 开市前竞价 | 09:00-09:30 | 港股通不参与 |
227
+ | 上午持续交易 | 09:30-12:00 | 可交易 |
228
+ | 午间休市 | 12:00-13:00 | 不可交易 |
229
+ | 下午持续交易 | 13:00-16:00 | 可交易 |
230
+ | 收市竞价 | 16:00-16:10 | 部分券商支持 |
231
+
232
+ ⚠️ 港股通在非共同交易日不可交易(如 A 股休市但港股开市的日子)。用 `fin_stock(endpoint="hk/trade_cal")` 查询港股交易日历。
233
+
234
+ ### 结算规则
235
+
236
+ | 规则 | 说明 |
237
+ | -------------- | --------------------------------------------------- |
238
+ | 交收周期 | **T+2** (区别于 A 股 T+1) |
239
+ | 卖出可用 | T 日卖出资金 T+2 到账,但可 T 日用于买入港股 |
240
+ | 不支持当日回转 | 买入当天**不可卖出** (非 T+0) |
241
+ | 碎股处理 | 送股/拆股产生碎股只能通过碎股交易卖出,无法买入补齐 |
242
+
243
+ ### 可交易标的
244
+
245
+ ```
246
+ fin_market(endpoint="flow/hs_const") → 查询当前港股通可交易标的名单
247
+ ```
248
+
249
+ | 条件 | 说明 |
250
+ | ----------------- | ------------------------------------------------- |
251
+ | 恒生综合大型/中型 | 自动纳入 |
252
+ | A+H 股 | 自动纳入 H 股端 |
253
+ | 恒生综合小型 | 需满足市值/流动性门槛 |
254
+ | 排除类别 | 外国公司 (二次上市除外)、合订证券、仅供专业投资者 |
255
+
256
+ ⚠️ 名单每半年调整一次(3月/9月),调整前后是潜在交易机会窗口。
257
+
258
+ ### 额度与限制
259
+
260
+ | 限制 | 额度 |
261
+ | ------------ | ------------------------------------------------ |
262
+ | 每日额度 | 520 亿 RMB (沪港通+深港通各自独立) |
263
+ | 总额度 | 已取消 |
264
+ | 最小交易单位 | 1 手 (每手股数因股票而异,见 `profile` lot_size) |
265
+
266
+ ### 常见陷阱
267
+
268
+ 1. **汇率损耗**: 买入用 RMB 换 HKD (买入汇率),卖出用 HKD 换 RMB (卖出汇率),中间存在点差 (~0.1-0.3%)
269
+ 2. **碎股锁仓**: 送股后产生碎股,只能在碎股市场折价卖出
270
+ 3. **暗盘不可参与**: 港股通无法参与 IPO 暗盘交易
271
+ 4. **节假日错配**: 圣诞/复活节等港股休市但 A 股开市,或反之 → 资金闲置
272
+ 5. **红利税差异**: 不同持股类型税率差异大,影响实际收益 (见上方费用结构)
273
+
274
+ ## DataHub Gaps (HK)
275
+
276
+ | Missing Data | Ideal Source | Workaround |
277
+ | --------------------------------- | ------------ | --------------------------------------------------------------------------- |
278
+ | CCASS custody details | HKEX | `ggt_daily` 大额净买入作为大陆持仓变动代理 |
279
+ | AH premium index (HSAHP) | Wind | Manual calc: pull both A/H prices + USDCNH rate |
280
+ | Short selling data | HKEX | High volume + price drop as directional proxy |
281
+ | Hang Seng industry classification | HSIL | Use `profile` sector field as rough substitute |
282
+ | Board lot size | HKEX | Check `profile` or assume standard lots; verify minimum investment manually |
283
+ | CCASS participant changes | HKEX | Track `ggt_daily` 连续大额净买入作为机构流向代理 |
284
+
285
+ ## Data Boundaries
286
+
287
+ | Data | Frequency | Latency | Notes |
288
+ | -------------------- | -------------- | ------------------- | --------------------------------------------------------- |
289
+ | HK quotes | Intraday | ~15min delay | yfinance |
290
+ | HK IFRS financials | Semi-annual | Post-filing | tushare `hk/income`, `hk/balancesheet`, `hk/cashflow` |
291
+ | HK 复权因子 | Daily | T+1 | tushare `hk/adj_factor` (5353 records, latest 2026-03-05) |
292
+ | HK 交易日历 | — | 预生成至 2026-12-31 | tushare `hk/trade_cal` |
293
+ | Southbound flow | EOD / Monthly | Post-close | tushare `ggt_daily` + `ggt_monthly` |
294
+ | HIBOR | Daily | Trading days | tushare |
295
+ | Connect constituents | Monthly update | — | tushare |