Market Monitor · 市场监控
中文说明 · English
中文说明
在 VS Code 中查看全球指数、美股和港股自选、历史走势与目标价提醒。活动栏快速浏览行情,状态栏持续显示你关注的标的,也可以打开完整卡片面板。
支持 Windows、macOS、Linux 桌面版 VS Code 1.95 及以上版本。默认直连公开 HTTPS 行情源,无需账户、API 密钥或另外启动行情服务。
安装与开始使用
在扩展视图搜索 @id:hkle.market-monitor-vscode,安装 Market Monitor(发布者 hkle)。也可运行:
code --install-extension hkle.market-monitor-vscode
点击左侧活动栏的 Market Monitor 图标,查看指数和个股行情。
点击「打开完整监控面板」,或从命令面板运行 Market Monitor: 打开市场监控。
在面板右上角「设置」中管理自选、别名、顺序和主题;在「个股」页添加美股或港股代码,例如 AAPL、0700.HK。
主要功能
| 功能 |
使用方式 |
| 指数与个股自选 |
18 项市场指标目录;支持美股、港股代码添加,提供美股七姐妹推荐 |
| 完整监控面板 |
指数 / 个股页签,卡片报价、涨跌、源时间和偏旧提示;亮色、暗色或跟随系统 |
| 活动栏与状态栏 |
侧栏显示行情摘要,红涨绿跌;勾选每项左侧复选框,即可在底部状态栏显示报价 |
| 自动刷新 |
每轮请求结束后等待 60 秒再刷新,面板显示逐秒倒计时;支持手动刷新 |
| 历史走势 |
点击卡片走势图标,查看 1 月、3 月、6 月、1 年曲线和逐日列表,支持本地历史缓存 |
| 目标价提醒 |
点击「+提醒」,设置严格大于 / 小于的目标价;卡片显示价差,触发时发送 VS Code 通知 |
| 本地保存 |
自选、别名、排序、主题、状态栏选择、缓存和提醒保存在扩展存储中 |
侧栏中的指数和个股均可独立勾选到状态栏,取消勾选立即隐藏,全部取消可清空状态栏。已保存的选择会在重启后恢复,显示顺序跟随各自的自选顺序。
数据来源与口径
默认公开源包括腾讯、新浪、Yahoo Finance、Cboe、CNN、Alternative.me、CoinLore 和 Currency API;不同标的和历史区间使用的来源可能不同,以界面显示为准。来源可用性受网络、交易时段和上游接口影响,刷新频率不代表上游报价的更新频率。
- VIX 为现货指数;「纳斯达克 100 期货」为 NQ 连续期货,与纳斯达克 100 现货点位不同。
- 30 年美债显示收益率,数值带
%;不使用债券期货价格替代。
- CNN 与加密市场恐惧贪婪指标的变化以点计;普通行情涨跌以百分比显示。
- 美股与港股保留 USD / HKD 单位;USDT、USDC 使用各自的 CNY 价格,日度参考明确标注非实时。
- 每条报价保留来源时间。请求失败或只返回部分标的时,保留已有报价及原时间;不会以演示值补齐,也不会将旧报价标为刚刚更新。
价格提醒
提醒在最新有效报价严格大于上限或小于下限时触发一次;报价回到条件外后重新布防。演示、重复、较旧源时间或过期报价不触发:普通报价超过 15 分钟、情绪指标及日度参考超过 36 小时后不触发。
关闭监控面板后,扩展仍会按轮询周期检查;退出 VS Code 后停止。离线、系统休眠或两次检查之间的短暂穿越可能错过。行情与提醒供信息参考,不构成投资建议。
设置与命令
在 VS Code 设置中搜索 marketMonitor:
| 设置 |
默认值 |
说明 |
marketMonitor.dataSource |
public |
直连公开源;设为 api 可使用自定义行情服务 |
marketMonitor.apiUrl |
http://127.0.0.1:8787 |
仅 api 模式使用;公网服务使用 HTTPS,本地或私有网络可使用 HTTP |
marketMonitor.statusBarItems |
3 |
首次默认勾选前几个指数,范围 0–12;逐项勾选后以已保存选择为准 |
marketMonitor.notifications |
true |
启停本机价格通知;关闭不消耗提醒触发状态 |
命令面板提供:
Market Monitor: 打开市场监控
Market Monitor: 刷新行情
Market Monitor: 行情来源与状态栏设置
存储、网络与兼容性
自选和提醒保存在本地,不与 Android 或其他设备自动同步。扩展不接入券商账户、不提供交易操作,也不需要券商凭据。公开行情模式直接连接上游源;自定义 API 模式将请求发送至你配置的行情服务。
浏览器版 vscode.dev 暂不支持。在 Remote SSH / 容器窗口中,网络请求与存储位于扩展宿主所在环境。Android 桌面小组件属于手机功能;VS Code 使用活动栏和状态栏展示行情。
源码开发与本地安装
在项目仓库根目录执行(Node.js 22+):
npm ci
npm run check
npm test
npm run package:vscode
生成 output/market-monitor-vscode-0.2.1.vsix。从 VS Code 的「扩展:从 VSIX 安装」选择该文件,或执行:
code --install-extension output/market-monitor-vscode-0.2.1.vsix --force
正式扩展标识为 hkle.market-monitor-vscode。早期本地包 market-monitor-local.market-monitor-vscode 使用独立的扩展存储,首次改装正式包时需要重新配置自选与提醒。
问题反馈请提交至 GitHub Issues,附上 VS Code 版本、扩展版本、标的代码和可复现步骤。
English
Monitor global market indicators, US and Hong Kong stock watchlists, historical charts and target price alerts in VS Code. Browse quotes in the Activity Bar sidebar, keep selected instruments in the status bar, or open the full card dashboard. The extension shares its dashboard and market core with the Market Monitor Android app.
Supports VS Code 1.95 or later on Windows, macOS and Linux desktop. By default, it connects directly to public HTTPS market data sources. No account, API key or separate market data service is required. The extension interface currently uses Chinese; the instructions below include the corresponding Chinese labels.
Installation and quick start
Search Extensions for @id:hkle.market-monitor-vscode and install Market Monitor by hkle, or run:
code --install-extension hkle.market-monitor-vscode
Click Market Monitor in the Activity Bar to view market indicators and stocks.
Click 打开完整监控面板 (Open full dashboard), or run Market Monitor: 打开市场监控 from the Command Palette.
Use 设置 (Settings) at the top right of the dashboard to manage watchlists, aliases, ordering and themes. Open 个股 (Stocks) to add US or Hong Kong symbols such as AAPL and 0700.HK.
Features
| Feature |
How it works |
| Market indicators and stock watchlists |
A catalog of 18 market indicators; add US and Hong Kong stock symbols, with suggestions for the Magnificent Seven US stocks |
| Full dashboard |
Separate indicator and stock tabs; quote cards show changes, source timestamps and stale data indicators; light, dark and system themes |
| Sidebar and status bar |
Browse quote summaries in the sidebar; red indicates gains and green indicates losses; check the box beside an instrument to show it in the status bar |
| Automatic refresh |
Waits 60 seconds after each request cycle finishes, with a per-second countdown in the dashboard; manual refresh is also available |
| Historical charts |
Click a card's chart icon for 1-month, 3-month, 6-month and 1-year charts and daily records, with a local history cache |
| Target price alerts |
Click +提醒 (Add alert) to set a strictly above or below threshold; cards show the price gap and triggered alerts appear as VS Code notifications |
| Local persistence |
Watchlists, aliases, ordering, themes, status bar selections, caches and alert rules are saved in extension storage |
Indicators and stocks can be selected independently for the status bar. Unchecking an item hides it immediately; unchecking all items clears the status bar quotes. Saved selections survive restarts and follow the order of their respective watchlists.
Data sources and instrument definitions
Default public sources include Tencent, Sina, Yahoo Finance, Cboe, CNN, Alternative.me, CoinLore and Currency API. Sources can differ by instrument and historical range; refer to the source shown in the interface. Availability depends on network access, trading sessions and upstream services. The extension's refresh interval does not indicate how frequently upstream quotes change.
- VIX is the spot index. Nasdaq 100 futures use the continuous NQ futures contract, whose level differs from the spot Nasdaq 100 index.
- The 30-year US Treasury value is a yield, displayed with
%; bond futures prices are not used as a substitute.
- Changes in CNN and crypto Fear & Greed indicators are measured in points; ordinary quote changes are displayed as percentages.
- US and Hong Kong stocks retain their USD and HKD units. USDT and USDC use their own CNY prices; daily references are explicitly labeled as non-real-time.
- Every quote retains its source timestamp. If a request fails or returns only some instruments, existing quotes and their original timestamps are retained. Missing data is not replaced with demo values, and old quotes are not labeled as freshly updated.
Price alerts
An alert triggers once when the latest valid quote is strictly above its upper threshold or strictly below its lower threshold. It rearms after the quote moves back outside the trigger condition. Demo quotes, repeated observations, older source timestamps and stale quotes do not trigger alerts. Ordinary quotes become ineligible after 15 minutes; sentiment indicators and daily references become ineligible after 36 hours.
Checks continue on the polling cycle after the dashboard closes, but stop when VS Code exits. Offline periods, system sleep or a brief threshold crossing between checks may result in a missed alert. Quotes and alerts are for information only and do not constitute investment advice.
Settings and commands
Search VS Code Settings for marketMonitor:
| Setting |
Default |
Description |
marketMonitor.dataSource |
public |
Connect directly to public sources; choose api to use a custom market data service |
marketMonitor.apiUrl |
http://127.0.0.1:8787 |
Used only in api mode; use HTTPS for public services; HTTP is supported for local or private networks |
marketMonitor.statusBarItems |
3 |
Number of initial indicator selections, from 0 to 12; once individual checkboxes are used, saved selections take precedence |
marketMonitor.notifications |
true |
Enable or disable local price notifications; disabling them does not consume an alert's trigger state |
The Command Palette provides these commands. Search for the Chinese command titles shown below:
| Command |
Meaning |
Market Monitor: 打开市场监控 |
Open the market dashboard |
Market Monitor: 刷新行情 |
Refresh market quotes |
Market Monitor: 行情来源与状态栏设置 |
Configure data sources and the status bar |
Storage, networking and compatibility
Watchlists and alerts are stored locally and do not automatically sync with Android or other devices. The extension does not connect to brokerage accounts, perform trades or require broker credentials. Public data mode connects directly to upstream sources; custom API mode sends requests to the market data service you configure.
The browser version at vscode.dev is not currently supported. In Remote SSH or container windows, network requests and storage belong to the environment running the extension host. Android home screen widgets are phone features; the VS Code extension displays quotes through its sidebar and status bar.
Source development and local installation
Run the following from the repository root with Node.js 22 or later:
npm ci
npm run check
npm test
npm run package:vscode
This produces output/market-monitor-vscode-0.2.1.vsix. Use Extensions: Install from VSIX... in VS Code, or run:
code --install-extension output/market-monitor-vscode-0.2.1.vsix --force
The published extension ID is hkle.market-monitor-vscode. Early local packages used market-monitor-local.market-monitor-vscode, which has separate extension storage. When switching from that early package, configure watchlists and alerts again.
Report issues through GitHub Issues. Include your VS Code version, extension version, instrument symbol and steps to reproduce the problem.