A simple Python application to track your stock portfolio performance using real-time data from Yahoo Finance.
- Multiple purchase tracking for the same stock
- Profit/Loss calculation
- Percentage gain/loss
- Visual emojis and color indicators
- Clean, formatted output
- Python 3.x
- yfinance package
pip install -r requirements.txt-
Remove the
.txtextension from theconfig.py.txtfile -
Add your stocks to the
config.pyfile in this format:from models import Stock stocks: list[Stock] = [ ["STOCK_SYMBOL", SHARES, PURCHASE_PRICE], # Example: ["AAPL", 2, 124.56], ]
-
Run the application:
python3 main.py
••••••••••••••••••••••••••••••••••••••••
📈 Stock name: AAPL
🔢 Quantity: 2
💵 Purchase price: $124.56
💰 Current price: $245.55
💎 Holdings: $491.10
📈 Profit: $241.98
📈 Profit %: 97.13%
••••••••••••••••••••••••••••••••••••••••