Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>stocks vscodeNew to Visual Studio Code? Get it now.
stocks vscode

stocks vscode

gvim

|
11 installs
| (0) | Free
Real-time stock monitoring in VSCode status bar for A-shares, Hong Kong stocks, US stocks, and futures
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Stock Bar

VSCode Extension | A-shares | Hong Kong Stocks | Futures | Real-time Stock Data | Status Bar Updates

Stock Bar automatically refreshes stock data during trading hours and displays basic stock information in the VSCode status bar, allowing you to keep track of your stocks while using VSCode.

Stock Bar displays only pure numbers like stock prices and percentage changes by default. When you hover over them, you can view detailed information. You can also customize the display to show stock names for better identification.

image

The plugin is open source, available at: Github. Welcome to star ⭐️, submit issues or pull requests!

Commands

Open command palette with Ctrl/Cmd + Shift + P:

  • Show Stock Bar - Display Stock Bar
  • Hide Stock Bar - Hide Stock Bar (stops background data update requests)
  • Add Stock Bar - Add Stock Bar configuration

Plugin Configuration

Modify user settings to add the stock codes you want to monitor:

// Stock configuration: array
"stock-bar.stocks": [
  "sh000001", // You can directly add stock code strings
  {
    "code": "sz000001", // Or add detailed configuration
    "alias": "Ping An",
    "hold_price": 0,
    "hold_number": 0
  }
],

// Futures configuration: array
"stock-bar.futures": [
  {
    "code": "cu2409",
    "alias": "Copper",
    "hold_price": 0,
    "hold_number": -1
  }
],

// Data update interval in milliseconds
"stock-bar.updateInterval": 10000

// Color for rising stocks, defaults to system theme
"stock-bar.riseColor": ""

// Color for falling stocks, defaults to system theme
"stock-bar.fallColor": ""

// Enable qos.hk API for real-time HK/US stock quotes (requires token configuration)
"stock-bar.useQosForHkUs": false

// Token for qos.hk API to get real-time HK/US stock quotes
"stock-bar.qosHkToken": ""

Stock Configuration

Stock configuration can be either a stock code string or a detailed configuration object:

  • code: string, stock code with market prefix (see prefix explanation below)
  • alias: string, alias name, defaults to empty
  • hold_price: number, holding price, optional, defaults to 0
  • hold_number: number, holding quantity, optional, defaults to 0

When using stock code string like ["sz000001"], it's equivalent to [{"code": "sz000001", "alias": "", "hold_price": 0, "hold_number": 0}]

Futures Configuration

  • code: string, futures code, e.g., cu2409, sa2409
  • alias: string, futures alias
  • hold_price: number, holding price for long/short positions
  • hold_number: number, position size, positive for long positions, negative for short positions

Prefix Explanation

  • sh: Shanghai Stock Exchange, codes starting with 6 default to sh prefix (Shanghai Composite Index: sh000001)
  • sz: Shenzhen Stock Exchange, codes not starting with 6 default to sz prefix
  • hk: Hong Kong stocks, e.g., Alibaba HK hk09988
  • US_: US stocks, e.g., Apple US_AAPL
  • hkHSC: Hang Seng Commerce & Industry Index (HK Index)
  • hkHSCEI: Hang Seng China Enterprises Index (HK Index)
  • hkHSI: Hang Seng Index (HK Index)
  • hkHSCCI: Hang Seng China-Affiliated Corporations Index (HK Index)
  • hkHSF: Hang Seng Finance Sub-index (HK Index)
  • hkHSP: Hang Seng Properties Sub-index (HK Index)
  • hkHSU: Hang Seng Utilities Sub-index (HK Index)
  • hkGEM: S&P/HKEx GEM Index (HK Index)
  • US_DOWJONES: Dow Jones Industrial Average (US Index)
  • US_NASDAQ: NASDAQ Composite (US Index)
  • US_SP500: S&P 500 (US Index)

Changelog

CHANGELOG

Contributors

Thanks to these lovely contributors for participating in the development and maintenance of Stock Bar, making Stock Bar even better!

License

This project is open source under the MIT license. For the complete license agreement, please refer to the LICENSE file.

Source

Plugin Source: Stock Bar was originally forked from stock-watch and has since undergone significant refactoring.

Stock Data Sources:

  • Sina Finance
  • Tonghuashun (iFinD)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft