sandypockets387 downloadsDisplay stock prices, changes, and sparkline charts in your notes with multi-stock lists and single stock charts.
Display stock prices, changes, and sparkline charts in your Obsidian notes with multiple display and sorting options.
Data can be displayed 2 ways:
As a compact table of multiple stocks with sparklines using the stock-block-list code block

Or as a larger detailed chart for a single stock using the stock-block code block

To learn how to set up each of those components, see the Usage Examples section below.
We prioritize security and transparency in this plugin:
To help verify that files within a release have not been tampered with or modified, every release includes a "fingerprint" (called a SHA256 checksum) for each file.
Think of it like a tamper-evident seal - if anyone modifies even a single character in the plugin files, the fingerprint will completely change. This lets you verify that the files you downloaded are exactly the same ones that were automatically built and released, ensuring that the code you see in the repo is the same code you receive when you download the plugin.
You can compare these SHA256 checksums against your downloaded files to ensure they haven't been modified. The checksums are also displayed directly in each release's notes for easy verification.
After downloading the plugin files from a release, you can verify their integrity using the following command in your terminal:
sha256sum main.js manifest.json styles.css
Those commands will output a SHA256 checksum for each file. You can then compare those checksums against the values listed directly in the release notes.
stock-block-list code block)Displays a table of multiple tickers with:
stock-block code block)Displays a larger chart for one symbol with:
The plugin supports two chart types for single stock displays:
To enable candlestick charts, add useCandles: true to your stock block configuration.
When enabled in settings (enabled by default), the days parameter represents trading days rather than calendar days. The plugin ensures sufficient data points for meaningful charts, even for very short periods (1-2 days)
Learn how to display a list of stocks, or a chart for a single stock.
The minimum configuration now only requires a list of stocks, which defaults to the last 30 days.
```stock-block-list
stocks: AAPL, MSFT, NVDA, SHOP, SPY
```
If you need more customization, you can use additional properties:
stocks, symbols, or tickers: Comma-separated list of stock symbols (any of these property names work)days: Number of days of historical data (default: 30, interpreted as business days if enabled in settings)width: Width of sparklines in pixels (default: 500, capped at 120 for table display)height: Height of sparklines in pixels (default: 300, capped at 40 for table display)linkStyle: How to display symbols - none, wikilink, or markdown (default: none)sparkline: Whether to show sparkline charts in the table (default: true)showTodayChange: Show today's change as separate column when days >= 2 (default: false)refreshInterval: Auto-refresh interval in minutes (optional)title: Custom title text (optional, defaults to "Stock List")description: Descriptive text shown below the title (optional)The minimum configuration now only requires a stock property. The date range defaults to the last 30 days.
```stock-block
stocks: AAPL
```
To display OHLC (Open, High, Low, Close) data as a candlestick chart, add useCandles: true:
```stock-block
stock: AAPL
useCandles: true
```
If you need more customization, you can use additional properties:
symbol, symbols, stock, stocks, ticker, or tickers: Stock symbol to display (any of these property names work)useCandles: Display as candlestick chart instead of line chart (default: false)days: Number of days of historical data (default: 30, interpreted as business days if enabled in settings)width: Width of chart in pixels (default: 500)height: Height of chart in pixels (default: 300)showAxes: Show price and date axes (default: true)refreshInterval: Auto-refresh interval in minutes (optional)showLastUpdate: Show last update timestamp and refresh controls (default: true)showTodayChange: Show today's change alongside period change when days >= 2 (default: false)title: Custom title text (optional, shows above the stock symbol and price)description: Descriptive text shown below the title (optional)The plugin automatically detects currencies based on stock exchange suffixes:
```stock-block-list
tickers: AAPL, SHOP.TO, SAP.DE, ASML.AS, 7203.T
days: 60
title: Global Diversified Portfolio
description: Stocks from US (USD), Canada (CAD), Germany (EUR), Netherlands (EUR), and Japan (JPY)
```
```stock-block
symbol: NESN.SW
days: 60
title: Nestlé S.A. (Swiss Exchange)
description: Swiss stock showing CHF currency formatting
```
Currency Detection Examples:
AAPL → USD ($)SHOP.TO → CAD (CA$)SAP.DE → EUR (€)BP.L → GBP (£)7203.T → JPY (¥)CBA.AX → AUD (A$)0700.HK → HKD (HK$)The plugin fetches real stock data from Yahoo Finance API, which provides free access to:
Features:
Supported Symbols:
The plugin automatically handles API errors and will display clear error messages if the Yahoo Finance service is temporarily unavailable.
To test the newest versions of the plugin before official releases, you can install the beta builds using the BRAT plugin.
https://github.com/sandypockets/stock-blocksThis will cause the plugin to automatically update whenever there are changes made to the main branch of this repository. If you want to pin to a specific version, then you can also do that in BRAT. To do so, look for Add Beta plugin with frozen version in the BRAT settings.
You can learn more about BRAT and how to use it in the BRAT documentation.
git clone https://github.com/sandypockets/stock-blocks.git
cd stock-blocks
npm install
# Development build with watch mode (recommended during development)
npm run dev
npm run build
Contributions are welcome! Please follow these steps:
git checkout -b feature/name-of-your-featuremain.ts and src/ files)npm run dev for development builds with watch modenpm run build to ensure production build worksSee LICENSE file for details.
This plugin is for educational and informational purposes only. Stock data is provided by Yahoo Finance and should not be used as the sole basis for investment decisions. Always consult with financial professionals and verify data with official sources before making investment decisions. If the Yahoo Finance API is unavailable, the plugin will display error messages.