Stock Prices
Stock Prices module displaying the current Nvidia (NVDA) stock price and the change (%) since previous close.
Overview
The Stock Prices module displays information about the selected ticket (stock). The module's display is a compact 1x1 square:
Web GUI View
Information Displayed
The module presents the following information:
- Stock Current Price: The current stock price, as retrieved from yfinance.
- Change (%) Since Previous Close: The percentage change in price since the previous day's closing price.
- Formula:
((current_price - previous_close) / previous_close) * 100
- Note: The percentage change may vary across financial platforms (e.g., Google and Yahoo often display different daily percentage changes). This module replicates Yahoo Finance's calculations.
- Formula:
Usage
- Click the "Select a Module:" dropdown at the top of the web GUI and select the "Stocks" module.
- Click the green "Add Module" button to the right of the dropdown.
- Drag and drop the module to your desired position within the grid.
- Enter a valid ticker symbol in the "Enter a Ticker" field.
- Click "Save Stock Settings". If successful, a green message will confirm the settings were saved. If not, a red message will indicate the failure.
- Click "Update Display". The screen will blink (indicating a cleaning sequence) and display the updated module configuration.
Workflow
The Stock Prices module retrieves real-time financial data based on user settings stored in the database, such as ticker of choice.
-
Retrieve Settings:
The module pulls the ticker of choice from the database (StockSettings
table). -
API Request:
Throughyfinance
a request is made to get information about the stock. -
Response Handling:
The API's response is parsed to extract the current price and calculate the price difference from the current price and the previous close price for display.