Karl Hudgell ddec1e3683 perf(price): parallelize price fetching with thread pool for faster processing
- Use ThreadPoolExecutor to fetch stock prices concurrently across multiple holdings
- Pre-fetch FX rates for unique non-GBP currencies before parallel price fetching
- Group price fetching and FX calculation into separate processing phases
- Reduce I/O wait time by executing network requests in parallel instead of sequentially
2026-04-20 11:59:27 +01:00

Freetrade Portfolio Tracker

Fetches live stock prices from Freetrade and calculates portfolio holdings values.

Setup

python -m venv venv
venv\Scripts\activate        # Windows
source venv/bin/activate     # Linux/Mac

pip install requests beautifulsoup4

Usage

Copy the sample file and add your own positions:

cp holdings.sample.csv holdings.csv

Format (ticker,market,shares):

GGP,GB,100
PAF,GB,200
SVM,US,50

Markets: GB for UK stocks, US for US-listed stocks.

Run:

python price.py                  # uses holdings.csv by default
python price.py my_portfolio.csv # custom file

Output (JSON):

[
  {
    "ticker": "GGP",
    "market": "GB",
    "shares": 100,
    "price": 7.67,
    "total_value": 767.0
  }
]
Description
No description provided
Readme 30 KiB
Languages
Python 100%