Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>StockFishNew to Visual Studio Code? Get it now.
StockFish

StockFish

kathy

|
3 installs
| (0) | Free
Real-time A-share portfolio sidebar for VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

StockFish

中文文档

A VS Code / Cursor sidebar extension for real-time A-share quotes and portfolio P&L while you code.

Features

  • Holdings tab: positions with price, change %, holdings, cost, daily/total P&L, and footer sums
  • Watchlist tab: codes only — price, change %, day high, day low
  • Hover a row for stock code, Chinese name, and today’s high / low
  • Click column headers to sort (toggle asc / desc); Holdings and Watchlist sort independently
  • Hide individual holdings with hidden: true
  • Shortcut j → k → Enter to close the sidebar (when sidebar is visible)

Quick start

  1. Open Settings and search for stockfish, or edit settings.json.
  2. Configure stockfish.stocks (holdings) and/or stockfish.watchlist (watchlist).
  3. Click the StockFish icon in the activity bar, or run command Open Stock Panel.

Debug from source

  1. Open this repo in VS Code / Cursor.
  2. Press F5 (uses .vscode/launch.json to open the Extension Development Host with this workspace).
  3. Open the StockFish sidebar in the new window.

Configuration

stockfish.stocks (Holdings tab)

Array of stocks. Required: code (Sina quote id).

Field Type Description
code string Quote code, e.g. sh600519, sz000001
name string Display name (optional; defaults to quote name)
abbrev string Short label in the Module column (optional)
holdings number Position size (Hits); required for P&L columns
cost number Average cost per share (Base); required for total P&L
hidden boolean true = hide from the panel but keep in config

Example:

{
  "stockfish.stocks": [
    {
      "code": "sh600036",
      "name": "招商银行",
      "abbrev": "ZSYH",
      "holdings": 2000,
      "cost": 38.1
    }
  ]
}

stockfish.watchlist (Watchlist tab)

Array of quote codes only (strings). No holdings or cost needed.

{
  "stockfish.watchlist": [
    "sh600519",
    "sz300750",
    "sh601318"
  ]
}

Code prefix: Shanghai sh + 6 digits, Shenzhen sz + 6 digits (e.g. sz001896).

stockfish.display

Field Default Description
showPrice true Metric column
showChangePercent true Diff column (%)
showHoldings true Hits column (Holdings only)
showCost true Base column (Holdings only)
showDailyProfit true Day column (Holdings only)
showProfit true Total column (Holdings only)
nameAsAbbreviation true Module shows abbrev / auto abbreviation
sortBy dailyProfit Initial Holdings sort: dailyProfit, totalProfit, changePercent, none
sortDirection desc Initial sort direction: desc or asc

After the panel loads, sorting is controlled by clicking table headers until you reload the window. Watchlist defaults to sorting by change %.

stockfish.refreshIntervalSeconds

Quote refresh interval in seconds (minimum 2, default 5).

Commands

Command Description
stockfish.openStockPanel Focus StockFish sidebar
stockfish.closeStockPanel Close sidebar
stockfish.refreshStocks Refresh quotes now

P&L formulas (Holdings)

  • Day (daily P&L): (last price − previous close) × holdings
  • Total: (last price − cost) × holdings
  • Footer: sum of all Day / Total values in the list

Rows without holdings show — for profit columns.

Data source

Quotes are fetched from Sina Finance (hq.sinajs.cn). Requires network access. Non-trading hours may show stale prices.

License

See repository license if applicable.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft