Skip to content

An always-on financial asset tracker for use with a Raspberry Pi and a supported display.

Notifications You must be signed in to change notification settings

TomMcKenna1/financial-asset-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

financial-asset-monitor

Visually track any financial asset on a Raspberry-Pi Zero W (2) and a supported display.
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Configuration
  4. Examples
  5. Adding an unsupported display
  6. Roadmap
  7. Contributing
  8. License
  9. Contact

About The Project

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

Getting Started

To run this project, follow the steps below.

Raspberry Pi setup

The first step is to setup your raspberry pi and install the necessary dependancies. Please follow the below steps:

  1. Flash your rasberry-pi with the latest stable Raspberry Pi OS Lite. You must configure the image with your WiFi details, and enable SSH.
  2. SSH into your raspberry-pi
  3. Enable the SPI interface by running the command:
    sudo raspi-config
    This will launch the raspi-config utility. Enter “Interfacing Options”. Highlight the “SPI” option and toggle it on.
  4. Install the necessary dependancies:
    sudo apt update
    sudo apt install git-all python3-pip python3-dev python3-pandas python3-pil python3-numpy

For Waveshare displays

In order to use waveshare e-ink displays, you must install the necessary drivers. To do this, please follow the steps below:

  1. Clone the driver repository:
git clone https://github.com/waveshareteam/e-Paper ~/e-Paper
  1. Install the necessary drivers:
pip3 install ~/e-Paper/RaspberryPi_JetsonNano/python/

Running the project

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.

  1. Clone the repository:
git clone https://github.com/TomMcKenna1/financial-asset-monitor
  1. Install project dependancies:
cd financial-asset-monitor
pip3 install -r requirements.txt
  1. Run the main.py file:
python3 main.py

Configuration

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)
  • 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)
  • 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)
  • 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)

Examples

BTC with candle stick chart

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

META, AAPL, AMZN, GOOG with line charts

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

Adding an unsupported display

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:

  1. Navigate to the displays directory within the asset tracker:
    cd asset_tracker/displays
  2. Create a new python file under whatever name you want:
    touch YOUR-NAME-HERE.py
  3. Within this python file, import both the base Display and the DisplayFactory classes:
    from .base import Display
    from .display_factory import DisplayFactory
  4. 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
  5. This class must contain all function implementations defined in the base Display class.

Roadmap

  • Support different time series (currently only supports monthly)

See the open issues for a full list of proposed features (and known issues).

Contributing

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.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Tom McKenna - Follow me on LinkedIn! - tom2mckenna@gmail.com

Project Link: https://github.com/TomMcKenna1/financial-asset-monitor

About

An always-on financial asset tracker for use with a Raspberry Pi and a supported display.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages