Introduction¶
The core philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” In agent development or personal investment management, you often have to switch between different applications: Excel for recording trades, brokerage apps for checking market quotes, with little data interoperability. The shuiiiiimu/dsh-stock-portfolio plugin integrates stock portfolio management into DSH, stores data locally in SQLite, and uses the conversational interface as the primary interaction entry point, achieving integrated trade recording, profit/loss statistics, daily quote retrieval, and portfolio review.
Plugin Overview¶
- Name:
shuiiiiimu/dsh-stock-portfolio - Maintainer: shuiiiiimu
- Category: Memory
- Positioning: A DSH plugin for managing stock portfolios, supporting trade recording, profit/loss statistics, daily quotes, offline code retrieval, and portfolio review.
Core Capabilities¶
The plugin stores all data in a local SQLite database and reads/writes from the same data source.
Coverage¶
Supports A-shares (Shanghai, Shenzhen, and Beijing), HK stocks, US stocks, as well as ETFs, indices, and convertible bonds.
Three Interaction Entry Points¶
- Sidebar “Stock Portfolio”: Located above “Settings” in the right sidebar, it provides an overview, holdings details, trade management, analytics panel, and settings entry. It displays daily profit/loss and supports sorting by column headers.
- In-conversation read/write: Performed through registered Tools.
- Right sidebar “Portfolio Mentions”: Automatically expands when the code or name of a held ticker appears in the conversation, displaying the price trend and portfolio statistics.
Data and Tools¶
The plugin registers seven Tools to the session, covering read and write operations:
| Tool | Permission | Function |
|---|---|---|
stock_add_trade |
Direct write | Converts natural language into trade records |
stock_portfolio_overview |
Auto read | Holdings details, market value, unrealized/realized/daily profit/loss |
stock_symbol_detail |
Auto read | Local daily data and metrics for a single ticker, plus holding history |
stock_analysis |
Auto read | Profit/loss distribution by motive or market, ticker performance rankings |
stock_portfolio_review |
Auto read | Portfolio review and future research list |
stock_search_symbols |
Auto read | Local code index retrieval (offline) |
stock_list_trades |
Authorization required | Detailed list of individual trades |
Installation and Enablement¶
Installation requires the local absolute path of the plugin.
dsh plugin --profile web add <checkout 的绝对路径>
Typical Usage¶
Recording Trades¶
Enter directly in the conversation, for example, “I bought 100 Tencent yesterday.” If fields are missing, a card will pop up to ask for confirmation. The system automatically writes the data to local SQLite.
Querying Market Quotes¶
Directly ask about a ticker, for example, “How has Tencent been doing recently?” The system reads local SQLite to answer, without needing to query external quote APIs online.
Portfolio Review¶
Ask “How are my stocks performing?” or run the command /portfolio-review directly. The system calculates current profit/loss, volatility, and other metrics based on local data, and generates a research list for the next month.
Portfolio Mentions¶
When a held ticker code appears in the conversation (e.g., 700 or Tencent Holdings), the right sidebar automatically expands to show the corresponding price trend and statistics card.
Data Conventions and Limitations¶
- Data source: TickFlow.
- Update frequency: Updates by trading day. Since US and HK market closing times differ, the latest date is displayed at the top of the panel.
- Cost calculation: Moving weighted average; sales are transferred at amortized cost to lock in realized profit/loss. Fees are not included.
- Exchange rate: Base currency defaults to RMB, fetched once per day. No historical exchange-rate backfill; the market-value trend chart uses the current exchange rate for conversion.
- Index codes: Bare index codes can be ambiguous (e.g.,
000300), so a suffix or search is required. - Reading trade details: Requires the user to click “Agree” each time; without explicit consent, no data is returned.
- Editing/deleting trades: Can only be modified or deleted in the panel; conversation input only allows adding new trades.
Development and Debugging¶
For local development, you can run the following commands:
- Build and type check: npm run build, npm run typecheck
- Watch mode: npm run watch
- Hot reload (no DSH restart required): npm run reload
Notes¶
- This plugin is for personal reference only. The data comes from TickFlow and does not constitute any investment advice. Any actions taken are at your own risk.
- The DSH philosophy is “everything is a plugin.” This plugin is a community-maintained project and has no official affiliation with DeepSeek / High-Flyer.
- Before installation, review the source code and license (MIT).