Foreword¶
The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” Developers need to integrate real-time market data into agent sessions for market monitoring or decision support. dsh-tradewatcher is a Web plugin that uses the ctx.betterSidebar service to register a “Market Watch” tab in the sidebar, providing quote, watchlist, position, and market analysis features.
Core Features¶
Top Quotes and Watchlist¶
The top of the tab displays three rows of quote bars (A-share indices, international markets, and commodities), refreshing automatically every 10 seconds and pausing when the page is hidden. Hovering over each card displays the intraday chart for that day (fall back to the recent 5-day closing trend if the source is unavailable).
The watchlist supports group management (create, rename, delete/archive, and notes). When adding securities within a group, name/code search autocomplete is supported. The list displays the associated industry sector and the sector’s daily change, and calculates individual stock Alpha (stock price change - sector price change). Sorting by default order, daily change, and total market cap is supported.
Position Ledger¶
Positions are transaction-log driven and support group CRUD (delete archives) as well as buying, selling, adjusting, editing, moving, and removing securities within a group. Group and overview views show total market cap, unrealized P&L, daily P&L, and cumulative realized P&L. Each row includes unrealized P&L percentage and daily P&L percentage. Sorting by default order, market cap, position P&L, daily P&L, and position weight is supported.
A-Share Market and Rescue Signals¶
The A-Share Market page provides six major indices, advancers/decliners and turnover statistics, industry/concept sector and main capital rankings, ETF rankings, and stock/fund search detail cards.
The rescue signal tool is used to identify broad-based ETF support behavior that matches the historical behavior patterns of the national team. The panel displays the level (Strong Rescue / Suspected Rescue / Capital Anomaly / Calm), score, and attribution. The default monitoring channels are 6 broad-based ETFs (such as CSI 300 ETF), and custom channels can be added in settings. Scoring is based on six weighted factors (volume, super-large orders, pulse, persistence, volume-price divergence, resonance), with a time coefficient applied (different weights for morning session and close). In addition, the panel displays bottom position, intraday pattern, and bottom probability (historical frequency).
Technical Charts and Details¶
Clicking a watchlist item or position opens a right-side drawer displaying a fixed information header and a three-pane professional chart (main chart, volume, MACD). Candlesticks are overlaid with MA5/10/30/60, supporting mouse-wheel zoom centered on the cursor and a date-width zoom window. Buy/sell points are marked on the chart, and users can switch below to intraday, 5-day, daily/weekly/monthly/yearly K-lines.
Installation and Enablement¶
After installing via npm, run the installation script to load the plugin configuration.
npm run install:profile
After installation, the “Market Watch” tab will be visible in the DSH environment through ctx.betterSidebar.
Typical Usage¶
- View quotes: Open the Market Watch tab in the sidebar and view the three top quote bars and the hover-triggered intraday chart.
- Manage watchlist and positions: Add securities, adjust groups, or change sorting in the watchlist or positions tab.
- Analyze capital flows: Go to the A-Share Market page, view the rescue signal panel, and analyze capital flows and market sentiment.
- Support decisions: Use the read-only model tool
tradewatcher_rescueto read current signals and factor details, or export a plaintext JSON file in the session for deeper analysis.
Notes¶
- Quote nature: The data comes from delayed quotes provided by free public interfaces (non-L2). It is for monitoring reference only and does not constitute investment advice.
- Historical data limitation: Free sources do not provide historical ETF capital flow data; historical review can only start from the release date of this module.
- Data storage: Sampled data and signal events are saved in
rescue-log.json(60-day rolling). - Data source switching: When the East Money API is rate limited, it automatically switches to the Tencent backup source (some features such as capital flow have no alternative).
Summary¶
This plugin provides DSH users with an integrated market monitoring tool. Through the sidebar and read-only toolchain, it connects quote data with agent analysis capabilities, making it suitable for developers who need real-time monitoring of market dynamics.