huyang218/dsh-plugins--packages-astock0

dsh-plugin-astock

A-share (Chinese stock market) data plugin for DeepSeek Harness: 10 tools covering quotes, K-lines and technical indicators for one stock, whole-market snapshots and daily bars for screening, plus financial statements, money flow and convertible bonds. Five tools work with no credentials; the rest need a Tushare Pro token through dsh-plugin-tushare.

包名
dsh-plugin-astock
版本
0.1.0
许可证
MIT
最近更新
2026年8月18日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:huyang218/dsh-plugins#efa02c42cd65f80b544659dfd6dbd00b6f293d41&path:packages/astock

dsh-plugin-astock

English | 中文

A-share (Chinese stock market) data tools for DeepSeek Harness.

Quotes, K-lines and technical indicators for a single stock, plus whole-market batch tools for screening. Data comes from EastMoney's public endpoints; a Tushare Pro token unlocks fundamentals and market-wide history.

Install

dsh plugin --profile web add dsh-plugin-astock

That alone gives you every free tool. The Tushare-backed tools appear once the shared provider is installed and holds a token:

dsh plugin --profile web add dsh-plugin-tushare
- id: tushare
  config:
    token: 'your-tushare-token'

The token lives on the provider, not here, so every finance plugin shares one token and one quota. See dsh-plugin-tushare for what Tushare charges for and what a permission failure tells the agent.

Tools

Free tools work with no credentials at all. The rest need a Tushare Pro token, and each says so in its own description — so the model can pick a free tool when one will do, and tell you exactly what is missing when one will not.

ToolCostWhat it doesFree fallback
astock_quotefreeRealtime quote for one stock
astock_datafreeK-lines: daily/weekly/monthly/intraday, adjustable
astock_indicatorsfreeK-lines + MA/MACD/RSI/KDJ/BOLL/OBV/WR/ATR/DMI in one call
astock_searchfreeFind stocks by code, name or pinyin
astock_market_quotesfreeRealtime snapshot of every listed stock
astock_fundamentalsTushareDaily valuation: PE, PE-TTM, PB, PS, dividend yield, capsastock_quote has PE and caps only
astock_market_barsTushareDaily bars for every stock over a trailing windowastock_data, one stock at a time
astock_financialsTushareIncome statement, balance sheet, cash flow, key ratios by periodnone
astock_moneyflowTusharePer-stock flow by order size, Stock Connect flows, 龙虎榜none
astock_convertible_bondsTushareEvery convertible bond with conversion value and premiumnone

Tushare gates interfaces by account points, so a valid token still may not reach all of them. A refusal comes back as a permission error that names the requirement — the plugin passes it through rather than treating the data as merely missing, and the model is told to report it instead of substituting another source.

Screening needs Code Mode

The two astock_market_* tools answer with a whole-market dataset as their canonical value and render only a summary — thousands of rows must never enter the model's context as text. The data is therefore reachable only from a run_code program:

const { codes, rows, fields, tradeDates } = await tools.astock_market_bars({
  endDate: '20260814', days: 40,
})
// rows[i] packs every bar of codes[i]: bars joined by ";", fields joined by ","

Run these under an agent preset that enables Code Mode (the shipped code preset). Under native tool calls the summary is all the model sees, and a screen built on guesses is worse than no screen at all.

Scanning happens inside the tool, so cost is O(trading days), not O(stocks): one whole-market window of 40 days is ~40 requests and a couple of seconds, where fetching stock by stock is thousands of requests and gets throttled.

Notes on the data

  • Bars from astock_market_bars are unadjusted (不复权).
  • Missing metrics are absent keys, never 0 or NaN — providers spell absence as '-' (EastMoney) or null (Tushare).
  • When EastMoney's realtime market list is unavailable the snapshot falls back to the delayed host and sets delayed: true; a screen can then say so.

License

MIT