A-share and US stock trading toolkit for DSH agents: realtime quotes, OHLCV klines, ADX three-state regime signals and simple backtest previews via EastMoney. Read-only, never places orders.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:kentleenot/dsh-trading-toolkit
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
A-share + US stock trading toolkit for DeepSeek Harness agents: 行情查询(A股+美股)、ADX 三状态信号、简易回测预览。只读设计——永不下单、不触碰任何交易凭据。
Tools
| 工具 | 说明 |
|---|---|
market_quote |
股票实时行情,自动识别 A股/美股:6位代码(600519)、前缀代码(sh600519)、中文名(贵州茅台)、美股 ticker(AAPL/NVDA)、指数(上证指数/深证成指/创业板指/科创50/沪深300)。数据源:东方财富,国内直连免 Key |
kline_history |
历史 OHLCV K线:A股/美股,周期 1m/5m/15m/30m/60m/1d/1w/1M,复权 0/1/2,最多 1000 根,输出可直接喂给 regime_signal |
regime_signal |
ADX 三状态市场分类:trend(趋势)/ oscillating(震荡)/ noise(噪声),含多空方向与 200-EMA 偏向。纯计算 |
backtest_run |
基于跨状态规则的简易多空回测(总收益/最大回撤/胜率/交易次数)。教育用途预览,非生产级回测 |
安装
dsh plugin --profile web add github:kentleenot/dsh-trading-toolkit
(web 是 profile 名,可替换为你自己的 profile;该命令会在指定 profile 中安装本插件。)
然后将插件加入你的 DeepSeek Harness 组合配置(参见 harness 第三方插件文档)。
用法示例(agent 可调用)
market_quote(symbol: "600519") # A股:贵州茅台
market_quote(symbol: "贵州茅台") # A股:中文名搜索
market_quote(symbol: "000001") # A股:上证指数
market_quote(symbol: "AAPL") # 美股:苹果
market_quote(symbol: "NVDA") # 美股:英伟达(未知 ticker 自动探测市场)
market_quote(symbol: "US:AAPL") # 强制美股
market_quote(symbol: "CN:600519") # 强制 A股
kline_history(symbol: "600519", period: "1d", limit: 120) # 贵州茅台日K
kline_history(symbol: "AAPL", period: "60m", limit: 48) # 苹果60分钟K
kline_history(symbol: "贵州茅台", period: "1w", limit: 30) # 中文名周K
regime_signal(candles: [[high, low, close], ...])
backtest_run(candles: [[high, low, close], ...], feePct: 0.05)
自动路由规则
- 6 位数字 /
sh|sz|bj前缀 / 中文名 → A股 - 纯字母 ticker(AAPL、NVDA、PLTR)→ 美股
US:/CN:前缀 → 强制指定市场- 常见美股 ticker(AAPL/MSFT/NVDA/TSLA/META/AMZN/GOOGL/HOOD/AMD/NFLX/BRK/JPM/KO/DIS/BA)走内置映射;未知 ticker 自动探测 NASDAQ/NYSE/AMEX
为什么做这个
本插件把作者实盘策略栈(PrinciplesV2 —— ADX 驱动的三状态自适应策略)以只读、教学形式开放。状态分类沿用生产环境相同的阈值:
trend:ADX >= 25,方向由 +DI/-DI 交叉决定,200-EMA 偏向覆盖oscillating:15 <= ADX < 25noise:ADX < 15
行情数据源用东方财富公开接口:国内直连、无需代理、无需 API Key、免费,同时覆盖沪深与美股。
开发
npm test # node --test test/
node test/smoke-market.mjs # 行情网络冒烟测试(A股+美股)
相关阅读
- 作者博客:libuyan.top —— 量化交易策略实盘复盘(PrinciplesV2)、AI 与能源交叉分析、独立开发记录
- 策略架构:PrinciplesV2 三状态自适应策略 设计笔记
License
MIT
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 37685
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37029
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
superdesigndev/treg★ 8322
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 5899
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
sixtysevenlf/dsh-blender-plugin★ 2178
Lets a DSH agent drive a local Blender over a direct TCP channel with 15 tools: viewport frames, custom-angle renders, Python execution, headless and job offload, transaction rollback, and a planning layer of 228 ops across 34 families.
helloHub1212/dsh-windows-mcp★ 1612
Bridges the CursorTouch/Windows-MCP desktop automation server into DSH through the official MCP client bridge, registering its screenshot, UI tree snapshot, mouse and keyboard input, clipboard, process and registry tools as mcp__windows__* tools for the model, and adds a windows_mcp_doctor diagnostic tool. Computer Use is off by default and is switched on from the plugin panel.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.