A Python package to track liquid assets from yfinance across several KPIs & KRIs.
- Side by side comparison of two (liquid) assets with selectiona cross:
- stocks:
- US, JP, FR, DE, SU
- crypto:
- BTC, ETH, SOL
- ETFs:
- US
- stocks:
- UI with following features:
- Tab "asset comparison" to benchmark two assets (soon to follow other tabs with more functionality)
- Variable start_date, end_date selection
- Price type selection by OPEN, CLOSE, HIGH, LOW
- Risk free rate as input field for both selected assets (if given) to calcualte Sharpe ratio
- Analyse button to open a pop up for user entry
- Exit button to quit the app
- Analytics with following features:
- KPIs:
- Return of both assets
- Dividend yield of both assets (if given)
- Price earnings ratio of both assets
- Sharpe ratio of both assets (if risk free rate is provided)
- KRIs:
- Risk (volatility based on selected timespan from start_date, end_date)
- Correlation of both assets
- Charts:
- Comparison of price trajectory for both assets (in ccy of first asset!)
- Comparison of return trajectory for both assets (in %)
- Comparison of volume trajectory for both assets (in traded units)
- Comparison of risk/return profile for both assets (in %)
- KPIs:
- JSON file with latest tickers and friendly names for identification
- Python 3.11+ (tested with 3.11.9)
- Required dependencies, see requirements.txt
-
Clone the repository:
git clone https://github.com/hb84ffm/portfolio-tracker.git
cd portfolio-tracker -
Create & activate your virtual environment:
python3 -m venv venv
source venv/bin/activate # On Mac/Linux
venv\Scripts\activate # On Windows -
Install dependencies:
pip install -r requirements.txt
-
Open the app via termins/zsh by command streamlit run "path_to_app/app.py"
-
Press "Analyse" button to select assets & specify parameters, then press "Run"
- Multiple features will be added from time to time!
portfolio_tracker/
├─── __init__.py
├─── main.py # Orchestrates all modules
├─── streamlit./ # Hidden folder with config.toml file
├─── config.toml # config.toml for app layout & format
├─── asset_comparison/
├─── __init__.py
├─── asset_comparison.py # Module to pull data and run analytics
├─── utils/
├─── __init__.py
├─── utils.py # Module with utils (exit button, logout) needed across all other
├─── ticker_names/
├─── ticker_names.json # JSON file with ticker names (can be adjusted if needed!)
### EXAMPLE WORKFLOW
See provided Jupyter notebook [example](https://github.com/) for explanation.
### AUTHOR
For questions or feedback reach out to me via: [GitHub](https://github.com/hb84ffm).

