Preface¶
In DSH, conducting market analysis typically involves either having the model directly call a specific data API or pasting screenshots in conversations. The former hardwires the data source into the plugin, requiring changes to the toolchain if switching brokers or using local CSV files. The latter prevents the model from seeing the real-time K-line charts you are monitoring, forcing you to repeatedly ask for “a screenshot.”
dsh-trading breaks the problem into three layers: typed ctx.marketData seams, deterministic indicator calculations, and interactive chart cards with persistent chart columns. It does not fork DSH’s core but overlays bundles on top of the official web or headless profiles. Below, we introduce what it is, what it can do, how to install it, and how to use it.
What Is This¶
dsh-trading is maintained by maddogfinance and categorized as a “networked tool” in the SkillHub plugin directory. The GitHub repository has approximately 17 stars and is licensed under MIT.
In one sentence: a trading research workbench plugin for DeepSeek Harness (dsh) — featuring data seams, deterministic indicators, and interactive K-line cards. The README notes that it is currently an early scaffold; dsh itself is in developer preview, and breaking changes may occur on both sides.
The project deliberately omits order execution or execution seams; @dsh-trading/risk-guard rejects execution-type tool names at the tools/pre-execute gate, serving as defense-in-depth rather than a structural boundary for “no execution capability.”
Core Features¶
Eight Packages, One-Way Dependencies¶
The repository is split into eight npm packages with fixed dependency directions:
@dsh-trading/market-data: Definesctx.marketDataseams and K-line/symbol type interfaces.@dsh-trading/provider-csv: Reference implementation, reads localdata/<symbol>/<timeframe>.csvfiles.@dsh-trading/provider-futu: Optional, pulls Hong Kong, US, A-share stocks, and 24/7 cryptocurrencies (e.g.,CC.BTCUSDT) via local Futu OpenD.@dsh-trading/tool-market: Read-only tools for the model (list_symbols,get_ohlcv,market_snapshot,annotate_chart,render_chart) and an indicator library.@dsh-trading/verdict: Backtest auditing,lint_strategy_code, and other evaluation harnesses; conclusions may be “NOT PROVEN.”@dsh-trading/risk-guard: Standalone package that rejects execution-type tool names.@dsh-trading/client-chart: Web chart cards, persistent chart columns, loopback channels; host-sideget_chart_viewand per-turn context injection.@dsh-trading/client-frame: Optional, chart-first shell layout (sidebar | chart column | conversation | details).
bundle/trading defaults to including six lines via cordis.patch.yml: market-data, market-data-provider, tool-market, verdict, risk-guard, and client-chart. client-frame and provider-futu must be enabled manually in the profile.
Model-Side Tools¶
market_snapshot returns a multi-period indicator regime (RSI, slow stochastics, ADX/DI, MACD, MFI, ATR, SMA/EMA, Bollinger Bands, etc.) and coarse-grained status labels in one call. get_ohlcv provides raw K-line data when structural details are needed. Indicators align with common platforms based on textbook definitions and Wilder smoothing, and session log replay can reproduce identical values.
annotate_chart marks price levels, ranges, and paths on charts, requiring provenance validation that prices lie within actual K-line windows. render_chart is used for exporting image files.
Web Chart Columns and Chart Cards¶
With @dsh-trading/client-frame enabled, dsh web becomes chart-column-first: a persistent real-time chart column on the left, conversation on the right. You can directly input symbols, switch timeframes, and pull data via loopback without involving the model. The chart column follows the conversation by default; manually changing the symbol or timeframe pins the chart column, after which model annotations are offered as Show pills to avoid overwriting your current view. get_chart_view and one-line per-turn context relay the current chart column state back to the model without needing screenshots.
Without client-frame, market_snapshot / get_ohlcv results render as interactive K-line cards in the conversation stream: volume, SMA20/50/200, period labels, and indicator windows drawn from the model-read per-bar sequence (not recalculated in the browser).
Built-in Data (CSV)¶
The CSV layout is as follows, with bar open times in ISO-8601 UTC and ascending order:
data/
AAPL/
1d.csv # header: time,open,high,low,close,volume
BTC-USDT/
1h.csv
provider-csv is approximately a hundred lines and can be replicated as a template for ClickHouse, broker APIs, or CCXT; the upstream tools remain unchanged.
Installation and Enabling¶
Requirements: Node.js >= 20. The official bundle pulls six plugins from npm (client-frame and provider-futu are optional):
dsh plugin --profile trading add @dsh-trading/bundle
In the profile’s dsh.profile.bundles, add @deepseek-ai/dsh-web-app or @deepseek-ai/dsh-headless after @deepseek-ai/dsh-base to choose the interface. Configure the model key (environment variable DEEPSEEK_API_KEY, or via the Models page in dsh web) and run in a directory containing ./data.
Optional: Enable the chart-first shell by disabling the default ui-layout and inserting the frame in the profile patch:
- id: ui-layout
disabled: true
- insert:
- id: trading-frame
name: '@dsh-trading/client-frame'
Optional: Connect to Futu OpenD real-time data. Enable websocket listening in OpenD.xml / OpenD.ini (on a different port from api_port; websocket_key_md5 is required for JS clients):
websocket_port = 33333
websocket_key_md5 = <md5 of your key>
Install the SDK matching the local OpenD version line and change the provider line in cordis.patch.yml:
npm i futu-api@10.9 # Must match the local OpenD version line
- id: market-data-provider
name: '@dsh-trading/provider-futu'
config:
host: 127.0.0.1
port: 33333 # Websocket port, not api_port (11111)
symbols:
- CC.BTCUSDT
- HK.00700
- US.MU
Install the Market Analyst preset:
DSH="${DSH_HOME:-$HOME/.dsh}"
mkdir -p "$DSH/.agent-presets" && cp -r presets/analyst "$DSH/.agent-presets/"
Select Market Analyst in the session preset menu.
For local development checkout, build first and then add the local path; each package referenced in the bundle patch must be linked alongside the bundle, or startup parsing will fail. See the “Try it with dsh” section in the README for details.
Typical Usage¶
With the examples directory and CSV data already in ./data, you can perform a trend description using headless mode:
cd examples && dsh --profile trading "pull DEMO-EQ daily candles with sma20/sma50 and describe the trend"
Check the merged profile at any time:
dsh --profile trading --dump-config
The README provides 90-second and 80-second demo videos (Playwright recordings of real Futu OpenD sessions, not mockups):
Use Cases and Notes¶
Suitable for: developers conducting read-only market research in DSH, multi-period regime analysis, and chart annotation with conversation linkage; those needing BYO data sources without modifying upstream tools.
Notes:
- For research only, not investment advice; no order execution capability.
- Plugins run with the current
dshprocess permissions; review the source code and MIT license before installation, and assess data sources and network access yourself. - Both
dshanddsh-tradingmay have breaking changes; Futufutu-apiversions must be manually aligned with OpenD. - SkillHub is an independent community directory, not officially affiliated with DeepSeek or High-Flyer.
If you are already using DSH for agent development and need a closed loop with replaceable data sources, deterministic indicators, and readable charts, dsh-trading offers an overlay path that does not require patching the core.
- Directory page: https://www.skillhub.cn/plugins/maddogfinance/dsh-trading
- GitHub: https://github.com/maddogfinance/dsh-trading