[Feature] get_southbound_flow: tool surface for the only live Stock-Connect net-flow signal (Eastmoney datacenter primary, HKEX official fallback; tushare southbound fields have drifted to cumulative stock)
Author: shadowinlifeCreated Sep 18, 2026Updated Sep 18, 2026
Problem or Motivation:
Southbound (mainland → HK) is the half of Stock Connect that still has live official net-flow data — and Vibe-Trading has no tool for it.
get_northbound_flowcovers northbound only. Since the 2024-08-30 HKEX disclosure reform, northbound daily net buy is no longer published at all (see #1481); the only live net-flow signal in Stock Connect today is southbound, which HKEX still discloses daily (Buy/Sell Turnover per channel).- The
hk-connect-flowskill already carries a full southbound methodology (signal framework, composite scoring, sector patterns), but its Data Access section can only point southbound users at hand-writtenpro.moneyflow_hsgt(...)code — there is no structured, throttled, envelope-standard tool surface for it. - The tushare route the skill suggests is itself broken for daily flows:
moneyflow_hsgt's southbound fields (ggt_ss/ggt_sz/south_money) now carry cumulative net-bought stock, not daily flow. Verified 2026-09-18: tushareggt_ss=32165.59equals Eastmoney's 历史累计净买额3.216559万亿 HKD exactly, and the value moves ~0.4% (coefficient of variation) across a 6-week window — it is a stock, not a flow.
Proposed Solution:
Add get_southbound_flow, mirroring get_northbound_flow's envelope and throttling discipline:
- Primary — Eastmoney datacenter
RPT_MUTUAL_DEAL_HISTORY(MUTUAL_TYPE="002"港股通沪 /"004"港股通深) through the shared throttled Eastmoney client:NET_DEAL_AMT(daily net buy),BUY_AMT/SELL_AMT,ACCUM_DEAL_AMT(cumulative), unit 亿 HKD. Cross-verified against HKEX official daily statistics to the cent on three anchor days (2026-09-15/16/17; e.g. 09-17 港股通沪 net25.0239亿== HKEX SSE Southbound Buy26,387.65M− Sell23,885.26M=2,502.39M HKD). - Fallback — HKEX official Stock Connect Daily Statistics report (
www.hkex.com.hk/eng/csm/DailyStat/data_tab_daily_<date>e.js, keyless): latest available trading day, net = Buy Turnover − Sell Turnover per channel (million HKD, converted to the envelope unit), single-day snapshot with a warning. - No tushare path for daily flow (field semantics drifted to cumulative stock, documented above); the envelope
notesays so, keeping the honest-labeling principle from #1481. - Envelope:
{unit: "100M HKD", lookback_days, realtime: {shanghai_connect, shenzhen_connect, total}, history: [{trade_date, shanghai_connect, shenzhen_connect, total}]}— same shape as northbound for symmetric analysis;realtime= latest available trading day (southbound daily figures land after close). hk-connect-flowSKILL.md Data Access section updated to reference the tool (methodology unchanged — no duplication).
Area: Data Sources
Alternatives Considered:
- tushare
moneyflow_hsgtsouthbound fields — rejected: now cumulative stock (evidence above), would spread mislabeled semantics. - akshare
stock_hsgt_hist_em— works (it is how the EM↔HKEX cross-check was done) but hits the same Eastmoney datacenter endpoint; the tool layer's convention is direct calls through the shared throttled client (per-IP ban-risk discipline), not the akshare high-level wrapper. - Eastmoney
kamtrealtime (n2s channels) — rejected: the realtime payload's southbounddayNetAmtInreturns the quota ceiling (4200000 ==dayAmtThreshold), a placeholder, not a flow. - HKEX as primary — the official report is per-day (N requests for an N-day window); Eastmoney serves the whole window in one throttled call per channel, so HKEX is the fallback instead.
Contribution:
- I'm willing to submit a PR for this feature
Source: HKUDS/Vibe-Trading