This is a minimalistic stock ticker based on Yahoo's finance API for the MagicMirror² platform. Click here for MagicMirror² Forum Thread.
Contribution welcome.
For optimal performance on Raspberry Pi devices (especially Pi Zero, Zero 2W, and older Pi models), consider the following configuration adjustments:
For best performance:
- Use
displayMode: "none"(static display) for lowest resource usage - This completely eliminates animation overhead
If you want scrolling:
- Increase
fadeSpeedInSecondsto 5-7 seconds for smoother animations - Lower values require more frequent frame updates, which can cause stuttering on low-powered devices
- The vertical scroll mode is now optimized for continuous one-directional scrolling
I put a lot of time and effort into the creation and maintenance for this module and I'm glad so many people like it. If you also like this module and want to thank, please rate this repository with a star or donate a small amount that is worth it to you.
- Uses Yahoo Finance API to collect current
- stock values
- indexes
- cryptocurrencies
- No API Key required
- Multiple display modes
- Static
- Vertical scroll
- Horizontal scroll
- Table
- Share Portfolio value and growth summary
- Very customizable
- Easy to use
Navigate to the MagicMirror/modules directory, clone this repository, and install the dependencies:
cd ~/MagicMirror/modules
git clone https://github.com/jalibu/MMM-Jast
npm ciTo update the module to the latest version, navigate to the MMM-Jast directory and pull the latest changes from GitHub. After that, reinstall the dependencies:
cd ~/MagicMirror/modules/MMM-Jast
git pull
npm ciAdd the module configuration into the MagicMirror/config/config.js file (sample configuration):
{
module: "MMM-Jast",
position: "top_left",
config: {
currencyStyle: "code", // One of ["code", "symbol", "name"]
fadeSpeedInSeconds: 3.5,
lastUpdateFormat: "HH:mm",
maxChangeAge: 1 * 24 * 60 * 60 * 1000,
maxWidth: "100%",
numberDecimalsPercentages: 1,
numberDecimalsValues: 2,
displayMode: "vertical", // One of ["none", "vertical", "horizontal", "table", "default-table"]
showColors: true,
showCurrency: true,
showChangePercent: true,
showChangeValue: false,
showChangeValueCurrency: false,
showHiddenStocks: false,
showLastUpdate: false,
showPortfolioValue: false,
showPortfolioGrowthPercent: false,
showPortfolioGrowth: false,
showPortfolioPerformanceValue: false,
showPortfolioPerformancePercent: false,
showStockPerformanceValue: false,
showStockPerformanceValueSum: false,
showStockPerformancePercent: false,
stocksPerPage: 2, // Only relevant for display mode "table"
updateIntervalInSeconds: 300,
useGrouping: false,
virtualHorizontalMultiplier: 2,
stocks: [
{ name: 'BASF', symbol: 'BAS.DE', quantity: 10, purchasePrice: 70.4 },
{ name: 'SAP', symbol: 'SAP.DE', quantity: 15, purchasePrice: 90.3 },
{ name: 'Henkel', symbol: 'HEN3.DE', hidden: true },
{ name: 'Bitcoin', symbol: 'BTC-EUR' }
]
}
}| Option | Description |
|---|---|
currencyStyle |
Style of currency. Type: String Allowed values: "code" (EUR), "symbol" (€) or "name" (Euro)Default value: code |
displayMode |
Display mode for ticker. Type: StringAllowed Values: "none", "vertical", "horizontal", "table" or "default-table" Default value: "vertical" |
fadeSpeedInSeconds |
Animation speed for ticker. Type: NumberDefault value: 3.5 |
lastUpdateFormat |
Define dateformat, if the last update should be displayed. Type: StringDefault value: "HH:mm" |
locale |
Option to override the global/system locale for value formatting. Type: StringDefault value: undefined (system locale) |
maxChangeAge |
Maximum age of the last change to be recognized as current in milliseconds. Set to 0 to disable. Type: NumberDefault value: 1 * 24 * 60 * 60 * 1000 (24h) |
maxWidth |
CSS style to limit ticker width for vertical styles. Type: StringDefault value: "100%" |
numberDecimalsPercentages |
Number of decimals for percentages. Type: NumberDefault value: 1 |
numberDecimalsValues |
Number of decimals for stock values. Type: NumberDefault value: 2 |
showColors |
Colorize positive numbers in green, negatives in red. Type: BooleanDefault value: true |
showCurrency |
Show stock`s currency. Type: BooleanDefault value: true |
showChangePercent |
Show stocks change against last close in percent. Type: BooleanDefault value: true |
showChangeValue |
Show stocks change against last close in absolute value. Type: BooleanDefault value: false |
showChangeValueCurrency |
Show currency for change value. Type: BooleanDefault value: false |
showHiddenStocks |
Ignore the hidden property for each stock. This can be useful when you use the same set of stocks with multiple module instances. Type: BooleanDefault value: false |
showLastUpdate |
Show when the data was updated. Type: BooleanDefault value: false |
showPortfolioGrowth |
Show portfolio value growth summary. Type: BooleanDefault value: false |
showPortfolioGrowthPercent |
Show portfolio value growth summary in percent. Type: BooleanDefault value: false |
showPortfolioValue |
Show portfolio value. Type: BooleanDefault value: false |
showPortfolioPerformanceValue |
Show performance against purchase price value. Type: BooleanDefault value: false |
showPortfolioPerformancePercent |
Show performance against purchase price in percent. Type: BooleanDefault value: false |
showStockPerformanceValue |
Show performance against purchase price value. Type: BooleanDefault value: false |
showStockPerformanceValueSum |
Show performance against purchase price value in total. Type: BooleanDefault value: false |
showStockPerformancePercent |
Show performance against purchase price in percent. Type: BooleanDefault value: false |
stocksPerPage |
Specifies how many stocks are displayed per page on table display mode. Type: numberDefault value: 2 |
updateIntervalInSeconds |
Interval to refresh stock data from server. (min. 120) Type: NumberDefault value: 600 (10 min) |
useGrouping |
Add grouping to high value numbers (i.e. BTC 60,000.00 EUR). Type: BooleanDefault value: false |
virtualHorizontalMultiplier |
Virtually repeats the stocklist in horizontal display mode to avoid whitespaces. Type: NumberDefault value: 2 |
stocks |
Array of stocks to be displayed. Type: Array<Stock> (see below)Default value: Sample set |
| Field | Description |
|---|---|
symbol |
Stock's symbol/key Type: String Example value: "SAP.DE" |
name |
Optional: Stock's display name Type: String Example value: "SAP" |
hidden |
Experimental! Optional: If set to true, this stock is not shown in the ticker but it is still used for portfolio calculation. Type: Boolean Default value: false |
quantity |
Optional: To calculate portfolio value and growth Type: Number Example value: 500 |
purchasePrice |
Optional: To calculate the stock and portfolio performance Type: Number Example value: 500 |
The easiest way to get the symbol for your stock is to open finance.yahoo.com and use the search field on the top. You'll find the symbol either in the search preview or in the result page's URL (i.e. https://finance.yahoo.com/quote/BMW.DE?p=BMW.DE where BMW.DE would be the symbol).
This module is written in TypeScript and compiled with Rollup.
The source files are located in the /src directory.
Compile target files with node --run build.
Contribution for this module is welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
All notable changes to this project will be documented in the CHANGELOG.md file.



