792 B
792 B
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
}
]