Visually track any financial asset on a Raspberry-Pi Zero W (2) and a supported display.
Report Bug
·
Request Feature
Table of Contents
Easily monitor any financial asset using a Raspberry-Pi Zero W (2) and an e-ink display. This project supports any financial asset available on Yahoo Finance, and can be configured to display a single asset, or multiple assets at the same time.
Key features:
- Monitor any single or multiple asset(s) available on Yahoo Finance
- Set a refresh delay to check for price updates
- Show a line or candlestick chart
- Screen safe feature to fully refresh an e-ink display every 24 hours
- Easily configurable via config.yml file
- Easily add a screen implementation if your display is currently unsupported
To run this project, follow the steps below.
The first step is to setup your raspberry pi and install the necessary dependancies. Please follow the below steps:
- Flash your rasberry-pi with the latest stable Raspberry Pi OS Lite. You must configure the image with your WiFi details, and enable SSH.
- SSH into your raspberry-pi
- Enable the SPI interface by running the command:
This will launch the raspi-config utility. Enter “Interfacing Options”. Highlight the “SPI” option and toggle it on.
sudo raspi-config
- Install the necessary dependancies:
sudo apt update sudo apt install git-all python3-pip python3-dev python3-pandas python3-pil python3-numpy
In order to use waveshare e-ink displays, you must install the necessary drivers. To do this, please follow the steps below:
- Clone the driver repository:
git clone https://github.com/waveshareteam/e-Paper ~/e-Paper
- Install the necessary drivers:
pip3 install ~/e-Paper/RaspberryPi_JetsonNano/python/
To run the project, clone the repository and run the main.py
file. All configuration is handled within the config.yml
file. Please see Examples for configuration examples.
- Clone the repository:
git clone https://github.com/TomMcKenna1/financial-asset-monitor
- Install project dependancies:
cd financial-asset-monitor
pip3 install -r requirements.txt
- Run the
main.py
file:
python3 main.py
The following configuration options are currently supported:
- display - Contains all options regarding the display used:
- id:
str
- The ID of the display (REQUIRED) - flipped:
bool
- The orientation of the screen (OPTIONAL)
- id:
- assets - Contains all options regarding the assets displayed:
- ticker:
str
- The ticker of the asset as seen on Yahoo Finance (REQUIRED) - name:
str
- The name of the asset (OPTIONAL)
- ticker:
- chart - Contains all options regarding the charts displayed:
- candles:
bool
- Enable or disable candle sticks (OPTIONAL) - font:
str
- The path of the font used (OPTIONAL) - font_variant:
str
- The font variant (OPTIONAL) - font_size:
int
- The size of the font (OPTIONAL)
- candles:
- refresh_delay:
int
- The number of seconds between refreshing assets (REQUIRED) - screen_safe_interval:
int
- The number of seconds between full refreshing the screen. This option is useful when dealing with e-ink displays that require full refreshing every so often. (OPTIONAL)
Display Bitcoin/USD fullscreen with a candle chart:
display:
id: "waveshare_3in52" # Enter your display implementation
assets:
- ticker: "BTC-USD"
name: "BTC"
chart:
candles: true
font_size: 30
refresh_delay: 180
screen_safe_interval: 86400 # 24 hours
Display Meta, Apple, Amazon and Google stocks each with their respective line chart:
display:
id: "waveshare_3in52" # Enter your display implementation
assets:
- ticker: "META"
- ticker: "AAPL"
- ticker: "AMZN"
- ticker: "GOOG"
chart:
font_size: 30
refresh_delay: 180
screen_safe_interval: 86400 # 24 hours
If your display is currently not supported, it is relatively easy to add a display implementation to the asset tracker.
Please follow the steps below:
- Navigate to the displays directory within the asset tracker:
cd asset_tracker/displays
- Create a new python file under whatever name you want:
touch YOUR-NAME-HERE.py
- Within this python file, import both the base Display and the DisplayFactory classes:
from .base import Display from .display_factory import DisplayFactory
- In the same python file, create a class that inherits from the Display class. You must decorate this class with the DisplayFactory.register method:
@DisplayFactory.register("YOUR-DISPLAY-ID") class YOUR-DISPLAY(Display): pass
- This class must contain all function implementations defined in the base Display class.
- Support different time series (currently only supports monthly)
See the open issues for a full list of proposed features (and known issues).
Any contributions you make are greatly appreciated; I try to promptly check all of them!
If you have a suggestion that would improve this project, please fork the repo and create a pull request. You can also simply open an issue with the label "enhancement". Don't forget to give the project a star! Thanks again.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
Distributed under the MIT License. See LICENSE.txt
for more information.
Tom McKenna - Follow me on LinkedIn! - tom2mckenna@gmail.com
Project Link: https://github.com/TomMcKenna1/financial-asset-monitor