How to Use and Setup

This section guides you through the process of setting up and using the Portfolio and Options Tracker.

Setup

  1. Install Dependencies:

    pip install tkinter yfinance sv-ttk matplotlib numpy
  2. Clone the Repository:

    git clone https://github.com/yourusername/portfolio-options-tracker.git
    cd portfolio-options-tracker
  3. Run the Application:

    python portfolio_tracker.py

Getting Started

Initial Setup

  1. Launch the Application

    • Run the Python script to open the main interface
    • The application will create necessary data files automatically
  2. 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

  1. 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
  2. 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

  1. Enter Sale Details:

    • Stock Ticker: Symbol of stock to sell
    • Shares: Number of shares to sell
  2. 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

  1. Prerequisites:

    • Ensure you own 100+ available shares of the target stock
    • Shares must not be tied up in existing contracts
  2. 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
  3. 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

  1. Enter deposit amount in “Cash Management” section
  2. Click “Add Cash”
  3. Amount is immediately available for stock purchases

Tracking Withdrawals

  1. Enter withdrawal amount as negative value
  2. Click “Add Cash” to record the withdrawal
  3. 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

  1. Navigate to dividend tracking section
  2. Enter dividend details if automatic detection fails
  3. 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 details
  • coveredcalls.txt: Active covered call positions
  • dividends.txt: Dividend tracking and history
  • cash.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