How to Use and Setup
This section guides you through the process of setting up and using the Portfolio and Options Tracker.
Setup
-
Install Dependencies:
pip install tkinter yfinance sv-ttk matplotlib numpy -
Clone the Repository:
git clone https://github.com/yourusername/portfolio-options-tracker.git cd portfolio-options-tracker -
Run the Application:
python portfolio_tracker.py
Getting Started
Initial Setup
-
Launch the Application
- Run the Python script to open the main interface
- The application will create necessary data files automatically
-
Add Initial Cash (Required before buying stocks)
- Navigate to the “Cash Management” section
- Enter the amount you want to deposit
- Click “Add Cash” to add funds to your account
- Verify the cash balance appears in your portfolio summary
Managing Your Stock Portfolio
Buying Stocks
-
Enter Stock Details:
- Stock Ticker: Enter the symbol (e.g., AAPL, MSFT, GOOGL)
- Shares: Number of shares to purchase
- Purchase Price: Price per share you paid
- Date: Purchase date in YYYY-MM-DD format
-
Execute Purchase:
- Click “Buy Stock”
- Application automatically verifies sufficient cash balance
- Purchase amount is deducted from cash
- Shares are added to your portfolio with cost basis tracking
Selling Stocks
-
Enter Sale Details:
- Stock Ticker: Symbol of stock to sell
- Shares: Number of shares to sell
-
Execute Sale:
- Click “Sell Stock”
- Shares are sold at current market price
- Proceeds are automatically added to cash balance
- System only allows selling available (non-contracted) shares
Trading Covered Calls
Creating Covered Calls
-
Prerequisites:
- Ensure you own 100+ available shares of the target stock
- Shares must not be tied up in existing contracts
-
Enter Call Details:
- Stock Ticker: Must match a stock you own
- Expiration Date: Contract expiration date (YYYY-MM-DD)
- Strike Price: The strike price for your call option
- Premium per Share: Premium you received for the contract
-
Execute Contract:
- Click “Add Covered Call”
- System validates sufficient available shares
- Premium × 100 is added to your cash balance
- 100 shares are locked in the contract
Managing Active Calls
- View Positions: All active calls display in the “Covered Calls” section
- Monitor Expiration: Days remaining are automatically calculated
- Manual Exercise: Use “Call Away (Exercise)” button for early assignment
- Automatic Processing: System handles expiration automatically
Understanding Your Portfolio Display
Portfolio Summary
- Total Portfolio Value: Complete account value (stocks + cash + options)
- Stock Value (Available): Value of shares you can freely trade
- Stock Value (In Contracts): Value of shares tied up in covered calls
- Cash: Available buying power for new purchases
- Options Value: Current theoretical value of option positions
Holdings Display Example
AAPL: 50 available + 100 contracted @ $150.25 | Total: $22,537.50 | +$2,537.50 (+12.73%)
MSFT: 75 shares @ $280.40 | Value: $21,030.00 | +$1,030.00 (+5.15%)
Dividend Tracking Display
AAPL | $0.25/share | Ex: 2024-08-09 | Pay: 2024-08-16 | Days: 12 | ⏳ PENDING
MSFT | $0.30/share | Ex: 2024-05-15 | Pay: 2024-05-22 | Days: -30 | ✓ PAID
Cash Management
Adding Cash
- Enter deposit amount in “Cash Management” section
- Click “Add Cash”
- Amount is immediately available for stock purchases
Tracking Withdrawals
- Enter withdrawal amount as negative value
- Click “Add Cash” to record the withdrawal
- Cash balance is reduced accordingly
Dividend Management
Automatic Features
- Historical Recovery: System scans past 6 months for missed dividends
- Announcement Detection: Automatically detects new dividend announcements
- Eligibility Verification: Only credits dividends if stock owned before ex-dividend date
- Payment Processing: Automatically processes payments on scheduled dates
Manual Dividend Entry
- Navigate to dividend tracking section
- Enter dividend details if automatic detection fails
- System will validate and process the entry
Theme and Customization
Toggle Theme
- Use the theme button to switch between dark and light modes
- Setting is remembered between sessions
Window Management
- Application window can be resized vertically as needed
- Layout automatically adjusts to window size
Data Management
Automatic Saving
- All data is automatically saved to local text files
- Changes are persisted immediately upon execution
Data Files Created
portfolio.txt: Stock holdings with purchase detailscoveredcalls.txt: Active covered call positionsdividends.txt: Dividend tracking and historycash.txt: Current cash balance
Backup Recommendations
- Regularly backup the four data files to preserve your investment data
- Files use simple text format for easy manual editing if needed
Important Usage Notes
- Internet Required: Application needs internet connection for real-time prices and dividend data
- Date Format: Always use YYYY-MM-DD format for all date entries
- Share Requirements: Need exactly 100+ available shares for each covered call contract
- Cash Requirements: Must have sufficient cash before any stock purchase
- Market Hours: Stock prices update in real-time during market hours
- Automatic Processing: System handles dividend detection and option expiration on startup