55 lines
932 B
Markdown
Raw Normal View History

# Freetrade Portfolio Tracker
Fetches live stock prices from Freetrade and calculates portfolio holdings values.
## Setup
```bash
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:
```bash
cp holdings.sample.csv holdings.csv
```
2026-04-20 12:32:55 +01:00
Format (`name,ticker,market,shares`):
```csv
2026-04-20 12:32:55 +01:00
Greatland Resources,GGP,GB,6
Pan African Resources,PAF,GB,78
Nvidia,NVDA,US,0.09761572
```
Markets: `GB` for UK stocks, `US` for US-listed stocks.
Run:
```bash
python price.py # uses holdings.csv by default
python price.py my_portfolio.csv # custom file
```
Output (JSON):
```json
[
{
2026-04-20 12:32:55 +01:00
"name": "Greatland Resources",
"ticker": "GGP",
"market": "GB",
2026-04-20 12:32:55 +01:00
"shares": 6,
"currency": "GBP",
"price": 7.69,
"fx_rate": 1.0,
"total_value_gbp": 46.14
}
]
```