StockFishA VS Code / Cursor sidebar extension for real-time A-share quotes and portfolio P&L while you code. Features
Quick start
Debug from source
Configuration
|
| 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.