Skip to main content

dsh-stock-watch

57Stars5Forks4Issues0Watchers

Add an A-stock watchlist monitoring popup to the top right corner of DSH Web, featuring real-time quotes, time-sharing/K-line charts, and buy/sell target price alerts, with an integrated fan-shaped AI entry for one-click generation of research and review conversations.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
JavaScript
License
MIT
Branch
main
dsh-plugindsh-plugin-marketdsh-pluginspluginstockstock-market

Install

cmdweb profile
$ dsh plugin --profile web add dsh-stock-watch

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin Awu12277/dsh-stock-watch for me: review the repository at https://github.com/Awu12277/dsh-stock-watch first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Line Pitch

Provides a collapsible, draggable A-share watchlist popup in the top-right corner of the DSH Web interface, displaying real-time stock price changes, target price triggers, intraday and daily/weekly/monthly K-lines, and integrating AI entry points like "One-Click Investment Research" and "Daily Review/Market Analysis/Limit-Up Analysis" directly into DSH conversations.

Core Capabilities

  • Provides a collapsible, draggable 📈 stock watchlist pill and expanded panel in DSH Web's top-right corner: the collapsed state shows the number of rising/falling stocks in the current group (3↑0↓), while the expanded view lists name/code, current price, change percentage, mini intraday line chart, and target price trigger markers (Buy/Sell/Wait)
  • Supports multiple watchlist groups (group name, code, buy/sell target prices); the panel's + button allows searching the entire A-share pool (~5,549 stocks) by name or code; group configuration persists in browser localStorage, with one-time migration from ~/.stocking/settings.json on first launch
  • Provides intraday view (with yellow VWAP average price line and previous close reference line, marked by A-share trading hours 09:30–11:30 / 13:00–15:00, with lunch break blank) and daily/weekly/monthly forward-adjusted K-lines (candlestick + volume bars + MA5/10/20/60 moving averages); K-lines support +/-/reset zooming, MA visibility toggles
  • Buy/Sell target prices displayed in real-time on list and detail pages; detail page click enters number input (two decimal places, empty to clear, Enter to confirm, Esc to cancel), saved immediately to localStorage with trigger marker recalculation
  • Pill automatically snaps to screen edges as a hemisphere (only showing rising/falling count); hovering over the pill triggers GSAP radial animation menu with three options:「📊 Market Analysis / 📅 Daily Review / 🚀 Limit-Up Analysis」, layout auto-adjusts based on the pill's quadrant, menu stays open when mouse is inside
  • Detail page "📈 Investment Research Report" button and radial menu click both open new DSH conversations with short keywords, with conditional system prompts injected by host side ensuring automatic execution according to predefined frameworks (A-share short-term review / 4-item market analysis / 4-item limit-up analysis / investment research + frontend design)

Technical Implementation

  • Language: JavaScript (ESM, TypeScript not enabled; index.js + client.js two source files)
  • Key Dependencies: Host side zero external dependencies (only uses node:os, node:fs/promises, node:fs, node:url built-in modules and Node native fetch); Client side reuses host React via __ModuleLoader__.require("react"); chart layer lazy-loads from CDN: [email protected] (unpkg / jsdelivr dual sources) and [email protected], automatically degrades to self-drawn SVG candles and lines when CDN unavailable
  • Architecture Pattern: dual-half host plugin. Host half registers 5 /dsh-stock-watch/* routes via ctx.inject(['webServer']) (config / stocks / quotes / kline / minute), and on apply startup copies bundled skills investment-research and frontend-design to ~/.agents/skills/ via ensureUserSkills() (skips if target exists), then injects two conditional system prompt sections with order=200 / 201 via ctx.get('systemPrompt'); Client half injects a draggable React popup in DSH Web top-right corner via ctx.slots.inject("shell.overlay", ...), relying on host's slots, connection, sessions services
  • Entry Files: Host entry index.js (apply / name = 'dsh-stock-watch', inject = ['webServer']); Client entry client.js (inject = ['slots']); mount declaration cordis.patch.yml (inserts 1 line Loader in web profile) + package.json#dsh.bundle.patch + package.json#dsh.client.platform = 'web'

Use Cases

A-share investors writing or conversing within DSH Web workflow who want to see watchlist price changes and target price alerts at any time without leaving the chat interface, and can instantly hand over ad-hoc questions like "Which stock looks good today and why", "After-market review", or "Limit-up analysis" to DSH conversations for investment research answers or post-market reviews.

Prerequisites & Compatibility

DependencyMin VersionNotes
DeepSeek Harness (DSH)Not declaredpackage.json doesn't declare engines or dshhub.compatibility.dsh; installed via dsh plugin --profile web add, depends on host services webServer / slots
Node.jsNot declaredpackage.json doesn't declare engines; source uses Node native fetch, AbortSignal.timeout(12000), node:fs/promises, fileURLToPath, recommended Node ≥18 (stable fetch and timeout versions)
PlatformCross-platformPure JS + built-in Node modules, no native dependencies; Host side connects to Tencent Finance web.ifzq.gtimg.cn on startup, Client side optionally accesses unpkg.com / cdn.jsdelivr.net
Native ModulesNoneNo node-gyp modules introduced, all dependencies are JS or pure browser scripts

Installation

dsh plugin --profile web add github:Awu12277/dsh-stock-watch

Configuration Options

This plugin has no host-side Schema configuration; watchlist, buy/sell target prices, panel position, panel size, and MA visibility are all managed through the panel UI in browser localStorage. The Host side provides two optional environment variables:

ConfigTypeDescriptionDefault
DSH_STOCK_WATCH_NO_SKILLSEnvironment VariableWhen set to 1, disables the logic that copies bundled skills to user skills directory on first startupNot set (injection enabled)
DSH_STOCK_WATCH_SKILLS_DIREnvironment VariableCustomizes skill injection target directory, overriding default ~/.agents/skills~/.agents/skills

FAQ

Q: The 📈 stock watchlist pill doesn't appear in the top-right corner after installation. What should I do?

A: Confirm the installation command includes --profile web and that dsh web was restarted after installation. package.json#dsh.client.platform is fixed to web, only the web profile scans this bundle on startup; just refreshing the browser won't reload the host page and client modules.

Q: Where does the market data come from? Is it the same as the official API?

A: Host side uses Node native fetch to directly connect to Tencent Finance public endpoints web.ifzq.gtimg.cn (minute/query and fqkline/get), sourced from the same upstream CLI project stocking's market.ts. Even if DSH deployment doesn't mount web fetch provider or sandbox blocks some networks, this plugin can still retrieve market data.

Q: How to add stocks? Where is the data stored? How to completely clear it?

A: Press + at the panel top to enter add view, search the entire A-share pool (~5,549 stocks) by name or code, press Enter to add to current group. All user configuration (groups, codes, buy/sell target prices, panel position, panel size, MA visibility) persists in browser localStorage, with keys stocking.config.v1 / stocking.pos.v1 / stocking.size.v1 / stocking.ma.v1. On first install, if ~/.stocking/settings.json is detected it auto-migrates, after which localStorage is the sole source; execute localStorage.removeItem('stocking.config.v1') in browser console then refresh to restore default groups (SSE Composite, CSI 300, Zijin Mining).

Q: How do the "One-Click Investment Research" in the top-right corner and the radial menu work? Will they leak my settings?

A: Neither exposes prompt content in messages. "Investment Research" button sends a short message 分析{公司名}(代码), radial menu sends one of three keywords: "每日复盘 / 行情分析 / 涨停分析". Full prompts are injected by host side via ctx.get('systemPrompt').section() as two conditional system prompt sections, which only expand according to the framework when user messages match "analyze a listed company" or corresponding keywords, avoiding polluting daily conversation. Note that「每日复盘」is only clickable between 15:00 and 09:00 next day; it's grayed out during trading hours with prompt "Market not closed yet".

Q: How does the target price trigger notification work? Do I need to keep the page open?

A: In detail page, click "Buy Target" / "Sell Target" to enter number input (two decimal places, empty to clear, Enter to confirm, Esc to cancel), after saving it writes back to localStorage and immediately recalculates triggers. Current price ≥ sell price marks Sell, ≤ buy price marks Buy, otherwise Wait, displayed as pill colors in list and detail. The plugin doesn't send system-level push notifications; DSH Web page must remain open.

Q: Do K-lines and radial animation require network? What happens with poor connection?

A: K-lines load [email protected] from unpkg.com and cdn.jsdelivr.net by default, radial menu loads [email protected], both CDNs tried sequentially. When CDN is unreachable it automatically degrades to self-drawn SVG (candles and lines still visible), but details like zoom interaction animation and GSAP radial expansion may be incomplete.

Q: What needs to be cleaned up after uninstall?

A: After executing dsh plugin --profile web remove dsh-stock-watch and restarting dsh web, client popup and host routes are removed together. The ~/.agents/skills/investment-research and ~/.agents/skills/frontend-design copied on first plugin startup are file-level copies and remain as ordinary files (can manually rm -rf if no longer needed); existing user skills with the same names won't be overwritten.

Q: What time periods show real-time quotes? Is non-trading hour data from yesterday?

A: Data comes from Tencent Finance minute-level API. A-share trading hours (Beijing time 09:30–11:30 / 13:00–15:00) provide minute-level lines; non-trading hours return post-close snapshots, list refreshes every 10 seconds. Intraday view timeline marks trading session periods, with lunch break 11:30–13:00 left blank.

Ease of Use

Beginner — one dsh plugin --profile web add + restart dsh web, refresh page to see the pill in top-right corner, initial watchlist configuration done entirely through panel's + and group tabs, no config file editing needed.

Known Issues & Limitations

  • Must restart dsh web after installation or update: client bundle and cordis plugin lines are scanned at startup, only refreshing browser won't reload (README.md:26)
  • Market data comes from Tencent Finance public endpoint web.ifzq.gtimg.cn: on connection failure list rows show "行情获取失败,请稍后重试", plugin doesn't cache last price, refresh retries (client.js:1660 / index.js:387)
  • Tencent Finance K-line return column order is based on [date, open, close, high, low, volume]: plugin applies self-calibration "current price vs latest price" for the last K-line, if interface column order changes again needs corresponding adjustment (index.js:329-342)
  • 「每日复盘」radial menu option only clickable between 15:00 and 09:00 next day: grayed out during trading hours with prompt "还未收盘", avoids requesting review before market closes (README.md:54)
  • Client charts and radial animation default to unpkg.com / cdn.jsdelivr.net: auto-degrade to self-drawn SVG when unreachable, K-line zooming (+/-/reset) and GSAP radial animation details may be incomplete (client.js:225-300)
  • Watchlist persistence tied to browser localStorage: not synced across browsers, devices, or incognito mode; multi-device sharing requires manual export/import of stocking.config.v1 (client.js:810-837)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/Awu12277/dsh-stock-watch)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory