dsh-etf-flow
v0.2.0
Published
DSH 插件:会话头部显示 A 股宽基 ETF 的净流入金额(日/周/月)
Maintainers
Readme
dsh-etf-flow
A DeepSeek Harness plugin that puts an A-share ETF fund-flow badge in the conversation header: click it to see the latest day / week / month net inflow of the main broad-based ETFs.
一个 DSH 插件:在会话头部放一个 A 股 ETF 资金流标签,点开看宽基 ETF 最近一日 / 一周 / 一月的净流入金额。自带数据采集,装了就能用。
- 沪市:上交所接口(含历史)
- 深市:深交所接口(xlsx,零依赖解析;仅当日快照,历史从安装当天开始累积)
What it shows
| Period | Meaning | | --- | --- | | 今日 / 上一日 | latest trading day vs previous trading day | | 上一周 | trailing 5 trading days | | 上一月 | trailing 20 trading days |
Each row's headline number is the whole market — every ETF, not just the five broad ones. The sub-line breaks it into three numbers that add up:
申购 +122 亿 · 非宽基 -148 亿 · 宽基 -84 亿 (net -232 亿)申购 is the summed amount of the ETFs whose shares grew; 非宽基 and 宽基 split
the net between the five broad index ETFs and everything else (行业主题 / 策略因子 …).
A quiet net number often hides a large two-way flow: -232 net can be +122 in and
-354 out.
The drawer also lists four derived factors (large amount / persistence / breadth concentration / multi-index families). They are inferences from share changes — the data itself cannot prove who the buyer is.
How the data works
The plugin is self-contained — no extra scripts, no Python, no API key:
Shanghai Stock Exchange public API → daily ETF share counts
Eastmoney public quote API → latest ETF prices
↓
<DSH_HOME>/etf-flow/history.json (local history, last ~45 trading days)
↓ compute
<DSH_HOME>/etf-flow/summary.json (what the badge renders)- refreshes once on startup, then polls every 15 minutes only between 19:00 and 23:00 (the observed publication window); outside it the timer does nothing
- when the latest day is already stored it returns immediately — zero requests, zero writes
- first start backfills ~26 trading days (a few seconds); the badge shows 「资金流 初始化中」 until ready
- amounts = Σ(share change × price); shares come from the exchange, prices from a public quote API, so the numbers are deterministic and reproducible
Requirements
- DSH ≥ 0.2.1 (
dsh.bundle.patch+dsh.clientsupported) - Node ≥ 18.17 (global
fetch+AbortSignal.timeout) - outbound HTTPS to
query.sse.com.cnandpush2.eastmoney.com
Install
// <DSH_HOME>/profiles/<profile>/package.json → dsh.profile.bundles
"dsh-etf-flow"then restart DSH and refresh the page.
Optional: relocate the data directory in cordis.patch.yml:
- insert:
- id: dsh-etf-flow
name: 'dsh-etf-flow'
config:
dir: 'D:/some/dir/etf-flow'
refreshMinutes: 30Privacy & safety
- reads/writes only its own directory under
DSH_HOME - outbound calls (GET only, no credentials, no request bodies):
query.sse.com.cn— Shanghai ETF share countsfund.szse.cn— Shenzhen ETF share counts (xlsx)push2.eastmoney.com— ETF quotes
- no telemetry, no analytics
Limits
- Shenzhen funds (e.g. 159915 创业板ETF) come from a snapshot-only endpoint: no history, so their flows appear from the second trading day after install
- amounts for historical days use the latest price (an approximation, not historical NAV)
- "national-team" factors are heuristics, not facts
Disclaimer
Not investment advice. Numbers are derived from public exchange endpoints and public quote APIs and may be delayed, incomplete, or wrong. Use at your own risk.
数据来自交易所与行情公开接口,可能延迟/缺失/出错;仅供个人研究,不构成投资建议。
License
Proprietary — not open source. Free to install and use with DeepSeek Harness; copying, modifying, or redistributing is not permitted. See LICENSE.
本包为专有软件:可自由安装使用,但不允许复制、修改或再分发。源码不随包分发。
